Skip to content

Commit b0ca59b

Browse files
committed
ENH: Slightly simplify frame_indices array construction
1 parent d5995db commit b0ca59b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

nibabel/nicom/dicomwrappers.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -756,13 +756,11 @@ def image_shape(self):
756756
return (rows, cols)
757757
# Initialize array of frame indices
758758
try:
759-
frame_indices = np.array(
759+
frame_indices = np.atleast_2d(
760760
[frame.FrameContentSequence[0].DimensionIndexValues for frame in self.frames]
761761
)
762762
except AttributeError:
763763
raise WrapperError("Can't find frame 'DimensionIndexValues'")
764-
if len(frame_indices.shape) == 1:
765-
frame_indices = frame_indices.reshape(frame_indices.shape + (1,))
766764
# Determine the shape and which indices to use
767765
shape = [rows, cols]
768766
curr_parts = n_frames

0 commit comments

Comments
 (0)