Skip to content

Time-slicing spatial images #489

Closed
Closed
@effigies

Description

@effigies

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions