Open neurorepro opened 1 year ago
@yarikoptic I got a new error with #634 . This definitely counts as progress:
INFO: Running heudiconv version 0.11.6.post31+g24f4d88 latest 0.11.6
INFO: Need to process 1 study sessions
INFO: PROCESSING STARTS: {'subject': 'mysubj', 'outdir': '/mnt/projects/data/dcm_bids/bids_dwi_min_newheudi/', 'session': '01'}
INFO: Processing 7 dicoms
INFO: Analyzing 7 dicoms
/home/michael/.conda/envs/heudiconv310_dwi/lib/python3.10/site-packages/nibabel/nicom/dicomwrappers.py:525: UserWarning: Derived images found and removed
warnings.warn('Derived images found and removed')
Traceback (most recent call last):
File "/home/michael/.conda/envs/heudiconv310_dwi/bin/heudiconv", line 8, in <module>
sys.exit(main())
File "/home/michael/.conda/envs/heudiconv310_dwi/lib/python3.10/site-packages/heudiconv/cli/run.py", line 24, in main
workflow(**kwargs)
File "/home/michael/.conda/envs/heudiconv310_dwi/lib/python3.10/site-packages/heudiconv/main.py", line 379, in workflow
prep_conversion(sid,
File "/home/michael/.conda/envs/heudiconv310_dwi/lib/python3.10/site-packages/heudiconv/convert.py", line 172, in prep_conversion
seqinfo = group_dicoms_into_seqinfos(
File "/home/michael/.conda/envs/heudiconv310_dwi/lib/python3.10/site-packages/heudiconv/dicoms.py", line 232, in group_dicoms_into_seqinfos
if mw.is_same_series(mwgroup[idx]):
File "/home/michael/.conda/envs/heudiconv310_dwi/lib/python3.10/site-packages/nibabel/nicom/dicomwrappers.py", line 357, in is_same_series
my_sig = self.series_signature
File "/home/michael/.conda/envs/heudiconv310_dwi/lib/python3.10/site-packages/nibabel/onetime.py", line 142, in __get__
val = self.getter(obj)
File "/home/michael/.conda/envs/heudiconv310_dwi/lib/python3.10/site-packages/nibabel/nicom/dicomwrappers.py", line 625, in series_signature
signature['image_shape'] = (self.image_shape, eq)
File "/home/michael/.conda/envs/heudiconv310_dwi/lib/python3.10/site-packages/nibabel/onetime.py", line 142, in __get__
val = self.getter(obj)
File "/home/michael/.conda/envs/heudiconv310_dwi/lib/python3.10/site-packages/nibabel/nicom/dicomwrappers.py", line 505, in image_shape
first_frame = self.frames[0]
File "/home/michael/.conda/envs/heudiconv310_dwi/lib/python3.10/site-packages/pydicom/multival.py", line 104, in __getitem__
return self._list[index]
IndexError: list index out of range
@yarikoptic looking at the conversion of other metrics with version 0.11.6
of heudiconv (not the PR), i also got the error for TRACEW
, but not for FA
and ColFA
(which stands for something like colored FA).
Serendipitously i noticed that the third dimension of ColFA
is not properly retrieved by heudiconv which shows dim3
to be 1 instead of 94
. This may be due to the image datatype (RGB24) and Siemens colored FA volumes are probably not on top of heudiconv backlog.
given that we get through nibabel/nicom/dicomwrappers.py", line 357, in is_same_series
-- the issue might even be in nibabel , and worth checking/filing there.
also happens upon the same del mw.series_signature[sig]
for
@neurorepro could you try with current fresh nibabel? current heudiconv image has it: https://github.com/nipy/heudiconv/issues/670#issuecomment-1969286655
Summary
heudiconv crashes when converting a derived ADC map from Siemens scanner with the following trace:
This is generated by
frame_indices = np.delete(frame_indices, stackid_dim_idx, axis=1)
in the if-block:Looks like this is because
frame_indices
is empty (so no second axis), which should be expected for a derived map though, since earlier there is:with
So for a derived map
self.frames
will become empty, soframe_indices
will be so as well, and so the if-block will bring hell.The thing i don't understand is why we are running the if-block in this case, and why the condition evaluates to true in my case where
stackid_tag=2134102
anddim_seq[0] = (0020, 9056)
. But i have to admit i didn't look into the__int__
function of thedim_seq
items.Just in case this is useful, here is the metadata for this single problematic dcm file:
Platform details:
Choose one:
[x] Local environment
[ ] Container
Heudiconv version:
Running heudiconv version 0.11.6 latest 0.11.6