dcmunpack

Required Arguments:

Other Arguments {{

}}}

Sorts and converts a directory of Siemens or GE DICOM files into an output hierarchy with nifti (nii), mgh, mgz, or analyze output formats (will not create a series of 3D SPM files). This will recursively search through all the subdirectories of the source directory. To a large extent, this replaces unpacksdcmdir (the Siemens-only unpacker) and will take most of its command-line arguments.

-src dcmdir <-src dcmdir>

Dicom source directory. You can specify more than one. If you just specify a source directory, it will give a summary of what it finds (like -scanonly did for unpacksdcmdir). You should still give it -one-per-dir or -martinos if applicable.

-targ targetdir

Output directory. Do not need to include when just getting information about what is in the directory.

-run run subdir format stemname <<nskip> ndrop>

Specify unpacking rules for a given run (series), subdir is the subdirectory under the target dir, format is the format extension (nii, mgh, mgz, img), stemname is the base file name, nskip is the number of time points to skip (optional, good for some fMRI), and ndrop is the number of time points to drop from the end. The output file will be targetdir/subdir/RRR/fname.format if using the FSFAST output hierarchy (the default) or targetdir/subdir/fname.format with -generic, where RRR is the 3-digit, zero-padded run number. Eg, "-run 3 bold nii f" would become targetdir/bold/003/f.nii in fsfast or targetdir/bold/f.nii in generic. If the stemname has an extension, that extension is ignored.

-one-per-dir

Assume that the source directory (or subdirectory) contains only one series. This is usually the case for GE, and this can speed things up tremendously.

-martinos -mgh -bourget

Assume that the DICOM file names have the form produced at the MGH Martinos Center when you "push something to bourget" from the scanner, namely that each series will have one file that ends in "1.dcm", eg 397000-000007-000001.dcm. This can speed things up considerably. Note: as of August, 2012, the naming convention that allows for fast unpacking does not exist. If you have to run this twice, it will be faster if you run it with --index-out index.dat when you are getting a list of runs, then run it again with --index-in index.dat when you go to unpack it.

-no-infodump

Do not create the fname-infodump.dat file

-generic

Do not use FSFAST hierarchy.

-no-convert

Do not actually run mri_convert

-copy-only

Only copy dicom files to output directory (implies -no-convert)

EXAMPLE

# CD into the dicom directory cd Avanto-25096-20100325-162822-229000

# See what's there dcmunpack -src . -martinos


Searching for matching files Mon Jul 12 10:21:10 EDT 2010 Mon Jul 12 10:21:10 EDT 2010 Found 6 total files. Found 6 unique series: 1 2 3 4 5 6 Subject Subj5 Date 20100325 Time 162822.229000 Institution Martinos Center Bay 2 1 Localizer 2.95 7 20 0.546875 ROW 285 ./229000-000001-000001.dcm 2 AAScout 1.23 2.6 0 2.5\2.5 ROW 1085 ./229000-000002-000001.dcm 3 ge_functionals 40 2000 90 3.125\3.125 COL 2300 ./229000-000003-000001.dcm 4 ge_functionals 40 2000 90 3.125\3.125 COL 2300 ./229000-000004-000001.dcm 5 ge_functionals 40 2000 90 3.125\3.125 COL 2300 ./229000-000005-000001.dcm 6 ge_functionals 40 2000 90 3.125\3.125 COL


# Now unpack it dcmunpack -src . -martinos -targ /space/ProjectDir/subj5 \

RELATIONSHIP TO UNPACKSDCMDIR

unpacksdcmdir is the Siemens-only unpacker. dcmunpack will take the same command-line arguments except: -cfg, -seqcfg, -nspmzeropad, -no-unpackerr (it unpacks everything), and -scanonly (you can still get a scanonly-like summary of the data). dcmunpack does not accept SPM as an output format. The seq.info file is not created (it is not needed for newer versions of FSFAST). These features can be programmed, I just have not gotten around to it. Unlike unpacksdcmdir, dcmunpack searches subdirectories and can unpack GE data.