[#7169] NIFTI qform and sform handled improperly

Please log in

State: more information
Open
Date:
2013-11-13 16:48
Priority: more information
5
Submitted By:
Torsten Rohlfing (torstenrohlfing)
Assigned To: more information
Torsten Rohlfing (torsten_at_home)
Hardware: 
All
Product: 
CMTK-core
Operating System: 
All
Component: 
Libs
Version: 
svn/trunk
Severity: 
major
Resolution: 
Fixed
Summary: more information
NIFTI qform and sform handled improperly

Detailed description

When reading a NIFTI, the qform transformation should be used for the image-to-physical coordinate mapping. As such, it should also be written to the qform fields in the header upon writing.

The sform transformation is independent (e.g., as a imnage-to-standard space mapping) and needs to be kept as a transformation in its own right.

Currently, sform is ignored when reading, and moved to sform when writing.

As a first step, what comes in as a qform should go out as a qform. Then, in a second step, we should treat sform properly. This will require adding a second mapping matrix to CMTK's UniformVolume class.

Response

Message

Date: 2013-12-02 16:22
Sender: Torsten Rohlfing

This is fixed in svn/trunk r5072. Will be in the CMTK 3.0.0 release.

Note the following:

- When a NIFTI file is read that contains a qform but no sform and the image later written to a new NIFTI file, then the new file will have a qform but no sform.

- When a NIFTI file is read that contains an sform but no qform and
the image later written to a new NIFTI file, then the new file will have
an sform but no qform.

- When a NIFTI file is read that contains both a qform and an sform and
the image later written to a new NIFTI file, then the new file will have
a qform and an sform.

- When qform_code == NIFTI_XFORM_SCANNER_ANAT, then qform defines the mapping of the image to physical space. When qform_code is NOT NIFTI_XFORM_SCANNER_ANAT and sform_code == NIFTI_XFORM_SCANNER_ANAT, then sform is used instead. If both qform and sform exist, but NEITHER code is NIFTI_XFORM_SCANNER_ANAT, then qform is used, regardless of qform_code

- When the image is downsampled, split, or merged, the qform and sform transformation are both changed accordingly (if they exist).

Attached Files:

Name Download
No Files Currently Attached

Changes:

Field Old Value Date By
ResolutionAccepted As Bug2013-12-02 16:22torstenrohlfing
New Message2013-12-02 16:22torstenrohlfing