File tree Expand file tree Collapse file tree 2 files changed +2
-9
lines changed Expand file tree Collapse file tree 2 files changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -336,18 +336,13 @@ def __init__(self, img):
336336 self .img = img
337337
338338 def __getitem__ (self , slicer ):
339- klass = self .img .__class__
340- if not klass .makeable :
341- raise NotImplementedError (
342- "Cannot slice un-makeable image types" )
343-
344339 try :
345340 slicer = self .img ._check_slicing (self ._arr_to_slice (slicer ))
346341 except ValueError as err :
347342 raise IndexError (* err .args )
348343 dataobj = self .img .dataobj [slicer ]
349344 affine = self .img ._slice_affine (slicer )
350- return klass (dataobj .copy (), affine , self .img .header )
345+ return self . img . __class__ (dataobj .copy (), affine , self .img .header )
351346
352347 def _arr_to_slice (self , slicer ):
353348 ''' Convert single item sequence indices to slices '''
Original file line number Diff line number Diff line change @@ -426,9 +426,7 @@ def test_slicer(self):
426426 t_axis = 3 if img ._spatial_dims .start == 0 else 0
427427
428428 assert_true (hasattr (img .slicer , '__getitem__' ))
429- if not img_klass .makeable :
430- assert_raises (NotImplementedError , img .slicer [:])
431- continue
429+
432430 # Note spatial zooms are always first 3, even when
433431 spatial_zooms = img .header .get_zooms ()[:3 ]
434432
You can’t perform that action at this time.
0 commit comments