Open
Description
My understanding of the SpatialImage
API is that image.affine
is authoritative, and that it is written into the header prior to writing to file. This can lead to surprises for users modifying header attributes that correspond to the affine. For example, zooms may be used to construct an affine (MGHImage/NIfTI with no valid sform) or be unrelated (see #619 for further discussion).
image.update_header()
is called at image construction and writing. I would suggest that we warn if it causes changes to the header at write time. (At construction time might occasionally be useful, but it will cause a lot of noise.)
Sub-issue identified in #619.
Related: #668