We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f81f5a7 commit df638fdCopy full SHA for df638fd
nibabel/nicom/dicomwrappers.py
@@ -756,13 +756,13 @@ def image_shape(self):
756
return (rows, cols)
757
# Initialize array of frame indices
758
try:
759
- frame_indices = np.array(
760
- [frame.FrameContentSequence[0].DimensionIndexValues for frame in self.frames]
+ frame_indices = np.stack(
+ np.atleast_1d(
761
+ *(frame.FrameContentSequence[0].DimensionIndexValues for frame in self.frames)
762
+ )
763
)
764
except AttributeError:
765
raise WrapperError("Can't find frame 'DimensionIndexValues'")
- if len(frame_indices.shape) == 1:
- frame_indices = frame_indices.reshape(frame_indices.shape + (1,))
766
# Determine the shape and which indices to use
767
shape = [rows, cols]
768
curr_parts = n_frames
0 commit comments