Class FileInfoSiemensText

    • Field Detail

      • serialVersionUID

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

        public static final short DT_UNKNOWN
        SiemensText file format define use to indicate undefined image data type.
        See Also:
        Constant Field Values
      • DT_BYTE

        public static final short DT_BYTE
        SiemensText file format define use to indicate Byte (8-bits) data type
        See Also:
        Constant Field Values
      • DT_2INTEGERI

        public static final short DT_2INTEGERI
        SiemensText file format define use to indicate 2-byte integer - Intel style.
        See Also:
        Constant Field Values
      • DT_4INTEGERI

        public static final short DT_4INTEGERI
        SiemensText file format define use to indicate 4-byte integer - Intel style.
        See Also:
        Constant Field Values
      • DT_4FLOATI

        public static final short DT_4FLOATI
        SiemensText file format define use to indicate 4-byte float - Intel style.
        See Also:
        Constant Field Values
      • DT_4FLOATS

        public static final short DT_4FLOATS
        SiemensText file format define use to indicate 4-byte float - Sun style.
        See Also:
        Constant Field Values
      • DT_2INTEGERS

        public static final short DT_2INTEGERS
        SiemensText file format define use to indicate 2-byte integer - Sun style.
        See Also:
        Constant Field Values
      • DT_4INTEGERS

        public static final short DT_4INTEGERS
        SiemensText file format define use to indicate 4-byte integer - Sun style.
        See Also:
        Constant Field Values
      • aux_file

        private java.lang.String aux_file
        DOCUMENT ME!
      • bitpix

        private short bitpix
        Bits per pixel. Valid values include: 1, 8, 16, 32, 64, 24(rgb).
      • cal_max

        private float cal_max
        Range of calibration values.
      • cal_min

        private float cal_min
        Values of 0.0 for both fields imply that no calibration min and max values are used !
      • compressed

        private float compressed
        Indicates if compression is used. Default is -1 indicating no compression
      • data_type

        private java.lang.String data_type
        Unknown use 10 chars.
      • datatype

        private short datatype
        Stores the image data type DT_NONE = 0; DT_UNKNOWN = 0; DT_BINARY = 1; DT_UNSIGNED_CHAR = 2; DT_SIGNED_SHORT = 4; DT_UNSIGNED_SHORT = 4; DT_SIGNED_INT = 8; DT_FLOAT = 16; DT_COMPLEX = 32; DT_DOUBLE = 64; DT_RGB = 128; DT_ALL = 255;
      • db_name

        private java.lang.String db_name
        Name of file with a length of 18 chars.
      • descrip

        private java.lang.String descrip
        String with a max character length of 80 used to describe image.
      • dim_un0

        private short dim_un0
        Unused.
      • exp_date

        private java.lang.String exp_date
        String with a max character length of 10 used to indicate the experiment date.
      • exp_time

        private java.lang.String exp_time
        String with a max character length of 10 used to indicate the experiment time.
      • extents

        private int extents
        Should be 16384.
      • field_skip

        private int field_skip
        Unknown length.
      • funused1

        private float funused1
        MIPAV uses this variable to define the X-axis origin.
      • funused2

        private float funused2
        MIPAV uses this variable to define the Y-axis origin.
      • funused3

        private float funused3
        MIPAV uses this variable to define the Z-axis origin.
      • generated

        private java.lang.String generated
        Unknown use. Length of 10.
      • glmax

        private int glmax
        Maximum pixel values for the entire dataset.
      • glmin

        private int glmin
        Minimum pixel values for the entire database.
      • hist_un0

        private java.lang.String hist_un0
        Unknown use. Length of 3.
      • hkey_un0

        private char hkey_un0
        Unknown use. Length of 1.
      • omax

        private int omax
        Unknown use.
      • omin

        private int omin
        Unknown use.
      • orient

        private byte orient
        DOCUMENT ME!
      • originator

        private java.lang.String originator
        Unknown use. Length of 10.
      • patient_id

        private java.lang.String patient_id
        Patient's ID. Length of 10.
      • regular

        private char regular
        I think it means data has uniform spacing (resolutions).
      • scannum

        private java.lang.String scannum
        Scan ID Length of 10.
      • session_error

        private short session_error
        Unknown use.
      • sizeof_hdr

        private int sizeof_hdr
        Always of length 348.
      • smax

        private int smax
        Unknown use.
      • smin

        private int smin
        Unknown use.
      • start_field

        private int start_field
        Unknown use.
      • verified

        private float verified
        Unknown use.
      • views

        private int views
        Unknown use.
      • vols_added

        private int vols_added
        Unknown use.
      • vox_units

        private java.lang.String vox_units
        specifies the spatial units of measure for a voxel.
      • name

        private java.lang.String name
      • dir

        private java.lang.String dir
    • Constructor Detail

      • FileInfoSiemensText

        public FileInfoSiemensText​(java.lang.String name,
                                   java.lang.String directory,
                                   int format)
        File info storage constructor.
        Parameters:
        name - file name
        directory - directory
        format - file format
    • Method Detail

      • displayAboutInfo

        public void displayAboutInfo​(JDialogBase dlog,
                                     TransMatrix matrix)
        Displays the file information.
        Specified by:
        displayAboutInfo in class FileInfoBase
        Parameters:
        dlog - dialog box that is written to
        matrix - transformation matrix
      • getAuxFile

        public java.lang.String getAuxFile()
        Accessor to the aux_file string.
        Returns:
        String aux_file
      • getBitPix

        public short getBitPix()
        Accessor to the bitpix value.
        Returns:
        short the bitpix value.
      • getCalMax

        public float getCalMax()
        Accessor to cal-max.
        Returns:
        float cal_max
      • getCalMin

        public float getCalMin()
        Accessor to cal_min.
        Returns:
        float cal_min
      • getCompressed

        public float getCompressed()
        Provides the compressed value.
        Returns:
        float compressed
      • getDataTypeCode

        public short getDataTypeCode()
        Accessor to coded datatype value.
        Returns:
        short datatype
      • getDataTypeName

        public java.lang.String getDataTypeName()
        Accessor to the 10 character string of data-type.
        Returns:
        String returns data_type
      • getDBname

        public java.lang.String getDBname()
        Accessor to DB_name.
        Returns:
        String database name
      • getDescription

        public java.lang.String getDescription()
        Accessor to the current SiemensText-image description.
        Returns:
        String description
      • getDim

        public short getDim()
        Accessor to the dim_un0.
        Returns:
        Returns the dim_un0 variable.
      • getExperimentDate

        public java.lang.String getExperimentDate()
        Provides the current experiment date string.
        Returns:
        String the experiment date.
      • getExperimentTime

        public java.lang.String getExperimentTime()
        Provides the current experiment time string.
        Returns:
        String the experiment time
      • getFieldSkip

        public int getFieldSkip()
        Provides the current field_skip value.
        Returns:
        int the field_skip value
      • getFileExtents

        public int getFileExtents()
        SiemensText _extents_ value of 16,384.
        Returns:
        The extents value which always seems to be 16,384.
      • getFunused1

        public float getFunused1()
        MIPAV hack to the SiemensText standard. Retrieves start locaiton from x-axis. To be stored as Funused1.
        Returns:
        float funused1
      • getFunused2

        public float getFunused2()
        MIPAV hack to the SiemensText standard. Retrieves start locaiton from y-axis. To be stored as Funused2.
        Returns:
        float funused2
      • getFunused3

        public float getFunused3()
        MIPAV hack to the SiemensText standard. Retrieves start location from z-axis. To be stored as Funused3.
        Returns:
        float funused3
      • getGenerated

        public java.lang.String getGenerated()
        Provides the current generated string.
        Returns:
        String generated string
      • getGLmax

        public int getGLmax()
        Provides the value of glmax.
        Returns:
        int glmax
      • getGLmin

        public int getGLmin()
        Provides the value of glmin.
        Returns:
        int glmin
      • getHist

        public java.lang.String getHist()
        Accessor to get the SiemensText's hist_un0 string.
        Returns:
        Returns the hist_un0 string.
      • getHkey

        public char getHkey()
        Accessor to get the SiemensText's hkey_un0 string.
        Returns:
        Returns the hkey_un0 string.
      • getOmax

        public int getOmax()
        Provides current omax value.
        Returns:
        int the omax value
      • getOmin

        public int getOmin()
        Provides current omin value.
        Returns:
        int the omin value
      • getOrientation

        public byte getOrientation()
        Provides the current orientation value.
        Returns:
        byte orientation value
      • getOriginator

        public java.lang.String getOriginator()
        Provides the current originator string.
        Returns:
        String originator string
      • getPatientID

        public java.lang.String getPatientID()
        Provides the current patient id.
        Returns:
        String the patient id
      • getRegular

        public char getRegular()
        Provides the value of regular character.
        Returns:
        char value of regular character
      • getScanNum

        public java.lang.String getScanNum()
        Provides the current scannum string.
        Returns:
        String current scannum string
      • getSessionErr

        public short getSessionErr()
        Provide the value of session err.
        Returns:
        short session_error
      • getSizeOfHeader

        public int getSizeOfHeader()
        Provides the current scannum string.
        Returns:
        String current scannum string
      • getSmax

        public int getSmax()
        Provides current smax value.
        Returns:
        int the smax value
      • getSmin

        public int getSmin()
        Provides current smin value.
        Returns:
        int the smin value
      • getStartField

        public int getStartField()
        Provides the current value for the start_field.
        Returns:
        int the start_field
      • getVerified

        public float getVerified()
        Provides the verified value.
        Returns:
        The SiemensText verified parameter.
      • getViews

        public int getViews()
        Provides current views value.
        Returns:
        The view parameter.
      • getVolsAdded

        public int getVolsAdded()
        Provides the current vols_added value.
        Returns:
        The vols_added
      • getVoxUnits

        public java.lang.String getVoxUnits()
        Provides the string for vox-units.
        Returns:
        The vox_units parameter
      • setAuxFile

        public void setAuxFile​(java.lang.String auxFile)
        Supplies auxiliary-file string; permits no more than 24 characters.
        Parameters:
        auxFile - T
      • setBitPix

        public void setBitPix​(short bp)
        Sets bitpix; any value other than 1, 8, 16, 32, 64, or 24 gets set to the dissalowed trap value, -1.
        Parameters:
        bp - DOCUMENT ME!
      • setCalMax

        public void setCalMax​(float cal)
        sets cal-max. if supplied value is less than cal-min, the cal-min gets reset to the supplied value as well, so that cal-min is still no greater than cal-max.
        Parameters:
        cal - DOCUMENT ME!
      • setCalMin

        public void setCalMin​(float cal)
        Sets cal-min. if supplied value is greater than cal-max, the cal-max gets reset to the supplied value as well, so that cal-max is still no less than cal-min.
        Parameters:
        cal - DOCUMENT ME!
      • setCompressed

        public void setCompressed​(float comp)
        sets the compressed variable.
        Parameters:
        comp - DOCUMENT ME!
      • setDataType

        public void setDataType​(short dtype)
        Accessor to supply coded datatype.
        Parameters:
        dtype - DOCUMENT ME!
      • setDBname

        public void setDBname​(java.lang.String dbname)
        Set the database name - limit 18 character max to set the DB_NAME value.
        Parameters:
        dbname - DOCUMENT ME!
      • setDescription

        public void setDescription​(java.lang.String description)
        Allows no more than 80 characters to fill in the SiemensText-image description.
        Parameters:
        description - DOCUMENT ME!
      • setDim

        public void setDim​(short un0)
        DOCUMENT ME!
        Parameters:
        un0 - DOCUMENT ME!
      • setExperimentDateandTime

        public void setExperimentDateandTime​(java.lang.String date)
        Allows a maximum of 10 characters to set the experiment date string.
        Parameters:
        date - DOCUMENT ME!
      • setFieldSkip

        public void setFieldSkip​(int field)
        Supplies the submitted value to the field_sip variable.
        Parameters:
        field - DOCUMENT ME!
      • setFileExtents

        public void setFileExtents​(int ext)
        DOCUMENT ME!
        Parameters:
        ext - DOCUMENT ME!
      • setFunused1

        public void setFunused1​(float fun)
        Sets the start locations in the x-axis in fileInfoBase. This is a hack into the SiemensText standard to compensate for start locations not being known. To be Stored in the Funused1 variable.
        Parameters:
        fun - x start location
        See Also:
        FileInfoBase#setStartLocations(float, int)
      • setFunused2

        public void setFunused2​(float fun)
        Sets the start locations in the y-axis in fileInfoBase. This is a hack into the SiemensText standard to compensate for start locations not being known. To be Stored in the Funused2 variable.
        Parameters:
        fun - y start location
        See Also:
        FileInfoBase#setStartLocations(float, int)
      • setFunused3

        public void setFunused3​(float fun)
        Sets the start locations in the z-axis in fileInfoBase. This is a hack into the SiemensText standard to compensate for start locations not being known. To be Stored in the Funused3 variable.
        Parameters:
        fun - z start location
      • setGenerated

        public void setGenerated​(java.lang.String gen)
        Allows a maximum of 10 characters to set the generated string.
        Parameters:
        gen - DOCUMENT ME!
      • setGLmax

        public void setGLmax​(int gl)
        Sets glmax. if supplied value is less than glmin, the glmin gets reset to the supplied value as well, so that glmin is still no greater than glmax.
        Parameters:
        gl - DOCUMENT ME!
      • setGLmin

        public void setGLmin​(int gl)
        Sets glmin. if supplied value is greater than glmax, the glmax gets reset to the supplied value as well, so that glmax is still no less than glmin.
        Parameters:
        gl - DOCUMENT ME!
      • setHist

        public void setHist​(java.lang.String hist)
        DOCUMENT ME!
        Parameters:
        hist - DOCUMENT ME!
      • setHkey

        public void setHkey​(char hk)
        DOCUMENT ME!
        Parameters:
        hk - DOCUMENT ME!
      • setOmax

        public void setOmax​(int oMax)
        Sets omax. If supplied value is less than omin, the omin gets reset to the supplied value as well, so that omin is still no greater than omax.
        Parameters:
        oMax - Value that omax is set to.
      • setOmin

        public void setOmin​(int oMin)
        Sets omin. if supplied value is greater than omax, the omax gets reset to the supplied value as well, so that omax is still no less than omin.
        Parameters:
        oMin - Value that omin is set to.
      • setOrientation

        public void setOrientation​(byte orientation)
        Sets the image orientation converting from SiemensText specific orientation to general orientation. Value may be transverse, coronal, or sagittal.

        see the top of this document for all possible values. supplying a value other than one of these 6 possiblities sets the orientation to an impossible 'flag' value.

        See Also:
        FileInfoBase.setImageOrientation(int)
      • setOrigin

        public void setOrigin​(float[] stlocat)
        Sets start locations of each axis.
        Overrides:
        setOrigin in class FileInfoBase
        Parameters:
        stlocat - axis start location array
        See Also:
        FileInfoBase#getStartLocations()
      • setOrigin

        public void setOrigin​(float fun,
                              int axis)
        Sets the start location of the specified axis.
        Overrides:
        setOrigin in class FileInfoBase
        Parameters:
        fun - origin coord.
        axis - axis of orientation; x is 0, y is 1, z is 2.
        See Also:
        #getStartLocations(int)
      • setOriginator

        public void setOriginator​(java.lang.String originator)
        Allows a maximum of 10 characters to set the originator string.
        Parameters:
        originator - Originator string.
      • setPatientID

        public void setPatientID​(java.lang.String patIDnum)
        Allows a maximum of 10 characters to set the patient ID string.
        Parameters:
        patIDnum - Patient ID string.
      • setRegular

        public void setRegular​(char ch)
        Supply the value of regular character.
        Parameters:
        ch - value of r indicates all images are of the same size which seems to always be the case.
      • setScanNum

        public void setScanNum​(java.lang.String scanNum)
        Allows a maximum of 10 characters to set the scannum string.
        Parameters:
        scanNum - Scan number of the image.
      • setSessionErr

        public void setSessionErr​(short sessionError)
        Supply the value of session error.
        Parameters:
        sessionError - The session error.
      • setSizeOfHeader

        public void setSizeOfHeader​(int size)
        Sets the size of the header which is always 348.
        Parameters:
        size - The size of the header which is always 348 for SiemensText images.
      • setSmax

        public void setSmax​(int sMax)
        Sets smax. If supplied value is less than smin, the smin gets reset to the supplied value as well, so that smin is still no greater than smax.
        Parameters:
        sMax - DOCUMENT ME!
      • setSmin

        public void setSmin​(int sMin)
        Sets smin. If supplied value is greater than smax, the smax gets reset to the supplied value as well, so that smax is still no less than smin.
        Parameters:
        sMin - The sMin value.
      • setStartField

        public void setStartField​(int startField)
        Supplies the submitted value to the start_field variable.
        Parameters:
        startField - The start field value.
      • setVerified

        public void setVerified​(float verified)
        Supply the value to verified.
        Parameters:
        verified - The verified value
      • setViews

        public void setViews​(int view)
        Sets the views variable.
        Parameters:
        view - The view value.
      • setVolsAdded

        public void setVolsAdded​(int vols)
        Supplies a value to the vols_added valiable.
        Parameters:
        vols - DOCUMENT ME!
      • setVoxUnits

        public void setVoxUnits​(java.lang.String voxUnits)
        Allows no more than 4 characters for the string describing the vox units.
        Parameters:
        voxUnits - DOCUMENT ME!
      • updateFileInfos

        public void updateFileInfos​(FileInfoSiemensText fInfo)
        Propogates the current file info to another FileInfoSiemensText except for the 3 start locations kept in funused1, funused2, funused3.

        It does not copy over the datatypeCode. (though, aside from, "it isn't in the about table", I can't think of a reason why it shouldn't. but it doesn't.) Also, copied over is bitPix, aux_file.

        Some variables, such as the unused1, unused2, unused3, are really taken from unused, rather than from the start locations as we are re-using the funused variables. This means that if the unused variables are not right to begin with, this certainly won't correct them!

        Parameters:
        fInfo - File info. object used to update values in this object.
      • setString

        protected java.lang.String setString​(java.lang.String str,
                                             int length)
        Verifies string is not larger than length; strings larger than length, are clipped before being returned.
        Parameters:
        str - The input string.
        length - The maximum length of the string.
        Returns:
        String new substring