Skip to content

Commit e55a15e

Browse files
committed
ENH: Allow time dimension
1 parent 6fda4d8 commit e55a15e

File tree

2 files changed

+228
-149
lines changed

2 files changed

+228
-149
lines changed

nibabel/spatialimages.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@
139139

140140
from .filebasedimages import FileBasedHeader, FileBasedImage
141141
from .filebasedimages import ImageFileError # flake8: noqa; for back-compat
142+
from .viewers import OrthoSlicer3D
142143
from .volumeutils import shape_zoom_affine
143144

144145

@@ -661,3 +662,21 @@ def __getitem__(self):
661662
raise TypeError("Cannot slice image objects; consider slicing image "
662663
"array data with `img.dataobj[slice]` or "
663664
"`img.get_data()[slice]`")
665+
666+
def plot(self, show=True):
667+
"""Plot the image using OrthoSlicer3D
668+
669+
Parameters
670+
----------
671+
show : bool
672+
If True, the viewer will be shown.
673+
674+
Returns
675+
-------
676+
viewer : instance of OrthoSlicer3D
677+
The viewer.
678+
"""
679+
out = OrthoSlicer3D(self.get_data())
680+
if show:
681+
out.show()
682+
return out

0 commit comments

Comments
 (0)