Class ncsa.horizon.coordinates.transforms.LinearCoordTransform
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ncsa.horizon.coordinates.transforms.LinearCoordTransform

java.lang.Object
   |
   +----java.util.Observable
           |
           +----ncsa.horizon.coordinates.CoordTransform
                   |
                   +----ncsa.horizon.coordinates.transforms.LinearCoordTransform

public class LinearCoordTransform
extends CoordTransform
an object for transforming positions from one coordinate system to another via a linear shift and scaling.


Variable Index

 o name
 o nop
 o offset
 o refpos
 o refval
 o stepsize

Constructor Index

 o LinearCoordTransform()
create a LinearCoordTransform object with default values.
 o LinearCoordTransform(int)
create a LinearCoordTransform object with default values.
 o LinearCoordTransform(int, double[], double[], double[], double[])
create a LinearCoordTransform object specifying all internal data.
 o LinearCoordTransform(int, double[], double[], double[], double[], String[])
create a LinearCoordTransform object specifying all internal data.
 o LinearCoordTransform(Metadata)
create a linear transform based on the specified metadata using the horizon schema.

Method Index

 o clone()
create a copy of this Transform
 o forward(double[])
apply a forward tranform on an input position.
 o forward(double[], int[])
apply a forward tranform on an input position.
 o getInNaxes()
return the minimum number of axes that the forward transform operates on.
 o getMaxNaxes()
return the maximum number of axes this transform operates on
 o getMetadata(Metadata, boolean, int[])
update the input Metadata object to reflect the changes that this tranform makes to a coordinate position.
 o getName()
return the axis name to be given to a transformed axis.
 o getName(int)
return the axis name to be given to a transformed axis, or null if the name is not updated by getMetadata().
 o getOutNaxes()
return the minimum number of axes that results from the forward transform.
 o getRefoffset()
return the axis reference offset for each axis.
 o getRefoffset(int)
return the axis reference offset for the specified axis.
 o getRefposition()
return the axis reference position for all the axes.
 o getRefposition(int)
return the axis reference position for the specified axis.
 o getRefvalue()
return a copy of the axis reference values for all axes.
 o getRefvalue(int)
return the axis reference value for the specified axis.
 o getStepsize()
return the axis step size for each axis.
 o getStepsize(int)
return the axis step size for the specified axis.
 o reverse(double[])
apply a reverse tranform on an input position.
 o reverse(double[], int[])
apply a reverse tranform on an input position
 o setMaxNaxes(int)
set the maximum number of axes this transform operates on
 o setName(int, String)
set the axis name to be given to a transformed axis.
 o setName(String[])
set the axis names to be given to each transformed axis.
 o setRefoffset(double[])
set the axis reference offset for each axis.
 o setRefoffset(int, double)
set the axis reference offset for the specified axis.
 o setRefposition(double[])
set the axis reference position for each axis.
 o setRefposition(int, double)
set the axis reference position the specified axis.
 o setRefvalue(double[])
set the axis reference value for each axis.
 o setRefvalue(int, double)
set the axis reference value for the specified axis.
 o setStepsize(double[])
set the axis step size for each axis.
 o setStepsize(int, double)
set the axis step size for the specified axis.

Variables

 o nop
  protected int nop
 o refpos
  protected double refpos[]
 o refval
  protected double refval[]
 o offset
  protected double offset[]
 o stepsize
  protected double stepsize[]
 o name
  protected String name[]

Constructors

 o LinearCoordTransform
  public LinearCoordTransform(int naxes)
create a LinearCoordTransform object with default values.
Parameters:
naxes - the maximum number of axes this transform can operate on
 o LinearCoordTransform
  public LinearCoordTransform()
create a LinearCoordTransform object with default values.
 o LinearCoordTransform
  public LinearCoordTransform(int naxes,
                              double refpos[],
                              double refval[],
                              double offset[],
                              double stepsize[])
create a LinearCoordTransform object specifying all internal data. Missing values in the input array are set to default values.
Parameters:
naxes - the maximum number of axes this transform can operate on
refpos - the position in the "input" system (the system forward() transforms from) that is equal to the the refval position. Default equals 0.
refval - the position in the "output" system (the system forward() transforms to) that is equal to the the refpos position. Default equals 0.
offset - An extra offset that gets added to the reference position. Default equals 0;
stepsize - the size of a voxel of the "output" system (the system that forward() transforms to) in units of the "input" system
 o LinearCoordTransform
  public LinearCoordTransform(int naxes,
                              double refpos[],
                              double refval[],
                              double offset[],
                              double stepsize[],
                              String names[])
create a LinearCoordTransform object specifying all internal data. Missing values in the input array are set to default values.
Parameters:
naxes - the maximum number of axes this transform can operate on
refpos - the position in the "input" system (the system forward() transforms from) that is equal to the the refval position. Default equals 0.
refval - the position in the "output" system (the system forward() transforms to) that is equal to the the refpos position. Default equals 0.
offset - An extra offset that gets added to the reference position. Default equals 0;
stepsize - the size of a voxel of the "output" system (the system that forward() transforms to) in units of the "input" system
names - names to assign to transformed axes. A null element of null array means do not reassign name. These values only affect the behavior of getMetadata();
 o LinearCoordTransform
  public LinearCoordTransform(Metadata md) throws IllegalTransformException
create a linear transform based on the specified metadata using the horizon schema.

Methods

 o forward
  public synchronized double[] forward(double position[],
                                       int axisIndices[])
apply a forward tranform on an input position.
Parameters:
position - an array giving the input position to transform
axisIndices - an array containing the indices of the position array that should be used in the tranformation. The order of the indices indicate how the position should be interpreted by the transform.
Overrides:
forward in class CoordTransform
 o forward
  public synchronized double[] forward(double position[])
apply a forward tranform on an input position.
Parameters:
position - an array giving the input position to transform
Overrides:
forward in class CoordTransform
 o reverse
  public synchronized double[] reverse(double position[],
                                       int axisIndices[])
apply a reverse tranform on an input position
Parameters:
position - an array giving the input position to transform
axisIndices - an array containing the indices of the position array that should be used in the tranformation. The order of the indices indicate how the position should be interpreted by the transform.
Overrides:
reverse in class CoordTransform
 o reverse
  public synchronized double[] reverse(double position[])
apply a reverse tranform on an input position. A list of axis indices is assumed (usually { 0, ... getOutNAxes()-1 }).
Parameters:
position - an array giving the input position to transform
Overrides:
reverse in class CoordTransform
 o getInNaxes
  public int getInNaxes()
return the minimum number of axes that the forward transform operates on. This value is equal to the minimum number of axes that results from the reverse transform. This value is often equal to the that returned by getOutNaxes(), but is not required to.
Overrides:
getInNaxes in class CoordTransform
 o getOutNaxes
  public int getOutNaxes()
return the minimum number of axes that results from the forward transform. This value is equal to the minimum number of axes that the reverse transform operates on. This value is often equal to the that returned by getInNaxes(), but is not required to.
Overrides:
getOutNaxes in class CoordTransform
 o getMaxNaxes
  public int getMaxNaxes()
return the maximum number of axes this transform operates on
 o setMaxNaxes
  public synchronized void setMaxNaxes(int naxes) throws ArrayIndexOutOfBoundsException
set the maximum number of axes this transform operates on
 o setRefvalue
  public synchronized void setRefvalue(int axis,
                                       double in) throws ArrayIndexOutOfBoundsException
set the axis reference value for the specified axis. The reference value is position along a world coordinate axis that corresponds to the data location given by the "refposition" metadatum.
Parameters:
axis - the index of the axis to be set (first axis has index 0)
in - value to be set
 o getRefvalue
  public synchronized double getRefvalue(int axis) throws ArrayIndexOutOfBoundsException
return the axis reference value for the specified axis. The reference value is position along a world coordinate axis that corresponds to the data location given by the "refposition" metadatum.
Parameters:
axis - the index of the axis to be set (first axis has index 0)
 o setRefvalue
  public synchronized void setRefvalue(double in[])
set the axis reference value for each axis. The reference value is position along a world coordinate axis that corresponds to the data location given by the "refposition" metadatum.
Parameters:
in - values to be set; missing or extra values are ignored
 o getRefvalue
  public synchronized double[] getRefvalue()
return a copy of the axis reference values for all axes. The reference value is position along a world coordinate axis that corresponds to the data location given by the "refposition" metadatum.
 o setRefposition
  public synchronized void setRefposition(int axis,
                                          double in) throws ArrayIndexOutOfBoundsException
set the axis reference position the specified axis. The reference position is position along a data set axis that corresponds to the world coordinate position given by the "refvalue" metadatum.
Parameters:
axis - the index of the axis to be set (first axis has index 0)
in - value to be set
 o getRefposition
  public synchronized double getRefposition(int axis) throws ArrayIndexOutOfBoundsException
return the axis reference position for the specified axis. The reference position is position along a data set axis that corresponds to the world coordinate position given by the "refvalue" metadatum.
Parameters:
axis - the index of the axis to be set (first axis has index 0)
 o setRefposition
  public synchronized void setRefposition(double in[])
set the axis reference position for each axis. The reference position is position along a data set axis that corresponds to the world coordinate position given by the "refvalue" metadatum.
Parameters:
in - values to be set
 o getRefposition
  public synchronized double[] getRefposition() throws ArrayIndexOutOfBoundsException
return the axis reference position for all the axes. The reference position is position along a data set axis that corresponds to the world coordinate position given by the "refvalue" metadatum.
 o setStepsize
  public synchronized void setStepsize(int axis,
                                       double in) throws ArrayIndexOutOfBoundsException
set the axis step size for the specified axis. The step size is length of a voxel along an axis in world coordinate units.
Parameters:
axis - the index of the axis to be set (first axis has index 0)
in - value to be set
 o getStepsize
  public synchronized double getStepsize(int axis) throws ArrayIndexOutOfBoundsException
return the axis step size for the specified axis. The step size is length of a voxel along an axis in world coordinate units.
Parameters:
axis - the index of the axis to get (first axis has index 0)
 o setStepsize
  public synchronized void setStepsize(double in[])
set the axis step size for each axis. The step size is length of a voxel along an axis in world coordinate units.
Parameters:
in - values to be set
 o getStepsize
  public synchronized double[] getStepsize() throws ArrayIndexOutOfBoundsException
return the axis step size for each axis. The step size is length of a voxel along an axis in world coordinate units.
Parameters:
axis - the index of the axis to be set (first axis has index 0)
in - value to be set
 o setRefoffset
  public synchronized void setRefoffset(int axis,
                                        double in) throws ArrayIndexOutOfBoundsException
set the axis reference offset for the specified axis. An offset equal to zero indicates that the reference position refers to the center of the reference voxel. -0.5 indicates that the position corresponds to the beginning of the voxel; +0.5, the end. If the reference voxel assumes that the first voxel has an index of 1, an extra 1 should be subtracted from the reference offset.
Parameters:
axis - the index of the axis to be set (first axis has index 0)
in - value to be set
 o getRefoffset
  public synchronized double getRefoffset(int axis) throws ArrayIndexOutOfBoundsException
return the axis reference offset for the specified axis.
Parameters:
axis - the index of the axis to be set (first axis has index 0)
 o setRefoffset
  public synchronized void setRefoffset(double in[])
set the axis reference offset for each axis. An offset equal to zero indicates that the reference position refers to the center of the reference voxel. -0.5 indicates that the position corresponds to the beginning of the voxel; +0.5, the end. If the reference voxel assumes that the first voxel has an index of 1, an extra 1 should be subtracted from the reference offset.
Parameters:
in - values to be set
 o getRefoffset
  public synchronized double[] getRefoffset() throws ArrayIndexOutOfBoundsException
return the axis reference offset for each axis.
 o setName
  public synchronized void setName(int axis,
                                   String in) throws ArrayIndexOutOfBoundsException
set the axis name to be given to a transformed axis. Note that this name is only used by the getMetadatum() method and is applied regardless of the value of the forward argument to that method.
Parameters:
axis - the index of the axis to be set (first axis has index 0)
in - the name to give to the axis, null means use the name of the untransformed axis
 o getName
  public synchronized String getName(int axis) throws ArrayIndexOutOfBoundsException
return the axis name to be given to a transformed axis, or null if the name is not updated by getMetadata().
Parameters:
axis - the index of the axis (first axis has index 0)
 o setName
  public synchronized void setName(String in[])
set the axis names to be given to each transformed axis. Note that these names are only used by the getMetadatum() method and are applied regardless of the value of the forward argument to that method.
Parameters:
in - values to be set
 o getName
  public synchronized String[] getName() throws ArrayIndexOutOfBoundsException
return the axis name to be given to a transformed axis. Null values in the output array indicate that the name for that axis will not be updated by getMetadata().
 o clone
  public synchronized Object clone()
create a copy of this Transform
Overrides:
clone in class CoordTransform
 o getMetadata
  public synchronized Metadata getMetadata(Metadata in,
                                           boolean forward,
                                           int axisIndices[])
update the input Metadata object to reflect the changes that this tranform makes to a coordinate position. In general, this method will actually edit the contents of the input Metadata when changes are necessary.
Overrides:
getMetadata in class CoordTransform

All Packages  Class Hierarchy  This Package  Previous  Next  Index