Class Analyze75Header
- All Implemented Interfaces:
Cloneable
Analyze images are usually 4-dimensional, with the dimensions being the number of rows, number of columns, number of slices, and number of frames (for images where things vary through time). It seems conventional to make all images 4-dimensional, but set the size of any unused dimension to 1.
Header files end in the file extension ".hdr" or ".HDR".
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The property value key for setting whether newly-created Analyze 7.5 images should have a non-flipped orientation.static final boolean
The default setting of whether newly-created Analyze 7.5 images should have a non-flipped orientation.static final boolean
The default setting of whether not to flip vertically an image with a flipped Analyze orientation.static final boolean
The default setting of whether to flip vertically an image with a non-flipped Analyze orientation.static final boolean
Whether to warn the user about negative pixel sizes by default.static final String
The property value key for setting whether not to flip flipped Analyze 7.5 images.static final String
The property value key for setting whether to flip non-flipped Analyze 7.5 images.static final byte
The constant used to indicate an axial orientation.static final byte
The constant used to indicate a flipped axial orientation.static final byte
The constant used to indicate a coronal orientation.static final byte
The constant used to indicate a flipped coronal orientation.static final byte
The constant used to indicate a sagittal orientation.static final byte
The constant used to indicate a flipped sagittal orientation.static final String
The property value key for setting whether the user should be warned about negative pixel heights.static final String
The property value key for setting whether the user should be warned about negative pixel widths.Fields inherited from class com.xinapse.multisliceimage.Analyze.ANZHeader
COMPRESSED_EXTENSION, COMPRESSED_UPPERCASE_EXTENSION, EXTENSION, MAXDIM, UPPERCASE_EXTENSION, voxOffset
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns an exact copy of this Analyze header.Returns the patient ID for this Analyze image header.static boolean
Returns the user's preference about whether newly-created Analyze 7.5 images should have a non-flipped orientation.static boolean
Returns the user's preference about whether an Analyze 7.5 image with a flipped orientation should be treated as if it has a non-flipped orientation.static boolean
Returns the user's preference about whether an Analyze 7.5 image with a non-flipped orientation should be treated as if it has a flipped orientation.static boolean
Returns the user's preference about whether the user should be warned about negative pixel height in Analyze 7.5 images.static boolean
Returns the user's preference about whether the user should be warned about negative pixel width in Analyze 7.5 images.static void
savePreferredCreateNonFlipped
(boolean b) Saves the user's preference about whether newly-created Analyze 7.5 images should have a non-flipped orientation.static void
savePreferredDoNotFlipFlipped
(boolean b) Saves the user's preference about whether an Analyze 7.5 image with a flipped orientation should be treated as if it has a non-flipped orientation.static void
savePreferredFlipNonFlipped
(boolean b) Saves the user's preference about whether an Analyze 7.5 image with a non-flipped orientation should be treated as if it has a flipped orientation.static void
savePreferredWarnNegativePixelHeight
(boolean b) Saves the user's preference about whether the user should be warned about negative pixel height in Analyze 7.5 images.static void
savePreferredWarnNegativePixelWidth
(boolean b) Saves the user's preference about whether the user should be warned about negative pixel width in Analyze 7.5 images.void
setImageOrientationPositionPatient
(org.jogamp.vecmath.Vector3f[] dirCos, org.jogamp.vecmath.Point3f position, boolean force) This action is not fully-supported by the Analyze 7.5 file format, since positional information cannot be set.void
setPatientID
(String patID) Sets the patient ID for this Analyze image header.toString()
Returns theString
representation of this Analyze 7.5 image header.toString
(boolean html) Returns the string representation of this Analyze image header, with optional presentation in HTML format.Methods inherited from class com.xinapse.multisliceimage.Analyze.ANZHeader
getDBName, getDescription, getMinMax, setDBName, setDims, setDims, setMinMax, setNCols, setNFrames, setNRows, setNSlices
-
Field Details
-
WARN_NEGATIVE_PIXEL_WIDTH_PROPERTY_KEY
The property value key for setting whether the user should be warned about negative pixel widths.- See Also:
-
WARN_NEGATIVE_PIXEL_HEIGHT_PROPERTY_KEY
The property value key for setting whether the user should be warned about negative pixel heights.- See Also:
-
FLIP_NON_FLIPPED_PROPERTY_KEY
The property value key for setting whether to flip non-flipped Analyze 7.5 images.- See Also:
-
DO_NOT_FLIP_FLIPPED_PROPERTY_KEY
The property value key for setting whether not to flip flipped Analyze 7.5 images.- See Also:
-
CREATE_NON_FLIPPED_PROPERTY_KEY
The property value key for setting whether newly-created Analyze 7.5 images should have a non-flipped orientation.- See Also:
-
DEFAULT_WARN_NEGATIVE_PIXEL_SIZE
public static final boolean DEFAULT_WARN_NEGATIVE_PIXEL_SIZEWhether to warn the user about negative pixel sizes by default.- See Also:
-
DEFAULT_FLIP_NON_FLIPPED
public static final boolean DEFAULT_FLIP_NON_FLIPPEDThe default setting of whether to flip vertically an image with a non-flipped Analyze orientation.- See Also:
-
DEFAULT_DO_NOT_FLIP_FLIPPED
public static final boolean DEFAULT_DO_NOT_FLIP_FLIPPEDThe default setting of whether not to flip vertically an image with a flipped Analyze orientation.- See Also:
-
DEFAULT_CREATE_NON_FLIPPED
public static final boolean DEFAULT_CREATE_NON_FLIPPEDThe default setting of whether newly-created Analyze 7.5 images should have a non-flipped orientation.- See Also:
-
ORIENT_AXIAL
public static final byte ORIENT_AXIALThe constant used to indicate an axial orientation.- See Also:
-
ORIENT_CORONAL
public static final byte ORIENT_CORONALThe constant used to indicate a coronal orientation.- See Also:
-
ORIENT_SAGITTAL
public static final byte ORIENT_SAGITTALThe constant used to indicate a sagittal orientation.- See Also:
-
ORIENT_AXIAL_FLIPPED
public static final byte ORIENT_AXIAL_FLIPPEDThe constant used to indicate a flipped axial orientation.- See Also:
-
ORIENT_CORONAL_FLIPPED
public static final byte ORIENT_CORONAL_FLIPPEDThe constant used to indicate a flipped coronal orientation.- See Also:
-
ORIENT_SAGITTAL_FLIPPED
public static final byte ORIENT_SAGITTAL_FLIPPEDThe constant used to indicate a flipped sagittal orientation.- See Also:
-
-
Method Details
-
getPreferredWarnNegativePixelWidth
public static boolean getPreferredWarnNegativePixelWidth()Returns the user's preference about whether the user should be warned about negative pixel width in Analyze 7.5 images. Whether the user is warned or not, a horizontal flip is automatically performed for images with negative pixel widths. Images with negative pixel sizes are often created by FSL programs.If the system property
"analyze.warnnegwidth"
exists, and the property value is either"true"
or"false"
, then the user's preference is overridden by the property value.- Returns:
true
if the user should be issed with a warning when an Analyze 7.5 image has a negative pixel width.false
otherwise.
-
getPreferredWarnNegativePixelHeight
public static boolean getPreferredWarnNegativePixelHeight()Returns the user's preference about whether the user should be warned about negative pixel height in Analyze 7.5 images. Whether the user is warned or not, a vertical flip is automatically performed for images with negative pixel heights. Images with negative pixel sizes are often created by FSL programs.If the system property
"analyze.warnnegheight"
exists, and the property value is either"true"
or"false"
, then the user's preference is overridden by the property value.- Returns:
true
if the user should be issed with a warning when an Analyze 7.5 image has a negative pixel height.false
otherwise.
-
savePreferredWarnNegativePixelWidth
public static void savePreferredWarnNegativePixelWidth(boolean b) Saves the user's preference about whether the user should be warned about negative pixel width in Analyze 7.5 images.- Parameters:
b
-true
if the user is to be issed with a warning when an Analyze 7.5 image has a negative pixel width.false
otherwise.
-
savePreferredWarnNegativePixelHeight
public static void savePreferredWarnNegativePixelHeight(boolean b) Saves the user's preference about whether the user should be warned about negative pixel height in Analyze 7.5 images.- Parameters:
b
-true
if the user is to be issed with a warning when an Analyze 7.5 image has a negative pixel height.false
otherwise.
-
getPreferredFlipNonFlipped
public static boolean getPreferredFlipNonFlipped()Returns the user's preference about whether an Analyze 7.5 image with a non-flipped orientation should be treated as if it has a flipped orientation. Some programs that create Analyze 7.5 images write the orientation as a non-flipped orientation into the header, but then put pixel data to the image in a flipped orientation.If the system property
"analyze.flipnonflipped"
exists, and the property value is either"true"
or"false"
, then the user's preference is overridden by the property value.- Returns:
- whether non-flipped images should be treated as flipped.
-
savePreferredFlipNonFlipped
public static void savePreferredFlipNonFlipped(boolean b) Saves the user's preference about whether an Analyze 7.5 image with a non-flipped orientation should be treated as if it has a flipped orientation.- Parameters:
b
-true
if non-flipped images should be treated as flipped;false
otherwise.
-
getPreferredDoNotFlipFlipped
public static boolean getPreferredDoNotFlipFlipped()Returns the user's preference about whether an Analyze 7.5 image with a flipped orientation should be treated as if it has a non-flipped orientation. Some programs that create Analyze 7.5 images write the orientation as a flipped orientation into the header, but then put pixel data to the image in a non-flipped orientation.If the system property
"analyze.donotflipflipped"
exists, and the property value is either"true"
or"false"
, then the user's preference is overridden by the property value.- Returns:
- whether flipped images should be treated as non-flipped.
-
savePreferredDoNotFlipFlipped
public static void savePreferredDoNotFlipFlipped(boolean b) Saves the user's preference about whether an Analyze 7.5 image with a flipped orientation should be treated as if it has a non-flipped orientation.- Parameters:
b
-true
if flipped images should be treated as non-flipped;false
otherwise.
-
getPreferredCreateNonFlipped
public static boolean getPreferredCreateNonFlipped()Returns the user's preference about whether newly-created Analyze 7.5 images should have a non-flipped orientation. Some external programs (such as SPM, MRIcro and Image/J) may not be able to correctly display images with a flipped orientation, so if interoperating with these, it may be necessary to only use the non-flipped orientations. If not set in the user's preferences, then the default is to create images with a flipped orientation.If the system property
"analyze.createnonflipped"
exists, and the property value is either"true"
or"false"
, then the user's preference is overridden by the property value.- Returns:
- whether Analyze 7.5 images should created with a non-flipped orientation by default.
-
savePreferredCreateNonFlipped
public static void savePreferredCreateNonFlipped(boolean b) Saves the user's preference about whether newly-created Analyze 7.5 images should have a non-flipped orientation.- Parameters:
b
-true
if newly-created Analyze 7.5 images should have a non-flipped orientation;false
otherwise.
-
setImageOrientationPositionPatient
public void setImageOrientationPositionPatient(org.jogamp.vecmath.Vector3f[] dirCos, org.jogamp.vecmath.Point3f position, boolean force) throws IOException This action is not fully-supported by the Analyze 7.5 file format, since positional information cannot be set. The method sets the scan plane to one of the standard radiological planes (axial, coronal or sagittal): the one which is nearest in orientation to the direction cosines supplied. The requested position is ignored.- Parameters:
dirCos
- the direction cosines of the row, column and slice directions.position
- ignored.force
- if true, the orientation will be set regardless of the flipped image creation setting in the user preferences.- Throws:
IOException
- if an I/O error occurs.
-
getPatientID
Returns the patient ID for this Analyze image header.- Returns:
- a String representing the patientID.
-
setPatientID
Sets the patient ID for this Analyze image header. A supplied patient ID that is too long will be truncated.- Parameters:
patID
- a String representing the name description.
-
toString
Returns theString
representation of this Analyze 7.5 image header. -
toString
Returns the string representation of this Analyze image header, with optional presentation in HTML format. -
clone
Returns an exact copy of this Analyze header.
-