-
Notifications
You must be signed in to change notification settings - Fork 128
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
remove bval bvecs files generated for SBRef on XA60/CMRR/dcm2niix #819
base: master
Are you sure you want to change the base?
Conversation
…raction of XA/dcm2niix)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #819 +/- ##
==========================================
+ Coverage 82.48% 82.55% +0.06%
==========================================
Files 42 42
Lines 4323 4340 +17
==========================================
+ Hits 3566 3583 +17
Misses 757 757 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
for what types of files it started to being produced? might be better to get to the bottom of it may be? |
ah yes sorry 'SBRef' from CMRR sequence |
@bpinsard was there dcm2niix version change? |
@yarikoptic if you want feedback create an issue on the dcm2niix github page and send an example image that demonstrates the behavior to my institutional email. One challenge is that some DWI b=0 sequences are identical to a spin-echo phase-encoding polarity (PEpolar) scan use to remove gradient distortions from a gradient echo EPI scan. Therefore, for some sequences one often needs to know the intention, which is where dcm2niix wrappers like heudiconv play a role. |
It is just the SBRef from CMRR causing that issue. I am not sure which tag is used in dcm2niix for XA data to decide when to not export bvecs/bvals, but the mrprotocol shows the 3 bvalues configured for the sequence, and is exactly the same as for the multiband series.
The ImageType show DIFFUSION for the multiband series and not for the SBRef. |
ok, let's get back to
According to https://bids-specification.readthedocs.io/en/stable/modality-specific-files/magnetic-resonance-imaging-data.html#case-4-multiple-phase-encoded-directions-pepolar and @neurolabusc description above on when produced -- they are also allowed for |
The bval / bvecs should only be kept for _dwi suffixes, that can only happen in The fmap case was already covered and is still covered with that patch, as it will continue to remove bvecs/bvals for |
@@ -896,7 +896,7 @@ def save_converted_files( | |||
bvals, bvecs = res.outputs.bvals, res.outputs.bvecs | |||
bvals = list(bvals) if isinstance(bvals, TraitListObject) else bvals | |||
bvecs = list(bvecs) if isinstance(bvecs, TraitListObject) else bvecs | |||
if prefix_dirname.endswith("dwi"): | |||
if prefix.endswith("dwi"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for being anal -- just trying to get a better grasp.
With this change I think the else:
warning on
lgr.warning(
DW_IMAGE_IN_FMAP_FOLDER_WARNING.format(folder=prefix_dirname)
)
might be confusing false positive since we might be finding _dwi
somewhere else than dwi/
folder (e.g. due to a bug in heuristic or alike)
Also, how/where do we treat fmap/..._epi
here -- from the code it seems we could also run into the warnings, can't we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you're right that the logic has drifted, so we can change that message to
DW_IMAGE_WRONG_SUFFIX_WARNING = (
"Diffusion-weighted image saved as non dwi ({prefix})"
)
and
lgr.warning(
DW_IMAGE_WRONG_SUFFIX_WARNING.format(prefix=prefix)
)
Weirdly XA60 data that I got recently started to produce bvals/bvecs files for SBRef from dcm2niix.
I don't know where the changes originates, so better filter more aggressively here, as the only files allowed to have such sidefiles are
_dwi
suffixed ones.