Class Analyze75Header

java.lang.Object
com.xinapse.multisliceimage.Analyze.ANZHeader
com.xinapse.multisliceimage.Analyze.Analyze75Header
All Implemented Interfaces:
Cloneable

public class Analyze75Header extends ANZHeader
This class represents a multi-dimensional Analyze 7.5 image header file. The header file contains all the dimensional and descriptive information about an Analyze image, but none of the pixel data.

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 Details

    • WARN_NEGATIVE_PIXEL_WIDTH_PROPERTY_KEY

      public static final String 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

      public static final String 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

      public static final String 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

      public static final String 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

      public static final String 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_SIZE
      Whether to warn the user about negative pixel sizes by default.
      See Also:
    • DEFAULT_FLIP_NON_FLIPPED

      public static final boolean DEFAULT_FLIP_NON_FLIPPED
      The 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_FLIPPED
      The 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_FLIPPED
      The 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_AXIAL
      The constant used to indicate an axial orientation.
      See Also:
    • ORIENT_CORONAL

      public static final byte ORIENT_CORONAL
      The constant used to indicate a coronal orientation.
      See Also:
    • ORIENT_SAGITTAL

      public static final byte ORIENT_SAGITTAL
      The constant used to indicate a sagittal orientation.
      See Also:
    • ORIENT_AXIAL_FLIPPED

      public static final byte ORIENT_AXIAL_FLIPPED
      The constant used to indicate a flipped axial orientation.
      See Also:
    • ORIENT_CORONAL_FLIPPED

      public static final byte ORIENT_CORONAL_FLIPPED
      The constant used to indicate a flipped coronal orientation.
      See Also:
    • ORIENT_SAGITTAL_FLIPPED

      public static final byte ORIENT_SAGITTAL_FLIPPED
      The 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

      public String getPatientID()
      Returns the patient ID for this Analyze image header.
      Returns:
      a String representing the patientID.
    • setPatientID

      public void setPatientID(String patID)
      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

      public String toString()
      Returns the String representation of this Analyze 7.5 image header.
      Overrides:
      toString in class ANZHeader
      Returns:
      a String describing the header.
    • toString

      public String toString(boolean html)
      Returns the string representation of this Analyze 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 Analyze75Header clone()
      Returns an exact copy of this Analyze header.
      Overrides:
      clone in class ANZHeader
      Returns:
      an exact copy of this Analyze75Header instance.