com.xinapse.multisliceimage.Analyze
Class NIFTIHeader

java.lang.Object
  extended by com.xinapse.multisliceimage.Analyze.ANZHeader
      extended by com.xinapse.multisliceimage.Analyze.NIFTIHeader
All Implemented Interfaces:
java.lang.Cloneable

public class NIFTIHeader
extends ANZHeader

This class represents a multi-dimensional NIFTI image header file. The header file may either:


Field Summary
static boolean DEFAULT_FSL_COMPATIBLE_NIFTI
          The default setting of whether NIFTI-1 images that have qform and sform orientation both unset should be read as having an increasing a patient left coordinate value with stored pixel data column number, and whether NIFTI-1 images should be prevented from being written without orientation information.
static boolean DEFAULT_SAVE_FSL_ORIENT
          The default setting of whether NIFTI-1 images should be saved with an orientation that is compatible with FSL, where possible.
static boolean DEFAULT_SAVE_SPM_ORIENT
          The default setting of whether NIFTI-1 images should be saved with an orientation that is compatible with SPM, where possible.
static java.lang.String FSL_COMPATIBLE_NIFTI_PROPERTY_KEY
          The property value key for setting whether NIFTI-1 images that have qform and sform orientation both unset should be read as having an increasing a patient left coordinate value with stored pixel data column number, and whether NIFTI-1 images should be prevented from being written without orientation information.
 NIFTIXForm qForm
          The NIFTI qform parameter.
 float qOffsetX
          The NIFTI qoffset_x parameter.
 float qOffsetY
          The NIFTI qoffset_y parameter.
 float qOffsetZ
          The NIFTI qoffset_z parameter.
 float quaternB
          The NIFTI quatern_b parameter.
 float quaternC
          The NIFTI quatern_c parameter.
 float quaternD
          The NIFTI quatern_d parameter.
static java.lang.String SAVE_FSL_ORIENT_PROPERTY_KEY
          The property value key for setting whether NIFTI-1 images should be saved with an orientation that is compatible with FSL, where possible.
static java.lang.String SAVE_SPM_ORIENT_PROPERTY_KEY
          The property value key for setting whether NIFTI-1 images should be saved with an orientation that is compatible with SPM, where possible.
 NIFTIXForm sForm
          The NIFTI sform parameter.
 float[] sRowX
          The NIFTI srow_x parameter.
 float[] sRowY
          The NIFTI srow_y parameter.
 float[] sRowZ
          The NIFTI srow_z parameter.
 
Fields inherited from class com.xinapse.multisliceimage.Analyze.ANZHeader
COMPRESSED_EXTENSION, COMPRESSED_UPPERCASE_EXTENSION, EXTENSION, MAXDIM, UPPERCASE_EXTENSION, voxOffset
 
Method Summary
 java.lang.Object clone()
          Returns an exact copy of this NIFTI header.
protected  void finalize()
          Called by the garbage collector on this NIFTIHeader when garbage collection determines that there are no more references to the header.
static boolean getPreferredFSLCompatibleNIFTI()
          Returns the user's preference about whether NIFTI-1 images with both qform and sform orientations unset should be read as having the patient left coordinate increasing with stored pixel data column number, and whether NIFTI-1 images should be prevented from being written without orientation information.
static boolean getPreferredSaveFSLOrient()
          Returns the user's preference about whether NIFTI-1 images should be saved with an orientation that is compatible with FSL, where possible.
static boolean getPreferredSaveSPMOrient()
          Returns the user's preference about whether NIFTI-1 images should be saved with an orientation that is compatible with SPM, where possible.
static void savePreferredFSLCompatibleNIFTI(boolean b)
          Saves the user's preference about whether NIFTI-1 images should be read as having the patient left coordinate increasing with stored pixel data column number.
static void savePreferredSaveFSLOrient(boolean b)
          Saves the user's preference about whether NIFTI-1 images should be saved with an orientation that is compatible with FSL, where possible.
static void savePreferredSaveSPMOrient(boolean b)
          Saves the user's preference about whether NIFTI-1 images should be saved with an orientation that is compatible with SPM, where possible.
 void setImageOrientationPositionPatient(javax.vecmath.Vector3f[] cosines, javax.vecmath.Point3f position)
           
 java.lang.String toString()
          Returns a String representation of this NIFTIHeader.
 java.lang.String toString(boolean html)
          Returns the string representation of this NIFTI-1 compliant image header, with optional presentation in HTML format.
 
Methods inherited from class com.xinapse.multisliceimage.Analyze.ANZHeader
getDBName, getDescription, getMinMax, setDBName, setDims, setMinMax, setNCols, setNFrames, setNRows, setNSlices
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SAVE_FSL_ORIENT_PROPERTY_KEY

public static final java.lang.String SAVE_FSL_ORIENT_PROPERTY_KEY
The property value key for setting whether NIFTI-1 images should be saved with an orientation that is compatible with FSL, where possible.

See Also:
Constant Field Values

SAVE_SPM_ORIENT_PROPERTY_KEY

public static final java.lang.String SAVE_SPM_ORIENT_PROPERTY_KEY
The property value key for setting whether NIFTI-1 images should be saved with an orientation that is compatible with SPM, where possible.

See Also:
Constant Field Values

FSL_COMPATIBLE_NIFTI_PROPERTY_KEY

public static final java.lang.String FSL_COMPATIBLE_NIFTI_PROPERTY_KEY
The property value key for setting whether NIFTI-1 images that have qform and sform orientation both unset should be read as having an increasing a patient left coordinate value with stored pixel data column number, and whether NIFTI-1 images should be prevented from being written without orientation information.

See Also:
Constant Field Values

DEFAULT_SAVE_FSL_ORIENT

public static final boolean DEFAULT_SAVE_FSL_ORIENT
The default setting of whether NIFTI-1 images should be saved with an orientation that is compatible with FSL, where possible.

See Also:
Constant Field Values

DEFAULT_SAVE_SPM_ORIENT

public static final boolean DEFAULT_SAVE_SPM_ORIENT
The default setting of whether NIFTI-1 images should be saved with an orientation that is compatible with SPM, where possible.

See Also:
Constant Field Values

DEFAULT_FSL_COMPATIBLE_NIFTI

public static final boolean DEFAULT_FSL_COMPATIBLE_NIFTI
The default setting of whether NIFTI-1 images that have qform and sform orientation both unset should be read as having an increasing a patient left coordinate value with stored pixel data column number, and whether NIFTI-1 images should be prevented from being written without orientation information.

See Also:
Constant Field Values

qForm

public NIFTIXForm qForm
The NIFTI qform parameter. It is not recommended to manipulate this directly. Use the methods to set the image position and orientation in NIFTImage.


sForm

public NIFTIXForm sForm
The NIFTI sform parameter. It is not recommended to manipulate this directly. Use the methods to set the image position and orientation in NIFTImage.


quaternB

public float quaternB
The NIFTI quatern_b parameter. It is not recommended to manipulate this directly. Use the methods to set the image position and orientation in NIFTImage.


quaternC

public float quaternC
The NIFTI quatern_c parameter. It is not recommended to manipulate this directly. Use the methods to set the image position and orientation in NIFTImage.


quaternD

public float quaternD
The NIFTI quatern_d parameter. It is not recommended to manipulate this directly. Use the methods to set the image position and orientation in NIFTImage.


qOffsetX

public float qOffsetX
The NIFTI qoffset_x parameter. It is not recommended to manipulate this directly. Use the methods to set the image position and orientation in NIFTImage.


qOffsetY

public float qOffsetY
The NIFTI qoffset_y parameter. It is not recommended to manipulate this directly. Use the methods to set the image position and orientation in NIFTImage.


qOffsetZ

public float qOffsetZ
The NIFTI qoffset_z parameter. It is not recommended to manipulate this directly. Use the methods to set the image position and orientation in NIFTImage.


sRowX

public float[] sRowX
The NIFTI srow_x parameter. This is usually set using the method setSFormAffineTransform of the NIFTImage.


sRowY

public float[] sRowY
The NIFTI srow_y parameter. This is usually set using the method setSFormAffineTransform of the NIFTImage.


sRowZ

public float[] sRowZ
The NIFTI srow_z parameter. This is usually set using the method setSFormAffineTransform of the NIFTImage.

Method Detail

getPreferredSaveFSLOrient

public static boolean getPreferredSaveFSLOrient()
Returns the user's preference about whether NIFTI-1 images should be saved with an orientation that is compatible with FSL, where possible. FSL is not able to correctly display images with an orientation that is not in the expected orientation. If interoperating with FSL, it may be necessary to save images in an FSL-friendly orientation. If not set in the user's preferences, then the default is to save NIFTI-1 images with a radiological orientation.

If the system property "analyze.fslorient" exists, and the property value is either "true" or "false", then the user's preference is overridden by the property value.

Returns:
whether NIFTI-1 images should be saved with an orientation that is compatible with FSL, where possible.

savePreferredSaveFSLOrient

public static void savePreferredSaveFSLOrient(boolean b)
Saves the user's preference about whether NIFTI-1 images should be saved with an orientation that is compatible with FSL, where possible.

Parameters:
b - true if NIFTI-1 images should have an orientation that is compatible with FSL, where possible; false otherwise.

getPreferredSaveSPMOrient

public static boolean getPreferredSaveSPMOrient()
Returns the user's preference about whether NIFTI-1 images should be saved with an orientation that is compatible with SPM, where possible. SPM is not able to correctly display images with an orientation that is not in the expected orientation. If interoperating with SPM, it may be necessary to save images in an SPM-friendly orientation. If not set in the user's preferences, then the default is to save NIFTI-1 images with a radiological orientation.

If the system property "analyze.spmorient" exists, and the property value is either "true" or "false", then the user's preference is overridden by the property value.

Returns:
whether NIFTI-1 images should be saved with an orientation that is compatible with SPM, where possible.

savePreferredSaveSPMOrient

public static void savePreferredSaveSPMOrient(boolean b)
Saves the user's preference about whether NIFTI-1 images should be saved with an orientation that is compatible with SPM, where possible.

Parameters:
b - true if NIFTI-1 images should have an orientation that is compatible with SPM, where possible; false otherwise.

getPreferredFSLCompatibleNIFTI

public static boolean getPreferredFSLCompatibleNIFTI()
Returns the user's preference about whether NIFTI-1 images with both qform and sform orientations unset should be read as having the patient left coordinate increasing with stored pixel data column number, and whether NIFTI-1 images should be prevented from being written without orientation information. This may be necessary if interoperating with FSL.

If not set in the user's preferences, then the default is to interpret NIFTI-1 images as axial with an increasing patient right coordinate with increasing column number.

If the system property "nifti.fslcompatible" exists, and the property value is either "true" or "false", then the user's preference is overridden by the property value.

Returns:
whether NIFTI-1 images with both qform and sformunset should be interpreted as having an increasing left coordinate with stored pixel data column number.

savePreferredFSLCompatibleNIFTI

public static void savePreferredFSLCompatibleNIFTI(boolean b)
Saves the user's preference about whether NIFTI-1 images should be read as having the patient left coordinate increasing with stored pixel data column number.

Parameters:
b - true if NIFTI-1 images should be read as having the patient left coordinate increasing with stored pixel data column number; false otherwise.

finalize

protected void finalize()
                 throws java.lang.Throwable
Called by the garbage collector on this NIFTIHeader when garbage collection determines that there are no more references to the header.

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable - - the Exception raised by this method.

setImageOrientationPositionPatient

public void setImageOrientationPositionPatient(javax.vecmath.Vector3f[] cosines,
                                               javax.vecmath.Point3f position)
                                        throws MultiSliceImageException
Throws:
MultiSliceImageException

toString

public java.lang.String toString()
Returns a String representation of this NIFTIHeader.

Overrides:
toString in class ANZHeader
Returns:
a String describing this NIFTIHeader.

toString

public java.lang.String toString(boolean html)
Returns the string representation of this NIFTI-1 compliant image header, with optional presentation in HTML format.

Overrides:
toString in class ANZHeader
Parameters:
html - if true, then the string will contain HTML tags.
Returns:
a String describing the header, optionally in HTML format.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Returns an exact copy of this NIFTI header.

Overrides:
clone in class ANZHeader
Returns:
an exact copy of this NIFTIHeader instance.
Throws:
java.lang.CloneNotSupportedException


Copyright 2006-2008 Xinapse Systems Limited. All Rights Reserved.