Class FileMincVarElem

All Implemented Interfaces:
Serializable, Cloneable

public class FileMincVarElem extends ModelSerialCloneable
This class represents a MINC variable element. MINC variables consist of a name, a dimid array (often empty), an attribute array, a type, a begin, and a size. The attribute array contains important image information. The "type" indicates the actual type of the variable (not the attributes). The begin is the location in the file where the variable is first written; the size is how many bytes the variable takes up. So for example the variable image has a bunch of attributes such as signtype, vmin, and vmax that are necessary for proper read. Then the type is the type of the image (often short) and the begin is where the image data actually begins. The size is extents[0]*extents[1]*extents[2]*byte size.
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Use serialVersionUID for interoperability.
      See Also:
    • begin

      public int begin
      DOCUMENT ME!
    • comments

      public String comments
      DOCUMENT ME!
    • cosines

      public double[] cosines
      DOCUMENT ME!
    • dimid

      public int[] dimid
      DOCUMENT ME!
    • name

      public String name
      DOCUMENT ME!
    • nc_type

      public int nc_type
      DOCUMENT ME!
    • nelems

      public int nelems
      DOCUMENT ME!
    • step

      public double step
      in zspace, step == slice gap, not necessarily slice thickness
    • signtype

      public String signtype
      DOCUMENT ME!
    • start

      public double start
      DOCUMENT ME!
    • trueStart

      public double trueStart
      DOCUMENT ME!
    • units

      public String units
      DOCUMENT ME!
    • values

      public Vector<Object> values
      DOCUMENT ME!
    • vattArray

      public FileMincAttElem[] vattArray
      DOCUMENT ME!
    • vmax

      public double vmax
      DOCUMENT ME!
    • vmin

      public double vmin
      DOCUMENT ME!
    • vsize

      public int vsize
      DOCUMENT ME!
  • Constructor Details

    • FileMincVarElem

      public FileMincVarElem(String name, int nelems, int[] dimid)
      Constructor for the MINC variable element.
      Parameters:
      name - The name of the variable (e.g., image, image-min, image-max).
      nelems - The number of elements in this variable.
      dimid - Array of dimension ids; often empty.
  • Method Details

    • addVattElem

      public void addVattElem(String name, int type, int length, int index)
      Adds an attribute element to the variable attribute array.
      Parameters:
      name - Name of the attribute.
      type - DOCUMENT ME!
      length - Length of the attribute.
      index - Where to put the element in the variable attribute array.
    • addVattValue

      public void addVattValue(FileMincAttElem elem, Object value, int index)
      Sets the value of a variable attribute element. If the element is image, xspace, yspace, or zspace, sets important image information.
      Parameters:
      elem - Element to set value of.
      value - Value to set element to.
      index - Index in attribute element to set value to.
    • clone

      public Object clone()
      Creates a new version of this variable, copying all the important information.
      Overrides:
      clone in class ModelSerialCloneable
      Returns:
      An exact copy of this variable.
    • createVattArray

      public void createVattArray(int length)
      Creates a new variable attribute array. For example, the "image" variable has important information about the image recorded in the variables attribute array.
      Parameters:
      length - The size of this variable attribute array.
    • getVattElem

      public FileMincAttElem getVattElem(int index)
      Returns the variable attribute located at index in the array.
      Parameters:
      index - Where in the variable attribute array the attribute is located.
      Returns:
      The attribute.
    • setOther

      public void setOther(int nc_type, int vsize, int begin)
      Sets the information in the variable that comes after the attribute array.
      Parameters:
      nc_type - Type of data (byte, short, float, etc.)
      vsize - Size of the variable.
      begin - Where this variable's data starts.
    • setValue

      public void setValue(Object value)
      Adds value to values vector.
      Parameters:
      value - Value to add.
    • toString

      public String toString()
      Converts information contained in variable to a readable form. This is displayed in displayAboutInfo.
      Overrides:
      toString in class Object
      Returns:
      String version of information contained in this variable.