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.
2 parents fa2acc7 + d063b95 commit acd0c77Copy full SHA for acd0c77
nibabel/nicom/dicomwrappers.py
@@ -565,8 +565,12 @@ def image_shape(self):
565
ns_unique = [len(np.unique(row)) for row in self._frame_indices.T]
566
shape = (rows, cols) + tuple(ns_unique)
567
n_vols = np.prod(shape[3:])
568
- if n_frames != n_vols * shape[2]:
569
- raise WrapperError('Calculated shape does not match number of frames.')
+ n_frames_calc = n_vols * shape[2]
+ if n_frames != n_frames_calc:
570
+ raise WrapperError(
571
+ f'Calculated # of frames ({n_frames_calc}={n_vols}*{shape[2]}) '
572
+ f'of shape {shape} does not match NumberOfFrames {n_frames}.'
573
+ )
574
return tuple(shape)
575
576
@one_time
0 commit comments