Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn on affine/header mismatch at write time #669

Open
effigies opened this issue Oct 3, 2018 · 1 comment
Open

Warn on affine/header mismatch at write time #669

effigies opened this issue Oct 3, 2018 · 1 comment

Comments

@effigies
Copy link
Member

effigies commented Oct 3, 2018

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

@effigies
Copy link
Member Author

effigies commented Oct 3, 2018

Relatedly: The documentation for SpatialImage should be updated to make clear that image.affine is authoritative and may clobber some header fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant