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

Time-slicing spatial images #489

Closed
effigies opened this issue Sep 29, 2016 · 1 comment
Closed

Time-slicing spatial images #489

effigies opened this issue Sep 29, 2016 · 1 comment

Comments

@effigies
Copy link
Member

RE: #271 and #404

So, I recognize the issues involved with spatial slicing of SpatialImages, but a pretty handy thing to be able to do would be: img[...,slicer].orthoview()

Almost always I'm loading the file on the spot, so really it's: nib.load(fname)[...,slicer].orthoview()

Being a one-liner from filename to display is the real beauty of this, but the options are:

x = nib.load(fname)
Nifti1Image(x.dataobj[...,slicer], x.affine, x.header).orthoview()
# or
nib.viewers.OrthoSlicer3D(x.dataobj[...,slicer], x.affine)

Would it be acceptable to modify SpatialImage.__getitem__ to accept a time slice and return a SpatialImage, but reject spatial slices?

@effigies
Copy link
Member Author

I suppose an acceptable alternative that doesn't involve mucking with __getitem__ would be:

nib.load(fname).orthoview(timeslice)

The only annoyance I see there is the need to manually define the slice, instead of getting the start:stop:step syntax.

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

No branches or pull requests

1 participant