How can I convert DICOM series to NRRD files in batch mode?

Here is how you can do the conversion in batch mode.

First, install mpReview extension. This will add two new modules: mpReview and mpReviewPreprocessor.

mpReviewPreprocessor can be used to volume-reconstruct any collection of DICOM files in batch mode using Slicer DICOM plugins. It can be accessed from the Slicer GUI, but you can also run the script as from the command line follows (you will need to update the path to the preprocessor to the on your system after installing the script, or you can just download the script from the GitHub repository here):

Slicer --no-main-window --no-splash --python-script \
/Applications/Slicer.app/Contents/Extensions-27269/mpReview/lib/Slicer-4.9/qt-scripted-modules/mpReviewPreprocessor.py \
-- -i DSC-DICOM -o DSC-mpReview

-i takes a directory with DICOM files (it can have any hierarchy of subordinate content, will be scanned recursively

-o is the output directory.

After script is completed, it will have a hierarchy of directories similar to what is shown below (the example I show is for the dataset you shared earlier) -

<PatientID> \ RESOURCES \ <SeriesNumber> \ Reconstructions \ <SeriesNumber>.nrrd

image

The NRRD file will be the one that corresponds to the default loadable when the corresponding DICOM series is loaded using DICOM Browser. If you need to customize this behavior, you would need to look into the script, but the default behavior might be sufficient for you.

Note that to correctly parse your specific DSC MRI dataset patch that I introduced last week will be needed, otherwise the resulting volume will not have the timing information. The patch was integrated today, and, if things go well, you should be able to access the updated nightly tomorrow.

Let us know if this answers your question.

1 Like