Skip to content

Warn on affine/header mismatch at write time #669

Open
@effigies

Description

@effigies

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions