Skip to content

Commit 2386f4f

Browse files
committed
REVERT fileslice modifications
1 parent 54b02d5 commit 2386f4f

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

nibabel/fileslice.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ def is_fancy(sliceobj):
5454
# slice or Ellipsis or None OK for basic
5555
if isinstance(slicer, slice) or slicer in (None, Ellipsis):
5656
continue
57-
# Allow single items in a dimension to be sliced
58-
ary = np.asanyarray(slicer)
59-
if ary.shape == (1,):
60-
slicer = ary[0]
6157
try:
6258
int(slicer)
6359
except TypeError:
@@ -117,16 +113,9 @@ def canonical_slicers(sliceobj, shape, check_inds=True):
117113
can_slicers.extend((slice(None),) * n_ellided)
118114
n_real += n_ellided
119115
continue
120-
# int / [int] / slice indexing cases
116+
# int / slice indexing cases
121117
dim_len = shape[n_real]
122118
n_real += 1
123-
124-
# Treat [x] as "x:x+1"
125-
ary = np.asanyarray(slicer)
126-
if ary.shape == (1,):
127-
can_slicers.append(slice(int(ary[0]), int(ary[0]) + 1))
128-
continue
129-
130119
try: # test for integer indexing
131120
slicer = int(slicer)
132121
except TypeError: # should be slice object

0 commit comments

Comments
 (0)