    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.

##

longaxis

##

Segment(int)
  create a Segment object of unit size and nax dimensions; the first axis is assumed to be the long axis.
Segment(int, int, int)
  create a Segment object
Segment(Segment, int)
  create a Segment object that is a copy of another Segment but has the specified index for the first axis.
Segment(Volume, int)
  create a Segment object from a Volume
Segment(Voxel, double, int)
  create a Segment 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
getLongAxis()
  return the currently set x axis in the convention defined when this object was constructed.
grow(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.
isSegment(Volume)
  return true if no more than one side have unit length
projection(Volume)
  return a Segment that is a projection of a Volume onto the plane of this segment.
setLength(double)
  set the length of the long axis
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.
setLongAxis(int)
  set the long axis to be the given integer, indicating that this axis can be have a length larger than one.
setLongAxisSampling(double)
  set the sampling along the long axis
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.

##

longaxis

      protected int longaxis

##

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]

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

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]

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]

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.

##

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

getLongAxis

      public int getLongAxis()

  return the currently set 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 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

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

setLength

      public void setLength(double l)

  set the length of the long axis

setLongAxisSampling

      public void setLongAxisSampling(double l)

  set the sampling along the long axis

isSegment

      public static boolean isSegment(Volume vol)

  return true if no more than one side have unit length

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 sz)

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

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.

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