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.
-
name
-
-
nop
-
-
offset
-
-
refpos
-
-
refval
-
-
stepsize
-
-
LinearCoordTransform()
- create a LinearCoordTransform object with default values.
-
LinearCoordTransform(int)
- create a LinearCoordTransform object with default values.
-
LinearCoordTransform(int, double[], double[], double[], double[])
- create a LinearCoordTransform object specifying all internal
data.
-
LinearCoordTransform(int, double[], double[], double[], double[], String[])
- create a LinearCoordTransform object specifying all internal
data.
-
LinearCoordTransform(Metadata)
-
create a linear transform based on the specified metadata using the
horizon schema.
-
clone()
- create a copy of this Transform
-
forward(double[])
- apply a forward tranform on an input position.
-
forward(double[], int[])
- apply a forward tranform on an input position.
-
getInNaxes()
- return the minimum number of axes that the forward transform operates
on.
-
getMaxNaxes()
- return the maximum number of axes this transform operates on
-
getMetadata(Metadata, boolean, int[])
- update the input Metadata object to reflect the changes that this
tranform makes to a coordinate position.
-
getName()
- return the axis name to be given to a transformed axis.
-
getName(int)
- return the axis name to be given to a transformed axis, or null
if the name is not updated by getMetadata().
-
getOutNaxes()
- return the minimum number of axes that results from the forward
transform.
-
getRefoffset()
- return the axis reference offset for each axis.
-
getRefoffset(int)
- return the axis reference offset for the specified axis.
-
getRefposition()
- return the axis reference position for all the axes.
-
getRefposition(int)
- return the axis reference position for the specified axis.
-
getRefvalue()
- return a copy of the axis reference values for all axes.
-
getRefvalue(int)
- return the axis reference value for the specified axis.
-
getStepsize()
- return the axis step size for each axis.
-
getStepsize(int)
- return the axis step size for the specified axis.
-
reverse(double[])
- apply a reverse tranform on an input position.
-
reverse(double[], int[])
- apply a reverse tranform on an input position
-
setMaxNaxes(int)
- set the maximum number of axes this transform operates on
-
setName(int, String)
- set the axis name to be given to a transformed axis.
-
setName(String[])
- set the axis names to be given to each transformed axis.
-
setRefoffset(double[])
- set the axis reference offset for each axis.
-
setRefoffset(int, double)
- set the axis reference offset for the specified axis.
-
setRefposition(double[])
- set the axis reference position for each axis.
-
setRefposition(int, double)
- set the axis reference position the specified axis.
-
setRefvalue(double[])
- set the axis reference value for each axis.
-
setRefvalue(int, double)
- set the axis reference value for the specified axis.
-
setStepsize(double[])
- set the axis step size for each axis.
-
setStepsize(int, double)
- set the axis step size for the specified axis.
nop
protected int nop
refpos
protected double refpos[]
refval
protected double refval[]
offset
protected double offset[]
stepsize
protected double stepsize[]
name
protected String name[]
LinearCoordTransform
public LinearCoordTransform(int naxes)
- create a LinearCoordTransform object with default values.
- Parameters:
- naxes - the maximum number of axes this transform can
operate on
LinearCoordTransform
public LinearCoordTransform()
- create a LinearCoordTransform object with default values.
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
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();
LinearCoordTransform
public LinearCoordTransform(Metadata md) throws IllegalTransformException
- create a linear transform based on the specified metadata using the
horizon schema.
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
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
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
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
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
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
getMaxNaxes
public int getMaxNaxes()
- return the maximum number of axes this transform operates on
setMaxNaxes
public synchronized void setMaxNaxes(int naxes) throws ArrayIndexOutOfBoundsException
- set the maximum number of axes this transform operates on
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
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)
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
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.
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
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)
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
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.
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
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)
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
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
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
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)
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
getRefoffset
public synchronized double[] getRefoffset() throws ArrayIndexOutOfBoundsException
- return the axis reference offset for each axis.
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
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)
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
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().
clone
public synchronized Object clone()
- create a copy of this Transform
- Overrides:
- clone in class CoordTransform
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