Class FileMincVarElem

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.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:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      int begin
      DOCUMENT ME!
      java.lang.String comments
      DOCUMENT ME!
      double[] cosines
      DOCUMENT ME!
      int[] dimid
      DOCUMENT ME!
      java.lang.String name
      DOCUMENT ME!
      int nc_type
      DOCUMENT ME!
      int nelems
      DOCUMENT ME!
      private static long serialVersionUID
      Use serialVersionUID for interoperability.
      java.lang.String signtype
      DOCUMENT ME!
      double start
      DOCUMENT ME!
      double step
      in zspace, step == slice gap, not necessarily slice thickness
      double trueStart
      DOCUMENT ME!
      java.lang.String units
      DOCUMENT ME!
      java.util.Vector<java.lang.Object> values
      DOCUMENT ME!
      FileMincAttElem[] vattArray
      DOCUMENT ME!
      double vmax
      DOCUMENT ME!
      double vmin
      DOCUMENT ME!
      int vsize
      DOCUMENT ME!
    • Constructor Summary

      Constructors 
      Constructor Description
      FileMincVarElem​(java.lang.String name, int nelems, int[] dimid)
      Constructor for the MINC variable element.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addVattElem​(java.lang.String name, int type, int length, int index)
      Adds an attribute element to the variable attribute array.
      void addVattValue​(FileMincAttElem elem, java.lang.Object value, int index)
      Sets the value of a variable attribute element.
      java.lang.Object clone()
      Creates a new version of this variable, copying all the important information.
      void createVattArray​(int length)
      Creates a new variable attribute array.
      FileMincAttElem getVattElem​(int index)
      Returns the variable attribute located at index in the array.
      void setOther​(int nc_type, int vsize, int begin)
      Sets the information in the variable that comes after the attribute array.
      void setValue​(java.lang.Object value)
      Adds value to values vector.
      java.lang.String toString()
      Converts information contained in variable to a readable form.
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • serialVersionUID

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

        public int begin
        DOCUMENT ME!
      • comments

        public java.lang.String comments
        DOCUMENT ME!
      • cosines

        public double[] cosines
        DOCUMENT ME!
      • dimid

        public int[] dimid
        DOCUMENT ME!
      • name

        public java.lang.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 java.lang.String signtype
        DOCUMENT ME!
      • start

        public double start
        DOCUMENT ME!
      • trueStart

        public double trueStart
        DOCUMENT ME!
      • units

        public java.lang.String units
        DOCUMENT ME!
      • values

        public java.util.Vector<java.lang.Object> values
        DOCUMENT ME!
      • vmax

        public double vmax
        DOCUMENT ME!
      • vmin

        public double vmin
        DOCUMENT ME!
      • vsize

        public int vsize
        DOCUMENT ME!
    • Constructor Detail

      • FileMincVarElem

        public FileMincVarElem​(java.lang.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 Detail

      • addVattElem

        public void addVattElem​(java.lang.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,
                                 java.lang.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 java.lang.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​(java.lang.Object value)
        Adds value to values vector.
        Parameters:
        value - Value to add.
      • toString

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