Skip to content

Commit

Permalink
ENH: Slightly simplify frame_indices array construction
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Jan 12, 2025
1 parent d5995db commit b0ca59b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions nibabel/nicom/dicomwrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,13 +756,11 @@ def image_shape(self):
return (rows, cols)
# Initialize array of frame indices
try:
frame_indices = np.array(
frame_indices = np.atleast_2d(
[frame.FrameContentSequence[0].DimensionIndexValues for frame in self.frames]
)
except AttributeError:
raise WrapperError("Can't find frame 'DimensionIndexValues'")
if len(frame_indices.shape) == 1:
frame_indices = frame_indices.reshape(frame_indices.shape + (1,))
# Determine the shape and which indices to use
shape = [rows, cols]
curr_parts = n_frames
Expand Down

0 comments on commit b0ca59b

Please sign in to comment.