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

Class ncsa.horizon.util.Slice

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

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

Variable Index

 o xaxis
 o yaxis

Constructor Index

 o Slice(int)
create a Slice object of unit size and nax dimensions; the first two axes are assumed to be the ones defining the slice plane.
 o Slice(int, int, int, int)
create a Slice object in which all the lengths of all sides have a length of one.
 o Slice(Slice, int)
create a Slice object from another Slice but with the specified index for the first axis.
 o Slice(Volume)
create a Slice object from a Volume.
 o Slice(Volume, int)
create a Slice object from a Volume.
 o Slice(Volume, int, int)
create a Slice object from a Volume
 o Slice(Voxel, Dimension, int, int)
create a Slice 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 getXaxis()
return the currently set x axis in the convention defined when this object was constructed.
 o getYaxis()
return the currently set ordinate (x) axis in the convention defined when this object was constructed.
 o grow(double, 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 isSlice(Volume)
return true if no more than two sides of a Volume have unit length
 o projection(Volume)
return a Slice that is a projection of a Volume onto the plane of this slice.
 o projection(Voxel)
return a Voxel that is a projection of a given Voxel onto the plane of this slice.
 o setArea(double, double)
set the length of the currently selected x and y axes
 o setLength(int, double)
set the length of a side of the volume; the request is ignored unless the requested side is either the currently set x or y axis.
 o setSize(double[], int)
set the length of each side of the volume; the input lengths are ignored except for those currently tagged as the x and y axes.
 o setXaxis(int)
set the x axis to be the given integer, indicating that this axis can be have a length larger than one.
 o setXaxisLength(double)
set the length of the x axis
 o setXaxisLocation(double)
set the position of the Slice along the x axis
 o setXaxisSampling(double)
set the sampling along the x axis
 o setYaxis(int)
set the ordinate (y-) axis to be the given integer, indicating that this axis can be have a length larger than one.
 o setYaxisLength(double)
set the length of the ordinate (y) axis
 o setYaxisLocation(double)
set the position of the Slice along the y axis
 o setYaxisSampling(double)
set the sampling along the ordinate (y) axis

Variables

 o xaxis
  protected int xaxis
 o yaxis
  protected int yaxis

Constructors

 o Slice
  public Slice(int nax,
               int firstAxisIndex,
               int xaxis,
               int yaxis) throws ArrayIndexOutOfBoundsException
create a Slice object in which all the lengths of all sides have a length of one.
Parameters:
nax - number of axes in the space in which it exists
firstAxisIndex - index of the first axis (can be <, =, or > 0)
xaxis - axis to be considered the x axis, using the indexing convention defined by firstAxisIndex
yaxis - axis to be considered the y axis, using the indexing convention defined by firstAxisIndex
Throws: ArrayIndexOutOfBoundsException
thrown if nax < 0 or if xaxis or yaxis is outside of range [firstAxisIndex, firstAxisIndex + nax]
 o Slice
  public Slice(int nax)
create a Slice object of unit size and nax dimensions; the first two axes are assumed to be the ones defining the slice plane. The index of the first axis will be zero.
Throws: ArrayIndexOutOfBoundsException
thrown if nax < 0
 o Slice
  public Slice(Voxel vox,
               Dimension dim,
               int xaxis,
               int yaxis) throws ArrayIndexOutOfBoundsException
create a Slice object located at a given Voxel and of given dimensions
Parameters:
vox - location of slice vertex closest to origin of space
dim - dimension of slice in x and y directions
xaxis - axis index of x-axis (using convention defined by vox);
yaxis - axis index of y-axis (using convention defined by vox);
Throws: ArrayIndexOutOfBoundsException
thrown if xaxis or yaxis is outside of range [firstAxisIndex, firstAxisIndex + nax]
 o Slice
  public Slice(Volume vol,
               int xaxis,
               int yaxis) throws ArrayIndexOutOfBoundsException
create a Slice object from a Volume
Parameters:
vol - volume to slice
xaxis - axis index of x-axis (using convention defined by vol);
yaxis - axis index of y-axis (using convention defined by vol);
Throws: ArrayIndexOutOfBoundsException
thrown if xaxis or yaxis is outside of range [firstAxisIndex, firstAxisIndex + nax]
 o Slice
  public Slice(Volume vol,
               int firstAxisIndex)
create a Slice object from a Volume. The x and y axes will be set to the first two non-unit length axes in the volume. If only one axis is non-unit in length, the y axis will be the one after it; if no non-unit axes are found, the first two axes will be made the x and y axes.
Parameters:
vol - the input volume
firstAxisIndex - the index to be given to the first Axis in the new Slice
 o Slice
  public Slice(Volume vol)
create a Slice object from a Volume. The x and y axes will be set to the first two non-unit length axes in the volume. If only one axis is non-unit in length, the y axis will be the one after it; if no non-unit axes are found, the first two axes will be made the x and y axes.
Parameters:
vol - the input volume
 o Slice
  public Slice(Slice sl,
               int firstAxisIndex)
create a Slice object from another Slice but with the specified index for the first axis.
Parameters:
sl - the input sl
firstAxisIndex - the index to be given to the first Axis in the new Slice

Methods

 o isSlice
  public static boolean isSlice(Volume vol)
return true if no more than two sides of a Volume have unit length
 o setXaxis
  public void setXaxis(int i)
set the x 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 setYaxis
  public void setYaxis(int i)
set the ordinate (y-) 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 getXaxis
  public int getXaxis()
return the currently set x axis in the convention defined when this object was constructed.
 o getYaxis
  public int getYaxis()
return the currently set ordinate (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 those currently tagged as the x and y axes.
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 either the currently set x or y 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 setXaxisLocation
  public void setXaxisLocation(double l)
set the position of the Slice along the x axis
 o setYaxisLocation
  public void setYaxisLocation(double l)
set the position of the Slice along the y axis
 o setXaxisLength
  public void setXaxisLength(double l)
set the length of the x axis
 o setYaxisLength
  public void setYaxisLength(double l)
set the length of the ordinate (y) axis
 o setArea
  public void setArea(double xlen,
                      double ylen)
set the length of the currently selected x and y axes
 o setXaxisSampling
  public void setXaxisSampling(double l)
set the sampling along the x axis
 o setYaxisSampling
  public void setYaxisSampling(double l)
set the sampling along the ordinate (y) axis
 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 xsize,
                   double ysize)
increase the lengths of the x and y axes by the given amounts
 o projection
  public Slice projection(Volume vol)
return a Slice that is a projection of a Volume onto the plane of this slice. The sampling and indexing convention will be that of the input Volume.
 o projection
  public Voxel projection(Voxel vox)
return a Voxel that is a projection of a given Voxel onto the plane of this slice. The indexing convention will be that of the input Voxel
 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