Class ncsa.horizon.util.Segment
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ncsa.horizon.util.Segment

java.lang.Object
   |
   +----ncsa.horizon.util.Volume
           |
           +----ncsa.horizon.util.Segment

public class Segment
extends Volume
a Volume in which all but one of the sides have unit lengths. See also Voxel, Volume, and Slice.

Variable Index

 o longaxis

Constructor Index

 o Segment(int)
create a Segment object of unit size and nax dimensions; the first axis is assumed to be the long axis.
 o Segment(int, int, int)
create a Segment object
 o Segment(Segment, int)
create a Segment object that is a copy of another Segment but has the specified index for the first axis.
 o Segment(Volume, int)
create a Segment object from a Volume
 o Segment(Voxel, double, int)
create a Segment object located at a given Voxel and of given dimensions.

Method Index

 o add(Volume)
expand this slice to include the projection of a Volume onto the slice plane
 o add(Voxel)
expand this slice to include the projection of a Voxel onto the slice plane
 o clone()
create a deep copy of this object
 o getLongAxis()
return the currently set x axis in the convention defined when this object was constructed.
 o grow(double)
increase the lengths of the x and y axes by the given amounts
 o grow(Voxel)
increase the area of this slice by the projected distance of a Voxel projected onto this slice plane from its origin.
 o isSegment(Volume)
return true if no more than one side have unit length
 o projection(Volume)
return a Segment that is a projection of a Volume onto the plane of this segment.
 o setLength(double)
set the length of the long axis
 o setLength(int, double)
set the length of a side of the volume; the request is ignored unless the requested side is the currently set long axis.
 o setLongAxis(int)
set the long axis to be the given integer, indicating that this axis can be have a length larger than one.
 o setLongAxisSampling(double)
set the sampling along the long axis
 o setSize(double[], int)
set the length of each side of the volume; the input lengths are ignored except for the one currently tagged as the long axis.

Variables

 o longaxis
  protected int longaxis

Constructors

 o Segment
  public Segment(int nax,
                 int firstAxisIndex,
                 int longaxis) throws ArrayIndexOutOfBoundsException
create a Segment object
Parameters:
nax - number of axes in the space in which it exists
firstAxisIndex - index of the first axis (can be <, =, or > 0)
longaxis - axis to be considered the long axis, using the indexing convention defined by firstAxisIndex
Throws: ArrayIndexOutOfBoundsException
thrown if nax < 0 or if longaxis is outside of range [firstAxisIndex, firstAxisIndex + nax]
 o Segment
  public Segment(int nax)
create a Segment object of unit size and nax dimensions; the first axis is assumed to be the long axis. The index of the first axis will be zero.
Throws: ArrayIndexOutOfBoundsException
thrown if nax < 0
 o Segment
  public Segment(Voxel vox,
                 double len,
                 int longaxis) throws ArrayIndexOutOfBoundsException
create a Segment object located at a given Voxel and of given dimensions. The index of the first axis for the new Segment will be the same as that of the input Voxel.
Parameters:
vox - location of volume vertex closest to origin of space
len - length of Segment along its long axis
Throws: ArrayIndexOutOfBoundsException
thrown if longaxis is outside of range [firstAxisIndex, firstAxisIndex + nax]
 o Segment
  public Segment(Volume vol,
                 int longaxis) throws ArrayIndexOutOfBoundsException
create a Segment object from a Volume
Parameters:
vol - volume to segment
longaxis - axis index of x-axis (using convention defined by vol);
Throws: ArrayIndexOutOfBoundsException
thrown if xaxis or yaxis is outside of range [firstAxisIndex, firstAxisIndex + nax]
 o Segment
  public Segment(Segment seg,
                 int firstAxisIndex)
create a Segment object that is a copy of another Segment but has the specified index for the first axis.

Methods

 o setLongAxis
  public void setLongAxis(int i)
set the long axis to be the given integer, indicating that this axis can be have a length larger than one.
Parameters:
i - index of axis using the numbering convention defined when this object was created.
Throws: ArrayIndexOutOfBoundsException
if i - firstaxis < the number of axes
 o getLongAxis
  public int getLongAxis()
return the currently set x axis in the convention defined when this object was constructed.
 o setSize
  public void setSize(double newsz[],
                      int firstaxis) throws ArrayIndexOutOfBoundsException
set the length of each side of the volume; the input lengths are ignored except for the one currently tagged as the long axis.
Parameters:
newsz - array of doubles containing position values
firstaxis - index at which first value appears in newpos
Throws: ArrayIndexOutOfBoundsException
if firstaxis < 0
Overrides:
setSize in class Volume
 o setLength
  public void setLength(int i,
                        double sz) throws ArrayIndexOutOfBoundsException
set the length of a side of the volume; the request is ignored unless the requested side is the currently set long axis.
Parameters:
i - the index of the axis to be set
sz - the length to set the side to
Throws: ArrayIndexOutOfBoundsException
if firstaxis < 0
Overrides:
setLength in class Volume
 o setLength
  public void setLength(double l)
set the length of the long axis
 o setLongAxisSampling
  public void setLongAxisSampling(double l)
set the sampling along the long axis
 o isSegment
  public static boolean isSegment(Volume vol)
return true if no more than one side have unit length
 o add
  public void add(Voxel vox)
expand this slice to include the projection of a Voxel onto the slice plane
Overrides:
add in class Volume
 o add
  public void add(Volume vol)
expand this slice to include the projection of a Volume onto the slice plane
Overrides:
add in class Volume
 o grow
  public void grow(Voxel vox)
increase the area of this slice by the projected distance of a Voxel projected onto this slice plane from its origin.
Overrides:
grow in class Volume
 o grow
  public void grow(double sz)
increase the lengths of the x and y axes by the given amounts
 o projection
  public Segment projection(Volume vol)
return a Segment that is a projection of a Volume onto the plane of this segment. The sampling will be that of this Segment.
 o clone
  public Object clone()
create a deep copy of this object
Overrides:
clone in class Volume

All Packages  Class Hierarchy  This Package  Previous  Next  Index