Closed
Description
Hi Nibabel community,
Great job on getting some type checking into this package! I wanted to point out two scenarios that I use frequently that have run me into type checking issues based on 5.1.0.
nb.load
shows a return type ofFileBasedImage
. This is all well and good, but unfortunatelyFileBasedImage
does not defineget_fdata()
. A common code example that I use (and see around) is:
obj = nb.load(filepath)
data = obj.get_fdata()
nb.Nifti1Image
doesn't want to takeNone
for the affine. I previously saw this code used frequently:
nb.Nifti1Image(data_array, None, header)
Just bringing these to your attention. I'm also flexible to change up my code, if better patterns are recommended.
Metadata
Metadata
Assignees
Labels
No labels