Skip to content

dcm2nii interface fails when compression is not possible #1267

@mih

Description

@mih

heudiconv fails to convert an SWI scan:

> /home/data/psyinf/forrest_gump/satratest/git/bin/heudiconv(305)convert()
    304                         else:
--> 305                             shutil.copyfile(res.outputs.converted_files, outname)
    306                         if isdefined(res.outputs.bvecs):

ipdb> res.outputs.converted_files
<undefined>

I cannot debug this to 100% certainty right now, but my guess is that the interface doesn't detect any output, because dcm2nii stdout doesn't leave a compatible trace. Here is what it looks like (cropped to representative lines):

% dcm2nii -a y -c y -v y -d y -e y -g y -i n -n y -o /tmp/heudiconvtmpyZJZzv/convert -p y -x n -f n IM_0320                   Chris Rorden's dcm2nii :: 4AUGUST2014 (Debian) 64bit BSD License
reading preferences file /home/mih/.dcm2nii/dcm2nii.ini
0 files in working directory /tmp/heudiconvtmp3Hk3fK/study_hw97swi
Data will be exported to /tmp/heudiconvtmpyZJZzv/convert/
Validating 1002 potential DICOM images.
Found 1000 DICOM images.
Converting 1000/1000  volumes: 2
IM_0501->20140909_100509VENBOLDHR32chSHCSENSEs301a1003.nii
Warning: images have different precision or intensity scaling - saving as 32-bit float
Very large volume: 0.9765625 Gb: slice-by-slice conversion required.
Unable to automatically GZip such a large file.
 Converting data to 32-bit float to correct for differences slope/intercept/precision:  16.04590988     0.00000000      16
 Converting data to 32-bit float to correct for differences slope/intercept/precision:  16.04590988     0.00000000      16
 Converting data to 32-bit float to correct for differences slope/intercept/precision:  16.04590988     0.00000000      16
...
 Converting data to 32-bit float to correct for differences slope/intercept/precision:  1.53455436      -3142.00000000  16
 Converting data to 32-bit float to correct for differences slope/intercept/precision:  1.53455436      -3142.00000000  16
 Converting data to 32-bit float to correct for differences slope/intercept/precision:  1.53455436      -3142.00000000  16

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions