    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.

##

xaxis
yaxis

##

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.
Slice(int, int, int, int)
  create a Slice object in which all the lengths of all sides have a length of one.
Slice(Slice, int)
  create a Slice object from another Slice but with the specified index for the first axis.
Slice(Volume)
  create a Slice object from a Volume.
Slice(Volume, int)
  create a Slice object from a Volume.
Slice(Volume, int, int)
  create a Slice object from a Volume
Slice(Voxel, Dimension, int, int)
  create a Slice object located at a given Voxel and of given dimensions

##

add(Volume)
  expand this slice to include the projection of a Volume onto the slice plane
add(Voxel)
  expand this slice to include the projection of a Voxel onto the slice plane
clone()
  create a deep copy of this object
getXaxis()
  return the currently set x axis in the convention defined when this object was constructed.
getYaxis()
  return the currently set ordinate (x) axis in the convention defined when this object was constructed.
grow(double, double)
  increase the lengths of the x and y axes by the given amounts
grow(Voxel)
  increase the area of this slice by the projected distance of a Voxel projected onto this slice plane from its origin.
isSlice(Volume)
  return true if no more than two sides of a Volume have unit length
projection(Volume)
  return a Slice that is a projection of a Volume onto the plane of this slice.
projection(Voxel)
  return a Voxel that is a projection of a given Voxel onto the plane of this slice.
setArea(double, double)
  set the length of the currently selected x and y axes
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.
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.
setXaxis(int)
  set the x axis to be the given integer, indicating that this axis can be have a length larger than one.
setXaxisLength(double)
  set the length of the x axis
setXaxisLocation(double)
  set the position of the Slice along the x axis
setXaxisSampling(double)
  set the sampling along the x axis
setYaxis(int)
  set the ordinate (y-) axis to be the given integer, indicating that this axis can be have a length larger than one.
setYaxisLength(double)
  set the length of the ordinate (y) axis
setYaxisLocation(double)
  set the position of the Slice along the y axis
setYaxisSampling(double)
  set the sampling along the ordinate (y) axis

##

xaxis

      protected int xaxis

yaxis

      protected int yaxis

##

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]

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

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]

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]

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

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

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

##

isSlice

      public static boolean isSlice(Volume vol)

  return true if no more than two sides of a Volume have unit length

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

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

getXaxis

      public int getXaxis()

  return the currently set x axis in the convention defined when this object was constructed.

getYaxis

      public int getYaxis()

  return the currently set ordinate (x) axis in the convention defined when this object was constructed.

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

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

setXaxisLocation

      public void setXaxisLocation(double l)

  set the position of the Slice along the x axis

setYaxisLocation

      public void setYaxisLocation(double l)

  set the position of the Slice along the y axis

setXaxisLength

      public void setXaxisLength(double l)

  set the length of the x axis

setYaxisLength

      public void setYaxisLength(double l)

  set the length of the ordinate (y) axis

setArea

      public void setArea(double xlen,
                          double ylen)

  set the length of the currently selected x and y axes

setXaxisSampling

      public void setXaxisSampling(double l)

  set the sampling along the x axis

setYaxisSampling

      public void setYaxisSampling(double l)

  set the sampling along the ordinate (y) axis

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

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

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

grow

      public void grow(double xsize,
                       double ysize)

  increase the lengths of the x and y axes by the given amounts

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.

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

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