Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Feb 28, 2024

Conversation

yarikoptic
Copy link
Member

To make #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?

Copy link

codecov bot commented Feb 27, 2024

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.

❗ 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 ⚠️
Additional details and impacted files
@@           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           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@effigies
Copy link
Member

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?

Copy link
Member

@effigies effigies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems fine as an error text improvement. Do you want to do more here to handle the erroring case?

@yarikoptic
Copy link
Member Author

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...

@effigies effigies changed the title Make "Calculated shape" more "correct" (do show shape) and informative ENH: Improve text for dicomwrapper errors in shape calculation Feb 28, 2024
@effigies effigies merged commit acd0c77 into nipy:master Feb 28, 2024
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants