Skip to content

Commit 14c24ef

Browse files
moloneyeffigies
authored andcommitted
BF: Trim unneeded trailing indices from _frame_indices
1 parent 4063114 commit 14c24ef

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

nibabel/nicom/dicomwrappers.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -581,11 +581,10 @@ def image_shape(self):
581581
frames_per_part = 1
582582
del_indices = {}
583583
for row_idx, row in enumerate(frame_indices.T):
584-
if curr_parts == 1:
585-
break
586584
unique = np.unique(row)
587585
count = len(unique)
588-
if count == 1:
586+
if count == 1 or curr_parts == 1:
587+
del_indices[row_idx] = count
589588
continue
590589
# Replace slice indices with order determined from slice positions along normal
591590
if len(shape) == 2:

0 commit comments

Comments
 (0)