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

FIX: Use a more reliable test of NIfTIness #784

Merged
merged 4 commits into from
Mar 2, 2023

Conversation

effigies
Copy link
Member

@effigies effigies commented Mar 1, 2023

Closes #778.

@codecov-commenter
Copy link

Codecov Report

Patch coverage: 100.00% and project coverage change: -12.72 ⚠️

Comparison is base (1df4fd3) 63.36% compared to head (51d45c1) 50.65%.

❗ Current head 51d45c1 differs from pull request most recent head d98c981. Consider uploading reports for the commit d98c981 to get more accurate results

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #784       +/-   ##
===========================================
- Coverage   63.36%   50.65%   -12.72%     
===========================================
  Files          49       49               
  Lines        5959     5950        -9     
  Branches     1169     1143       -26     
===========================================
- Hits         3776     3014      -762     
- Misses       2001     2822      +821     
+ Partials      182      114       -68     
Flag Coverage Δ
reportlettests ∅ <ø> (∅)
unittests 50.65% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
niworkflows/interfaces/bids.py 96.54% <100.00%> (+0.03%) ⬆️
niworkflows/interfaces/confounds.py 22.92% <0.00%> (-70.36%) ⬇️
niworkflows/viz/utils.py 7.86% <0.00%> (-69.95%) ⬇️
niworkflows/viz/plots.py 21.05% <0.00%> (-48.43%) ⬇️
niworkflows/interfaces/reportlets/masks.py 46.15% <0.00%> (-24.62%) ⬇️
niworkflows/interfaces/reportlets/base.py 43.75% <0.00%> (-23.44%) ⬇️
niworkflows/interfaces/norm.py 25.86% <0.00%> (-17.32%) ⬇️
niworkflows/interfaces/plotting.py 71.83% <0.00%> (-8.46%) ⬇️
niworkflows/utils/timeseries.py 83.33% <0.00%> (-5.56%) ⬇️
niworkflows/interfaces/reportlets/registration.py 52.15% <0.00%> (-4.31%) ⬇️
... and 5 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@effigies effigies force-pushed the fix/better-nifti-check branch from d98c981 to 4e11ead Compare March 1, 2023 14:53
@effigies effigies changed the title FIX: Use a more reliably test of NIfTIness FIX: Use a more reliable test of NIfTIness Mar 1, 2023
@effigies effigies requested review from tsalo and mgxd March 1, 2023 15:20
@effigies
Copy link
Member Author

effigies commented Mar 1, 2023

@mgxd This is needed for nipreps/smriprep#325. Would appreciate a review when you get a minute.

@tsalo This addresses at least somewhat your issue #778. Please let me know if you have suggestions.

Copy link
Contributor

@tsalo tsalo left a comment

Choose a reason for hiding this comment

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

The change makes sense to me. Thanks for addressing this!

Is it worth including Nifti2Images too? I know they're rare, and I don't know if the header check is meant to work with Nifti2Images.

@effigies
Copy link
Member Author

effigies commented Mar 1, 2023

Nifti2Images will be caught by this check:

In [1]: import nibabel as nb

In [2]: nb.Nifti2Image.mro()
Out[2]: 
[nibabel.nifti2.Nifti2Image,
 nibabel.nifti1.Nifti1Image,
 nibabel.nifti1.Nifti1Pair,
 nibabel.analyze.AnalyzeImage,
 nibabel.spatialimages.SpatialImage,
 nibabel.dataobj_images.DataobjImage,
 nibabel.filebasedimages.SerializableImage,
 nibabel.filebasedimages.FileBasedImage,
 object]

@tsalo
Copy link
Contributor

tsalo commented Mar 1, 2023

Oh, awesome!

@effigies effigies merged commit f23f07d into nipreps:master Mar 2, 2023
@effigies effigies deleted the fix/better-nifti-check branch March 2, 2023 00:32
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.

DerivativesDataSink datatype coercion does not skip non-dtseries CIFTIs
3 participants