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 a35e2ac commit 7569219Copy full SHA for 7569219
nibabel/nicom/dicomwrappers.py
@@ -565,8 +565,11 @@ 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]}) of shape {shape} does not '
572
+ f'match NumberOfFrames {n_frames}.')
573
return tuple(shape)
574
575
@one_time
0 commit comments