| Overview | Package | Class | Tree | Deprecated | Index | Help | |||
| PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||
java.lang.Object
|
+--ncsa.horizon.util.Volume
|
+--ncsa.horizon.util.AdjustableVolume
This class provides methods for changing the volumes position, size, sampling, and axis order. Only the number of axes in the space in which this Volume lives is immutable, being set at construction.
| Inner classes inherited from class ncsa.horizon.util.Volume | |
| Volume.IndexOrder | |
| Fields inherited from class ncsa.horizon.util.Volume | |
| CAN_EXTRAPOLATE, CAN_INTERPOLATE, flags, loc, naxes, NONE, order, sample, size | |
| Constructor Summary | |
| AdjustableVolume(int nax)
create a Volume object in a space of nax dimensions and initialize it to have a unit size with a sampling of 1 along each axis. |
|
| AdjustableVolume(int nax,
int[] ori,
int[] sz,
int[] sam)
create a Volume object in a space of nax dimensions and initialize it to a given location, size, and sampling for each axis. |
|
| AdjustableVolume(int nax,
double[] ori,
double[] sz,
double[] sam)
create a Volume object in a space of nax dimensions and initialize it to a given location, size, and sampling for each axis. |
|
| AdjustableVolume(Volume in)
create a Volume object that is a copy of another Volume. |
|
| AdjustableVolume(Voxel in)
create a Volume object of unit size (and unit sampling) whose origin vertex is located at the given voxel. |
|
| Method Summary | |
| void | expandTo(Voxel vox)
expand this Volume just enough to include a given Voxel. |
| void | expandTo(Volume that)
compute the union of this volume with another. |
| double[] | getExactOrigin()
return the exact origin of this Volume represented as an array of doubles. |
| double | getExactOrigin(int axis)
return the exact origin of this Volume along a given axis. |
| java.util.Observable | getMonitor()
return an Observable monitor for listening for changes to this Volume. |
| int[] | getOrigin()
return the origin of this Volume (rounded to the nearest integer) represented as an array of integers. |
| int | getOrigin(int axis)
return the origin of this Volume (rounded to the nearest integer) along a given axis. |
| int[] | getRoundedStride()
return an array of ints representing the sampling of the data space along each side, rounded to the nearest integer. |
| int[] | getSize()
return the size of the largest volume with lengths of integer length enclosed by this volume. |
| int | getSize(int axis)
return the largest integer length that is less than or equal to the length of one side of this volume. |
| double[] | getStride()
return an array of doubles representing the sampling of the data space along each side. |
| double | getStride(int i)
return the sampling of the data space along a given side. |
| void | grow(Voxel vox)
increase the size of each side by the projected distance of a Voxel from its origin along each corresponding axis. |
| void | grow(int[] pos)
increase the size of each side by the projected distance of a position from its origin along each corresponding axis. |
| void | grow(double[] pos)
increase the size of each side by the projected distance of a position from its origin along each corresponding axis. |
| boolean | isMutable()
return true if the paramters of this Volume can change. |
| void | resetAxisOrder()
reset the axis order to their natural order; i.e. { |
| void | reverseAxes()
reverse the axis order. |
| void | setAxisOrder(int[] axorder)
set the axis order. |
| void | setOrigin(int[] pos)
set the origin of this Volume to a position given by an array of integers. |
| void | setOrigin(int idx,
int pos)
set one component of the origin of this Volume to a given position along a given axis |
| void | setOrigin(double[] pos)
set the origin of this Volume to a fractional position given by an array of integers. |
| void | setOrigin(int idx,
double pos)
set one component of the origin of this Volume to a given position along a given axis |
| void | setOrigin(Voxel vox)
set the origin of this volume to the position of a given Voxel |
| void | setSize(int[] sz)
set the size of this volume to the lengths given in an integer array |
| void | setSize(int idx,
int sz)
set the length of this volume along one axis to a given integer value |
| void | setSize(double[] sz)
set the size of this volume to the fractional lengths given in an array of doubles |
| void | setSize(int idx,
double sz)
set the length of this volume along one axis to a given fractional value |
| void | setStride(double[] sam)
set the sampling rate along each axis of the volume |
| void | setStride(int idx,
double sam)
return the sampling of the data space along a given side. |
| void | setStride(int[] sam)
set the sampling rate along each axis of the volume |
| void | setStride(int idx,
int sam)
return the sampling of the data space along a given side. |
| void | shiftAxes(int n)
shift the axis order forward n steps. |
| void | swapAxes(int axisA,
int axisB)
swap two axes |
| void | translate(Voxel vox)
move this Volume to a relative position |
| void | translate(int[] pos)
move this Volume to a relative position |
| void | translate(double[] pos)
move this Volume to a relative position |
| void | unshiftAxes(int n)
shift the axis order backward n steps. |
| void | untranslate(Voxel vox)
move this Volume to a relative position, in the opposite sense as is done by translate(). |
| void | untranslate(int[] pos)
move this Volume to a relative position, in the opposite sense as is done by translate(). |
| void | untranslate(double[] pos)
move this Volume to a relative position, in the opposite sense as is done by translate(). |
| Methods inherited from class ncsa.horizon.util.Volume | |
| axisPos, clone, doubleToInt, equals, getAxisOrder, getExactOrigin, getExactOrigin, getExactSize, getExactSize, getFlags, getLength, getLocation, getLocation, getMonitor, getNaxes, getOrigin, getOrigin, getRoundedStride, getRoundedStride, getSampledCount, getSampledSize, getSampledSize, getSampling, getSampling, getSize, getSize, getStep, getStride, getStride, getTrueLength, getTrueSize, getTrueSize, getVoxel, hashCode, includes, includes, includes, includes, intersection, intersects, intToDouble, isEmpty, isInNaturalAxisOrder, isMutable, isSamplingFully, isSamplingPositively, isSamplingWholly, makeLengthsPositive, projection, reorder, reorder, reorder, roundDoubleToInt, samples, sampleWholly, toString, union, union | |
| Methods inherited from class java.lang.Object | |
| clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait | |
| Constructor Detail |
public AdjustableVolume(int nax)
throws ValueOutOfBoundsException
nax
- number of axes or dimensions in the space
public AdjustableVolume(int nax,
int[] ori,
int[] sz,
int[] sam)
throws java.lang.ArrayIndexOutOfBoundsException
nax
- number of axes or dimensions in the space
ori
- location of volume vertex (default: zero-origin)
sz
- length of each side (default: one)
sam
- sampling along each side (default: one)
public AdjustableVolume(int nax,
double[] ori,
double[] sz,
double[] sam)
throws ValueOutOfBoundsException,
PositionOutOfBoundsException
nax
- number of axes or dimensions in the space
ori
- location of volume vertex (default: origin)
sz
- length of each side (default: one)
sam
- sampling along each side (default: one)public AdjustableVolume(Volume in)
public AdjustableVolume(Voxel in)
| Method Detail |
public boolean isMutable()
public java.util.Observable getMonitor()
public void setOrigin(int[] pos)
public void setOrigin(int idx,
int pos)
public void setOrigin(double[] pos)
throws PositionOutOfBoundsException
public void setOrigin(int idx,
double pos)
throws PositionOutOfBoundsException
public void setOrigin(Voxel vox)
public void setSize(int[] sz)
public void setSize(int idx,
int sz)
public void setSize(double[] sz)
throws PositionOutOfBoundsException
public void setSize(int idx,
double sz)
throws PositionOutOfBoundsException
public void setStride(double[] sam)
public void setStride(int idx,
double sam)
throws PositionOutOfBoundsException
public void setStride(int[] sam)
public void setStride(int idx,
int sam)
throws PositionOutOfBoundsException
public void setAxisOrder(int[] axorder)
throws java.lang.IllegalArgumentException,
java.lang.ArrayIndexOutOfBoundsException
int[]
- the axis order as an array of the axis indices. Each
index should appear only once. Missing axes will be
appended in numerical order; extra axes are ignored.public void resetAxisOrder()
public void swapAxes(int axisA,
int axisB)
public void shiftAxes(int n)
public void unshiftAxes(int n)
public void reverseAxes()
public void translate(Voxel vox)
vox
- the relative position to add to this volume's origin; only
dimensions that overlap this space will be added.public void translate(int[] pos)
vox
- the relative position to add to this volume's origin; only
dimensions that overlap this space will be added.public void translate(double[] pos)
vox
- the relative position to add to this volume's origin; only
dimensions that overlap this space will be added.public void untranslate(Voxel vox)
vox
- the relative position to subtract to this volume's position;
only dimensions that overlap this space will be added.public void untranslate(int[] pos)
vox
- the relative position to subtract to this volume's position;
only dimensions that overlap this space will be added.public void untranslate(double[] pos)
vox
- the relative position to subtract to this volume's position;
only dimensions that overlap this space will be added.public void expandTo(Voxel vox)
public void expandTo(Volume that)
public void grow(Voxel vox)
public void grow(int[] pos)
public void grow(double[] pos)
public final int[] getOrigin()
public final int getOrigin(int axis)
public final double[] getExactOrigin()
public final double getExactOrigin(int axis)
public final int[] getSize()
public final int getSize(int axis)
public final double[] getStride()
public final double getStride(int i)
public final int[] getRoundedStride()
| Overview | Package | Class | Tree | Deprecated | Index | Help | |||
| PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||