Skip to content

Commit d0a484b

Browse files
Michiel CottaarMichiel Cottaar
authored andcommitted
Set undefined dimensions to size None
1 parent 875f93c commit d0a484b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

nibabel/cifti2/cifti2.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1229,11 +1229,13 @@ def get_axis(self, index):
12291229
def get_data_shape(self):
12301230
"""
12311231
Returns data shape expected based on the CIFTI-2 header
1232+
1233+
Any dimensions omitted in the CIFIT-2 header will be given a default size of None.
12321234
"""
12331235
from . import cifti2_axes
12341236
if len(self.mapped_indices) == 0:
12351237
return ()
1236-
base_shape = [-1] * (max(self.mapped_indices) + 1)
1238+
base_shape = [None] * (max(self.mapped_indices) + 1)
12371239
for mim in self:
12381240
size = len(cifti2_axes.from_index_mapping(mim))
12391241
for idx in mim.applies_to_matrix_dimension:

0 commit comments

Comments
 (0)