questions > RE: dcm2nii converting resting state files error
Sep 14, 2016  03:09 PM | Chris Rorden
RE: dcm2nii converting resting state files error
Hello Lucero,

Thanks for your sample images. There are two issues with your images:

1.) first the Siemens CSA headers have been stripped away. Once this data is removed there is no way to determine important parameters such as slice order, slice timing, bvec, bval
   http://nipy.org/nibabel/dicom/siemens_csa.html
2.) The original uncompressed image data was saved as the DICOM-specific, ancient, lossless JPEG compression (transfer syntax 1.2.840.10008.1.2.4.70).
  https://www.nitrc.org/plugins/mwiki/index.php/dcm2nii:MainPage#Transfer_Syntaxes_and_Compressed_Images
While in theory my software can handle these, it expects 3D data to be saved as single JPEG with multitple frames, while your data stores each slice as a separate image fragment. Therefore, unless my software is modified it only converts the first slice of each 3D volume. While an engineer could modify my code to support this variation of this format, I am disinclined to do so, as I do not like this format because 
 a.) none of the popular standard JPEG libraries support it
 b.) some vendors mis-interpreted the standard, so following the specification does not always lead to correct decompression
 c.) this method tends to yield very poor compression ratios, if you want to save disk space you will do much better with generic file compression schemes like zip or gz

Solutions:
 1.) You could uncompress your image data using dcmdjpeg. Future versions of my software will provide the user with a hint when it encounters files like yours: "Unable to decode all slices (1/48). Please use dcmdjpeg to uncompress data." Once this is done, you can convert your images.
 2.) You could update dcm2niix to handle your images (look at function nii_loadImgJPEGC3) 
  https://github.com/neurolabusc/dcm2niix/blob/master/console/nii_dicom.cpp 
3.) Neither solution 1 or 2 can do anything about the missing CSA data. The best solution is to go directly to your scanner and get the original images before they had vital aspects removed and were saved in an arcane format.

Threaded View

TitleAuthorDate
landsmbarbara Sep 4, 2015
Chris Rorden Sep 4, 2015
Kai-Chun Yang Feb 6, 2017
Chris Rorden Feb 7, 2017
Kai-Chun Yang Feb 9, 2017
lucero pacheco Sep 11, 2016
RE: dcm2nii converting resting state files error
Chris Rorden Sep 14, 2016
Chris Rorden Sep 12, 2016
landsmbarbara Sep 7, 2015