Heudiconv midifed to work on LCBC Siemens Dicoms (Avanto/Skyra/Prisma)
261
This is a flexible DICOM converter for organizing brain imaging data into structured directory layouts.
You can clone this directory and do a make install
or pip install https://github.com/nipy/heudiconv/archive/master.zip
as long as the following dependencies are in your path you can use the package
Please read this tutorial to understand how heudiconv works in practice.
To generate lean BIDS output, consider using both the -b and the --minmeta flags
to your heudiconv command. The -b flag generates a json file with BIDS keys, while
the --minmeta flag restricts the json file to only BIDS keys. Without --minmeta,
the json file and the associated Nifti file contains DICOM metadata extracted using
dicomstack.
Call heudiconv like this:
heudiconv -d '{subject}*.tar*' -s xx05 -f ~/myheuristics/convertall.py
where -d '{subject}*tar*' is an expression used to find DICOM files
({subject} expands to a subject ID so that the expression will match any
.tar files, compressed or not that start with the subject ID in their name).
An additional flag for session ({session}) can be included in the expression
as well. -s od05 specifies a subject ID for the conversion (this could be a
list of multiple IDs), and -f ~/myheuristics/convertall.py identifies a
heuristic implementation for this conversion (see below) for details.
This call will locate the DICOMs (in any number of matching tarballs), extract
them to a temporary directory, search for any DICOM series it can find, and
attempts a conversion storing output in the current directory. The output
directory will contain a subdirectory per subject, which in turn contains an
info directory with a full protocol of detected DICOM series, and how their
are converted.
info directoryThe info directory contains a copy of the heuristic script as well as the
dicomseries information. In addition there are two files NAME.auto.txt and
NAME.edit.txt. You can change series number assignments in NAME.edit.txt and
rerun the converter to apply the changes. To start from scratch remove the
participant directory.
soon you'll be able to:
The heuristic file controls how information about the dicoms is used to convert
to a file system layout (e.g., BIDS). This is a python file that must have the
function infotodict, which takes a single argument seqinfo.
seqinfo and the s variableseqinfo is a list of namedtuple objects, each containing the following fields:
128 125000-1-1.dcm 1 - -
- 160 160 128 1 0.00315 1.37 AAHScout False
infotodictThis dictionary contains as keys a 3-tuple (template, a tuple of output types, annotation classes).
template - how the file should be relative to the base directory tuple of output types - what format of output should be created - nii.gz, dicom, etc.,. annotation classes - unused
Example: ('func/sub-{subject}_task-face_run-{item:02d}_acq-PA_bold', ('nii.gz',
'dicom'), None)
A few fields are defined by default and can be used in the template:
Additional variables may be added and can be returned in the value of the dictionary returned from the function.
info[some_3-tuple] = [12, 14, 16] would assign dicom sequence groups 12, 14
and 16 to be converted using the template specified in some_3-tuple.
if the template contained a non-sanctioned variable, it would have to be provided in the values for that key.
some_3_tuple = ('func/sub-{subject}_task-face_run-{item:02d}_acq-{acq}_bold', ('nii.gz',
'dicom'), None)
In the above example {acq} is not a standard variable. In this case, values
for this variable needs to be added.
info[some_3-tuple] = [{'item': 12, 'acq': 'AP'},
{'item': 14, 'acq': 'AP'},
{'item': 16, 'acq': 'PA'}]
Content type
Image
Digest
Size
448.6 MB
Last updated
over 8 years ago
docker pull kasbohm/heudiconv