Crop & reorient: dcm2nii succesfully running but no co-file creation, i.e. no file cropping

Dear Prof. Yan,

first, thank you for the amazing tool, which has helped me tremendously in my past research!

While I have not encountered major issues in the past, I now have come across something I couldnt fix a for: While trying to run a preprocessing pipeline on fresh and otherwise untouched functional images (par/rec to nifti, just one "test" file before I would like to apply to all data), the option "Crop T1", which should create "o_xxx" and "co_xxx" files and crop as well as reorient the images, seems to have no effect on the data. When checking the option, either together with other steps or standalone, chris rordens dcm2niiX gets called, apparently runs succesfully and states that the image has been reoriented and cropped and then the preprocessing continues if other steps have been included or terminates if it was the only option selected. However the actual T1 img has not been cropped or reoriented and no "co_xxx" or "o_xxx" files are created. I have attached a screenshot of the message.

If I install the standalone dcm2nii (included in mricron)on my pc and try to crop and reorient the image manually with it, I get the desired result of a cropped and reoriented T1 Image, even though the orientation seems not to change as it is seemingly good already.

What could be the error here?

I am using DPARSFA V5.0_200401 with Matlab R2019b on Ubuntu 18.04. I tried it both with a standalone installation of dcm2nii installed and uninstalled on my pc. I have double and tripple checked that everything is in the correct folder etc., which should be fine anyway, as other preprocessing steps run succesfully.

Thank you in advance for any help!

Best regards



Image icon dparsfa_dcm2nii_error.png10.51 KB

I think it's now named as something like *Crop* 

Thanks for the qick reply!

But what do you mean exacly with "it"? The option itself or the output files? Problem is that the option "Crop T1" does not do anything for me - no new files are created at all and neither is the old one cropped or anything. So it seems to run but not actually work?

I am not sure for your specific case. For my files, the output filename is something like *Crop*.

Thanks for the reply again!

Maybe I have miss-formulated my question. The problem is not about the output filenames. The problem is that there is NO output created at all. If I select the "crop T1" option in DPARSFA dcm2nii is called but does not actually crop the images, i.e. no cropping is taking place. 

Later on I then get a warning that no "co" files can be found, which is logical as the cropping does not work.

If I however use dcm2nii outside of dparsfa the cropping does work, so I can manually crop the images myself but the cropping by DPARSFA doesnt work.

Did this make things clearer? I am very sorry for the inconvience and thank you for your patience!

OK. I may have a look in the future. As for now, you can call dcm2nii by yourself and feed them into DPABI.

Dear Prof. Yan,

I used DPABI V6.0 & DPARSFA V5.2 and encountered the same problem as described here.
I selected the Crop T1 option and dcm2nii is running properly (as reported in the MATLAB command window)
but no co* image is produced and saved and therefore DPARSFA stops and asked for a co* T1 image.
Any idea how to fix this problem?
Thanks in advance for any advice
Best regards
Jürgen Hänggi


If you start from T1Raw, there should be a file as "*Crop*" with dcm2niix.

I have not tested on T1Img to see if "*Crop*" would be generated with this version. Could you please figure out a way to crop T1Img with the latest dcm2niix and report here?

Dear Prof. Yan

thanks for your answer. Because I have no DICOM files (only NIFTI), I cannot start from T1Raw directory, i.e. I have to start from T1Img directory. However, when I using the older DPARSFA version 4.4, the cropped files are produced when starting with T1Img directory and NIFTI files. I do not have much experience with MATLAB programming and hence it is difficult for me to find a work around.
Best regards Jürgen Hänggi

Hi Jürgen,

Seems the new dcm2niix doesn't take NIfTI file as input to crop.

If you have to do this, you may need to use an older version of DPARSF to do the crop step first, and then late use the newest version to do the follows.