Skip to content

Commit bffecea

Browse files
committed
RF - only set data shape if not already correct
This avoids shape warnings from the Freesurfer hack when loading images.
1 parent 68f489e commit bffecea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

nibabel/analyze.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ def update_header(self):
974974
# We need to update the header if the data shape has changed. It's a
975975
# bit difficult to change the data shape using the standard API, but
976976
# maybe it happened
977-
if not self._data is None:
977+
if not self._data is None and hdr.get_data_shape() != self._data.shape:
978978
hdr.set_data_shape(self._data.shape)
979979
# If the affine is not None, and it is different from the main affine in
980980
# the header, update the heaader

0 commit comments

Comments
 (0)