Class NIFTIHeader
java.lang.Object
com.xinapse.multisliceimage.analyze.ANZHeader
com.xinapse.multisliceimage.analyze.NIFTIHeader
- Direct Known Subclasses:
NIFTI2Header
This class represents a multi-dimensional NIFTI-1 image header file. The header file
may either:
- contain all the dimensional and descriptive information about a NIFTI-1 image, but none of the pixel data. This is the conventional Analyze 7.5 .img/.hdr file format.
- contain both the dimensional and descriptive information about a NIFTI-1 image, and also the pixel data. This is the new NIFTI-1 .nii file format.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanThe default setting of whether NIFTI-1 images that haveqformandsformorientation 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 final booleanThe default setting of whether NIFTI-1 images should be saved with an orientation that is compatible with FSL, where possible.static final booleanThe default setting of whether NIFTI-1 images should be saved with an orientation that is compatible with SPM, where possible.Fields inherited from class ANZHeader
COMPRESSED_EXTENSION, COMPRESSED_UPPERCASE_EXTENSION, EXTENSION, MAXDIM, UPPERCASE_EXTENSION -
Constructor Summary
ConstructorsConstructorDescriptionNIFTIHeader(NIFTIHeader hdr) Returns a new NIFTIHeader, copying from an existing one. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanReturns whether NIFTI images with bothqformandsformorientations 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 booleanReturns the user's preference about whether NIFTI-1 images with bothqformandsformorientations 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 booleanReturns the user's preference about whether NIFTI-1 images should be saved with an orientation that is compatible with FSL, where possible.static booleanReturns the user's preference about whether NIFTI-1 images should be saved with an orientation that is compatible with SPM, where possible.static booleanReturns whether NIFTI images should be saved with an orientation that is compatible with FSL, where possible.static booleanReturns whether NIFTI images should be saved with an orientation that is compatible with SPM, where possible.static voidsavePreferredFSLCompatibleNIFTI(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 voidsavePreferredSaveFSLOrient(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 voidsavePreferredSaveSPMOrient(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.voidsetImageOrientationPositionPatient(org.jogamp.vecmath.Vector3f[] orientation, org.jogamp.vecmath.Point3f position, boolean force) toString()Returns aStringrepresentation of thisNIFTIHeader.toString(boolean html) Returns the string representation of this NIFTI-1 compliant image header, with optional presentation in HTML format.Methods inherited from class ANZHeader
getDBName, getDescription, getMinMax, setDBName, setDims, setDims, setMinMax, setNCols, setNFrames, setNRows, setNSlices
-
Field Details
-
DEFAULT_SAVE_FSL_ORIENT
public static final boolean DEFAULT_SAVE_FSL_ORIENTThe default setting of whether NIFTI-1 images should be saved with an orientation that is compatible with FSL, where possible.- See Also:
-
DEFAULT_SAVE_SPM_ORIENT
public static final boolean DEFAULT_SAVE_SPM_ORIENTThe default setting of whether NIFTI-1 images should be saved with an orientation that is compatible with SPM, where possible.- See Also:
-
DEFAULT_FSL_COMPATIBLE_NIFTI
public static final boolean DEFAULT_FSL_COMPATIBLE_NIFTIThe default setting of whether NIFTI-1 images that haveqformandsformorientation 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:
-
-
Constructor Details
-
NIFTIHeader
Returns a new NIFTIHeader, copying from an existing one.- Parameters:
hdr- the NIFTI-1 header to copy from.
-
-
Method Details
-
getSaveFSLOrient
public static boolean getSaveFSLOrient()Returns whether NIFTI images should be saved with an orientation that is compatible with FSL, where possible. The value is obtained either from the System Property"nifti.fslorient"(preferentially) or the user's preference.- Returns:
- whether NIFTI-1 images should be saved with an orientation that is compatible with FSL, where possible.
-
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.- Returns:
- thr user's preference for 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-trueif NIFTI-1 images should have an orientation that is compatible with FSL, where possible;falseotherwise.
-
getSaveSPMOrient
public static boolean getSaveSPMOrient()Returns whether NIFTI images should be saved with an orientation that is compatible with SPM, where possible. The value is obtained either from the System Property"nifti.spmorient"(preferentially) or the user's preference.- Returns:
- whether NIFTI-1 images should be saved with an orientation that is compatible with SPM, where possible.
-
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.- 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-trueif NIFTI-1 images should have an orientation that is compatible with SPM, where possible;falseotherwise.
-
getFSLCompatibleNIFTI
public static boolean getFSLCompatibleNIFTI()Returns whether NIFTI images with bothqformandsformorientations 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.- Returns:
- whether NIFTI-1 images should be saved with an orientation that is compatible with SPM, where possible.
-
getPreferredFSLCompatibleNIFTI
public static boolean getPreferredFSLCompatibleNIFTI()Returns the user's preference about whether NIFTI-1 images with bothqformandsformorientations 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.
- Returns:
- whether NIFTI-1 images with both
qformandsformunset 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-trueif NIFTI-1 images should be read as having the patient left coordinate increasing with stored pixel data column number;falseotherwise.
-
setImageOrientationPositionPatient
public void setImageOrientationPositionPatient(org.jogamp.vecmath.Vector3f[] orientation, org.jogamp.vecmath.Point3f position, boolean force) -
toString
Returns aStringrepresentation of thisNIFTIHeader.- Overrides:
toStringin classANZHeader- Returns:
- a
Stringdescribing thisNIFTIHeader.
-
toString
Returns the string representation of this NIFTI-1 compliant image header, with optional presentation in HTML format.
-