Closed effigies closed 4 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 92.26%. Comparing base (
27c2427
) to head (3f81a96
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@yarikoptic @mgxd Would either of you care to have a look?
That happens a couple lines below.
this DICOM handling to just figure out the shape of the data is somewhat of a dark magic for me, so can't really assess on validity. But what I can say that
with this patch (with post-installed pydicom) I get only that other `Calculated shape does not match number of frames.
❯ /usr/bin/find dcm_* -type d | grep -v '\.git/' | while read d; do dcm=$(/bin/ls $d/*.dcm 2>/dev/null| head -n 1 || echo ); [ -z "$dcm" ] || chronic /home/yoh/proj/nipy/nipy-suite/nibabel/venvs/dev3/bin/python -W ignore::UserWarning -c 'import sys; f=sys.argv[1]; print(f, end=" "); from nibabel.nicom import dicomwrappers as didw; print(didw.wrapper_from_file(f).image_shape)' $dcm; done;
dcm_qas/dcm_qa_fmap/In/Philips/fmap/IM_0027_fMAP.dcm Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/yoh/proj/nipy/nipy-suite/nibabel/venvs/dev3/lib/python3.11/site-packages/nibabel/onetime.py", line 156, in __get__
val = self.getter(obj)
^^^^^^^^^^^^^^^^
File "/home/yoh/proj/nipy/nipy-suite/nibabel/venvs/dev3/lib/python3.11/site-packages/nibabel/nicom/dicomwrappers.py", line 569, in image_shape
raise WrapperError('Calculated shape does not match number of frames.')
nibabel.nicom.dicomwrappers.WrapperError: Calculated shape does not match number of frames.
so, not sure if returned dimensionality is right, but it is definitely not hitting the error any more.
my question would be - how feasible would be to get the release with this out? ;) or should we test more?
Could put out a 5.2.1 with this and other bug fixes. Is the shape mismatch thing something we can address?
on that - added a little to its own
795 cast a wide net, based on Phillips DICOMs that concatenated derived volumes to diffusion series. This causes problems for Siemens sequences where only derived volumes are contained in an image.
This is a pretty minimal fix that changes the rule to "if raw and derived are present, drop derived, otherwise keep whatever we have".
Fixes #1245.