edu.uthscsa.ric.volume
Class VoxelDimensions

java.lang.Object
  extended by edu.uthscsa.ric.volume.VoxelDimensions
All Implemented Interfaces:
java.lang.Cloneable

public class VoxelDimensions
extends java.lang.Object
implements java.lang.Cloneable

VoxelDimensions contains information related to voxel size in column/row/slice and x/y/z orientations, as well as temporal resolution and units.


Field Summary
static java.lang.String[] UNIT_STRING
           
static short UNITS_HZ
           
static short UNITS_METER
           
static short UNITS_MICRON
           
static short UNITS_MM
           
static short UNITS_MSEC
           
static short UNITS_PPM
           
static short UNITS_RADS
           
static short UNITS_SEC
           
static short UNITS_UNKNOWN
           
static short UNITS_USEC
           
 
Constructor Summary
VoxelDimensions(double aColSize, double aRowSize, double aSliceThickness, double aTR)
          The only class constructor.
 
Method Summary
 void clearNegativeVoxelSizes()
          Replaces any stored negative voxel sizes with their absolute value.
 java.lang.Object clone()
          Returns a copy of this VoxelDimensions object.
 boolean equals(VoxelDimensions vd)
          Comparison method.
 double getAxialArea()
          Returns the area of a voxel in the axial plane.
 double getColSize(boolean abs)
          Returns the size of a voxel's column dimension.
 double getCoronalArea()
          Returns the area of a voxel in the coronal plane.
 double getRowSize(boolean abs)
          Returns the size of a voxel's row dimension.
 double getSagittalArea()
          Returns the area of a voxel in the sagittal plane.
 double getSliceThickness(boolean abs)
          Returns the size of a voxel's slice dimension.
 int getSpatialUnit()
          Returns the spatial unit code.
 double getTE1()
          Returns the TE1.
 double getTE2()
          Returns the TE2.
 int getTemporalUnit()
          Returns the temporal unit code.
 double getTR()
          Returns the TR.
 double getVolume()
          Returns the volume of a voxel.
 double getXSize()
          Returns the size of a voxel along the X dimension.
 double getYSize()
          Returns the size of a voxel along the Y dimension.
 double getZSize()
          Returns the size of a voxel along the Z dimension.
 boolean isValid()
          Use to verify that column, row, and slice sizes and TR have valid values.
 boolean isValid(java.lang.StringBuffer buf)
          Use to verify that column, row, and slice sizes and TR have valid values.
 void setColNegativeState(boolean bool)
          Sets the negative state of voxel column size.
 void setColSize(double val)
          Sets the size of a voxel along the column dimension.
 void setRowNegativeState(boolean bool)
          Sets the negative state of voxel row size.
 void setRowSize(double val)
          Sets the size of a voxel along the row dimension.
 void setSliceNegativeState(boolean bool)
          Sets the negative state of voxel slice size.
 void setSliceThickness(double val)
          Sets the size of a voxel along the slice dimension.
 void setSpatialUnit(int unit)
          Sets the spatial unit of the voxel.
 void setSpatialUnit(java.lang.String unit)
          Sets the spatial unit of the voxel.
 void setTE1(double num)
          Sets the TE1.
 void setTE2(double num)
          Sets the TE2.
 void setTemporalUnit(int unit)
          Sets the temporal unit of the voxel.
 void setTemporalUnit(java.lang.String unit)
          Sets the temporal unit of the voxel.
 void setTR(double num)
          Sets the TR.
 void setValues(VoxelDimensions vd)
          Set the values of this VoxelDimensions to that of another.
 void setValues(VoxelDimensions vd, boolean updateXYZ)
          Set the values of this VoxelDimensions to that of another.
 void setXSize(double num)
          Sets the size of a voxel along the X dimension.
 void setYSize(double num)
          Sets the size of a voxel along the Y dimension.
 void setZSize(double num)
          Sets the size of a voxel along the Z dimension.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNITS_UNKNOWN

public static final short UNITS_UNKNOWN
See Also:
Constant Field Values

UNITS_METER

public static final short UNITS_METER
See Also:
Constant Field Values

UNITS_MM

public static final short UNITS_MM
See Also:
Constant Field Values

UNITS_MICRON

public static final short UNITS_MICRON
See Also:
Constant Field Values

UNITS_SEC

public static final short UNITS_SEC
See Also:
Constant Field Values

UNITS_MSEC

public static final short UNITS_MSEC
See Also:
Constant Field Values

UNITS_USEC

public static final short UNITS_USEC
See Also:
Constant Field Values

UNITS_HZ

public static final short UNITS_HZ
See Also:
Constant Field Values

UNITS_PPM

public static final short UNITS_PPM
See Also:
Constant Field Values

UNITS_RADS

public static final short UNITS_RADS
See Also:
Constant Field Values

UNIT_STRING

public static final java.lang.String[] UNIT_STRING
Constructor Detail

VoxelDimensions

public VoxelDimensions(double aColSize,
                       double aRowSize,
                       double aSliceThickness,
                       double aTR)
The only class constructor.

Parameters:
aColSize - size of a voxel's column dimension
aRowSize - size of a voxel's row dimension
aSliceThickness - size of a voxel's slice dimension
aTR - temporal resolution
Method Detail

clone

public java.lang.Object clone()
Returns a copy of this VoxelDimensions object.

Overrides:
clone in class java.lang.Object
Returns:
cloned VoxelDimensions object

equals

public boolean equals(VoxelDimensions vd)
Comparison method. Does not include temporal information or units.

Parameters:
vd - VoxelDimensions object to compare

setValues

public void setValues(VoxelDimensions vd)
Set the values of this VoxelDimensions to that of another.

Parameters:
vd - replacement VoxelDimensions object

setValues

public void setValues(VoxelDimensions vd,
                      boolean updateXYZ)
Set the values of this VoxelDimensions to that of another.

Parameters:
vd - replacement VoxelDimensions object
updateXYZ - xyz values will be replaced, if true

getVolume

public double getVolume()
Returns the volume of a voxel.

Returns:
volume of a voxel.

getAxialArea

public double getAxialArea()
Returns the area of a voxel in the axial plane.

Returns:
area of a voxel in the axial plane

getCoronalArea

public double getCoronalArea()
Returns the area of a voxel in the coronal plane.

Returns:
area of a voxel in the coronal plane

getSagittalArea

public double getSagittalArea()
Returns the area of a voxel in the sagittal plane.

Returns:
area of a voxel in the sagittal plane

clearNegativeVoxelSizes

public void clearNegativeVoxelSizes()
Replaces any stored negative voxel sizes with their absolute value.


getRowSize

public double getRowSize(boolean abs)
Returns the size of a voxel's row dimension.

Parameters:
abs - a negative value will be converted to positive, if true
Returns:
size of a voxel's row dimension

getColSize

public double getColSize(boolean abs)
Returns the size of a voxel's column dimension.

Parameters:
abs - a negative value will be converted to positive, if true
Returns:
size of a voxel's column dimension

getSliceThickness

public double getSliceThickness(boolean abs)
Returns the size of a voxel's slice dimension.

Parameters:
abs - negative value will be converted to positive, if true
Returns:
size of a voxel's slice dimension

getTR

public double getTR()
Returns the TR.

Returns:
size of TR

getTE1

public double getTE1()
Returns the TE1.

Returns:
size of TE1

getTE2

public double getTE2()
Returns the TE2.

Returns:
size of TE2

setTR

public void setTR(double num)
Sets the TR.

Parameters:
num - size of TR

setTE1

public void setTE1(double num)
Sets the TE1.

Parameters:
num - size of TE1

setTE2

public void setTE2(double num)
Sets the TE2.

Parameters:
num - size of TE2

setXSize

public void setXSize(double num)
Sets the size of a voxel along the X dimension.

Parameters:
num - size of voxel along the X dimension

setYSize

public void setYSize(double num)
Sets the size of a voxel along the Y dimension.

Parameters:
num - size of voxel along the Y dimension

setZSize

public void setZSize(double num)
Sets the size of a voxel along the Z dimension.

Parameters:
num - size of voxel along the Z dimension

setSpatialUnit

public void setSpatialUnit(int unit)
Sets the spatial unit of the voxel.

Parameters:
unit - spatial unit code

setSpatialUnit

public void setSpatialUnit(java.lang.String unit)
Sets the spatial unit of the voxel.

Parameters:
unit - spatial unit name

setTemporalUnit

public void setTemporalUnit(java.lang.String unit)
Sets the temporal unit of the voxel.

Parameters:
unit - temporal unit name

setRowNegativeState

public void setRowNegativeState(boolean bool)
Sets the negative state of voxel row size.

Parameters:
bool - if true, row size will be set as negative; positive otherwise

setColNegativeState

public void setColNegativeState(boolean bool)
Sets the negative state of voxel column size.

Parameters:
bool - if true, column size will be set as negative; positive otherwise

setSliceNegativeState

public void setSliceNegativeState(boolean bool)
Sets the negative state of voxel slice size.

Parameters:
bool - if true, slice size will be set as negative; positive otherwise

setTemporalUnit

public void setTemporalUnit(int unit)
Sets the temporal unit of the voxel.

Parameters:
unit - temporal unit code

getSpatialUnit

public int getSpatialUnit()
Returns the spatial unit code.

Returns:
spatial unit code

getTemporalUnit

public int getTemporalUnit()
Returns the temporal unit code.

Returns:
temporal unit code

getXSize

public double getXSize()
Returns the size of a voxel along the X dimension.

Returns:
size of voxel along X dimension

getYSize

public double getYSize()
Returns the size of a voxel along the Y dimension.

Returns:
size of voxel along Y dimension

getZSize

public double getZSize()
Returns the size of a voxel along the Z dimension.

Returns:
size of voxel along Z dimension

setRowSize

public void setRowSize(double val)
Sets the size of a voxel along the row dimension.

Parameters:
val - size of a voxel along the row dimension

setColSize

public void setColSize(double val)
Sets the size of a voxel along the column dimension.

Parameters:
val - size of a voxel along the column dimension

setSliceThickness

public void setSliceThickness(double val)
Sets the size of a voxel along the slice dimension.

Parameters:
val - size of a voxel along the slice dimension

isValid

public boolean isValid()
Use to verify that column, row, and slice sizes and TR have valid values.

Returns:
true if valid

isValid

public boolean isValid(java.lang.StringBuffer buf)
Use to verify that column, row, and slice sizes and TR have valid values.

Parameters:
buf - stores any error messages
Returns:
true if valid