questions > Option to convert only single series does not work
Showing 1-2 of 2 posts
Display:
Results per page:
Sep 4, 2025  11:09 AM | Christian Paret - Central Institute for Mental Health
Option to convert only single series does not work

Hey there,


first of all: great software!


dcm2niix works fine, as long as I do not use option -n (e.g., -n 4) to convert single series. From the output written to the terminal, everything seems to run quite fine. I also get the message "Conversion required 6.709000 seconds", but no nifti-images are written to the output folder. As said, as long as I do not add option -n to command line, everything works as expected and nifti-output is received.


I am using dcm2niiX version v1.0.20250505 with dicoms acquired with Siemens syngo XA60. I should say that I use to operate dcm2niix via matlab (system('PathTo/dicm2niix.exe')


Hope, there is a solution?

Sep 4, 2025  11:09 AM | Chris Rorden
RE: Option to convert only single series does not work

The -n option is an advanced feature that is used by MRIcroGL and FSLeyes to provide a user with a list of all of the DICOMs in a folder and allow them to select just one to load. Since a folder might have many repeats of a particular series, you need to know how dcm2niix encodes the details as a CRC code. Therefore, to use the -n option you run it twice, once with the value -1 to list CRCs and their corresponding series, and subsequently with the CRC of the series you wish to convert. To provide a concrete example with Siemens XA60, consider the validation dataset dcm_qa_xa60 where we only want to convert the series that used the CMRR research sequences and with iPAT=3 and multi-band = 1. We first query the folder to identify the CRC (which turns out to be 257128538) and then convert just that series:



$ dcm2niix -n -1 ./dcm_qa_xa60

Chris Rorden's dcm2niiX version v1.0.20250626  Clang17.0.0 ARM (64-bit MacOS)

257128538 ./dcm_qa_xa60/dcm_qa_xa60_C2P_cmrr_mbep2d_bold_p3_mb1_20241004141746_8

 ./dcm_qa_xa60/In/XA60/DICOM/24100413/39280000/75739574

 ..

  3832686387 ./dcm_qa_xa60/dcm_qa_xa60_C2P_cmrr_mbep2d_bold_p2_mb5_20241003104115_12

 ./dcm_qa_xa60/In/XA61/DICOM/24100310/14440000/88972664

$ dcm2niix -n 257128538 ./dcm_qa_xa60

Chris Rorden's dcm2niiX version v1.0.20250626  Clang17.0.0 ARM (64-bit MacOS)

Convert 3 DICOM as ./dcm_qa_xa60/dcm_qa_xa60_C2P_cmrr_mbep2d_bold_p3_mb1_20241004141746_8 (64x64x10x3)

Conversion required 0.269020 seconds (0.268941 for core code).

Note that when you query dcm2niix, it reports the following details for each series: CRC; filename; (image_dimensions). You can use the `-f` option to choose what details should be shown in the filename, which can help you parse what image you will convert, for example `-f %t_%s_%p` will provide the datetime_seriesNumber_protocolName.