public final class Tract
extends java.lang.Object
Tract
's perform bounds checking as points are added, and increase their
capacity when full.
TractCollection
Constructor and Description |
---|
Tract()
Construct a Tract with a capacity of 100 and a growth factor of 100%.
|
Tract(int initialCapacity,
double growFactor)
Construct a Tract with a specified capacity and growth factor.
|
Modifier and Type | Method and Description |
---|---|
void |
addPoint(Point3D point)
Add a point.
|
void |
addPoint(Point3D point,
double displacement)
Adds a point.
|
void |
chop(int minPointIndex,
int maxPointIndex)
Chop off one or both ends of a tract.
|
boolean |
equals(java.lang.Object o) |
Point3D |
getPoint(int pointNum)
Get a point.
|
Point3D[] |
getPoints() |
double[] |
getVoxelPathLengths(double[] voxelDims)
Divides the streamline into line segments.
|
double[] |
getVoxelPathLengths(double xVoxelDim,
double yVoxelDim,
double zVoxelDim)
Divides the streamline into line segments.
|
int |
hashCode() |
double |
length() |
int |
numberOfPoints() |
double |
pathLengthFromSeed(int index)
Gets the length of the streamline from the seed to point
index . |
Tract |
resample(double stepSize)
Resample the points to a minimum resolution, such that the distance between
points is no more than
stepSize . |
int |
seedPointIndex() |
double[] |
toArray()
Flattens tract into an array.
|
java.lang.String |
toOOGLVECT()
Output as OOGL vector, suitable for display in Geomview.
|
java.lang.String |
toString() |
VoxelList |
toVoxelList(double[] voxelDims)
List of voxel coordinates of the tract.
|
VoxelList |
toVoxelList(double xVoxelDim,
double yVoxelDim,
double zVoxelDim)
List of voxel coordinates of the tract.
|
void |
transform(RealMatrix trans) |
void |
truncateToMaxLength(double maxLength)
Reduce the length of a Tract to the specified maximum length in mm.
|
void |
truncateToMaxPoints(int maxPoints)
Reduce the length of a tract to the specified maximum number of points.
|
void |
writeOOGL_BinaryVECT(java.io.DataOutputStream dout)
Output as a binary OOGL vector, suitable for display in Geomview.
|
void |
writeRaw(java.io.DataOutputStream dout)
Writes tract so that it can be read later by a TractSource.
|
public Tract(int initialCapacity, double growFactor)
initialCapacity
- the initial number of 3D points the Tract can hold.growFactor
- the percentage to increase capacity by when this Tract is full.public Tract()
public void addPoint(Point3D point)
point
- the point to add.public void addPoint(Point3D point, double displacement)
point
- the point to add.displacement
- the displacement of this point from the last.public double pathLengthFromSeed(int index)
index
.public double length()
public int numberOfPoints()
public java.lang.String toOOGLVECT()
public void writeOOGL_BinaryVECT(java.io.DataOutputStream dout) throws java.io.IOException
java.io.IOException
public VoxelList toVoxelList(double[] voxelDims)
public VoxelList toVoxelList(double xVoxelDim, double yVoxelDim, double zVoxelDim)
public java.lang.String toString()
toString
in class java.lang.Object
public Point3D getPoint(int pointNum)
pointNum
- the point index, 0 to (numberOfPoints-1).pointNum
.public Point3D[] getPoints()
public int seedPointIndex()
public Tract resample(double stepSize)
stepSize
.public void truncateToMaxPoints(int maxPoints)
maxPoints
- must be >= 1. If it is greater than the number of points
in this tract, nothing is done.public void truncateToMaxLength(double maxLength)
public void chop(int minPointIndex, int maxPointIndex)
minPointIndex
- an index between 0 and seedPointIndex().maxPointIndex
- an index between seedPointIndex() and numberOfPoints() - 1.public void transform(RealMatrix trans)
public void writeRaw(java.io.DataOutputStream dout) throws java.io.IOException
java.io.IOException
public double[] toArray()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public double[] getVoxelPathLengths(double[] voxelDims)
t.toVoxelList()
.public double[] getVoxelPathLengths(double xVoxelDim, double yVoxelDim, double zVoxelDim)
t.toVoxelList()
.