Miscellaneous scripts.
Open a browser window to get credentials for the Scitran API.
python oauth2cli.py create --auth_host_port 9000 --client-secret <client-secret> --client-id <client-id>
It creates a json file called "credentials_sdm". The credentials' access_token is also printed to stdout.
To refresh an existing token.
python oauth2cli.py refresh
To revoke an existing token.
python oauth2cli.py revoke
It is possible to pass an argument --filename
to specify where the credentials are stored.
Requirements: oauth2client, httplib2
Organize a mess of dicoms into exams/series.
dicomsort.py tarsort ./mess/of/dicoms ./sort/dest ./tar/dest
The sortable dicoms will be organized into the sort destination (./sort/dest
from example) by exam number and series number. Unsortable dicoms will be
left in the original source directory (./mess/of/dicoms
from example).
Output tarfiles will be placed into the tar destination (./tar/dest
from example), and be named by their exam number and series number.
Reconstruct and concatenate two niftis in the order the dicoms.tgz sources are provided on the command line. To reconstruct a Siemens multicoil scan, give the individual coil dicom.tgz as the first input, and the combined coil dicom.tgz as the second input.
siemens_multicoil.py ./path/to/individual_coils_dicoms.tgz ./path/to/combined_coils_dicoms.tgz
The output nifti will be named after the first dataset's exam and series number, suffixed with '_multicoil'i.