nipy / nibabel

Python package to access a cacophony of neuro-imaging file formats
http://nipy.org/nibabel/
Other
634 stars 258 forks source link

ENH: Improve text for dicomwrapper errors in shape calculation #1302

Closed yarikoptic closed 4 months ago

yarikoptic commented 4 months ago

To make https://github.com/nipy/nibabel/issues/1211 more informative.

In the particular case at hand of http://github.com/neurolabusc/dcm_qa_fmap IM_0027_fMAP.dcm we get

nibabel.nicom.dicomwrappers.WrapperError: Calculated # of frames (128=4*32) of shape (64, 64, 32, 2, 2) does not match NumberOfFrames 64.

and my wild uneducated guess is that we need to filter out few more of those entries from frame_indices where we have

> p dim_seq
[(0020, 9057), (2005, 106e), (2005, 1011)]

where only the first one "known" to pydicom's dictionary, and the other two something are likely something to filter out... @neurolabusc -- what do you remember about that IM_0027_fMAP.dcm or may be these particular DICOM tags?

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 92.27%. Comparing base (a35e2ac) to head (7569219). Report is 11 commits behind head on master.

:exclamation: Current head 7569219 differs from pull request most recent head d063b95. Consider uploading reports for the commit d063b95 to get more accurate results

Files Patch % Lines
nibabel/nicom/dicomwrappers.py 33.33% 1 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1302 +/- ## ======================================= Coverage 92.27% 92.27% ======================================= Files 99 99 Lines 12459 12460 +1 Branches 2561 2561 ======================================= + Hits 11496 11497 +1 Misses 641 641 Partials 322 322 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

effigies commented 4 months ago

I would guess that the 2x2 volumes are echo times x phase/magnitude.

I never use nicom, so I don't understand how people are using this. My understanding was that heudiconv wrapped dcm2niix, so what are you actually using nicom for?

yarikoptic commented 4 months ago

not sure if I would have time any time soon -- let's may be just merge as is for now.

we use nibabel.nicom.dicomwrappers in heudiconv to group dicoms based on their metadata, and extracting some metadata to give to heuristics to decide what to name them, but may be worth reapproaching this...