Package inra.ijpb.data
Class VoxelRecord
java.lang.Object
inra.ijpb.data.VoxelRecord
- All Implemented Interfaces:
java.lang.Comparable<VoxelRecord>
public class VoxelRecord extends java.lang.Object implements java.lang.Comparable<VoxelRecord>
Class to store integer voxel coordinates and its
corresponding double value
- Author:
- Ignacio Arganda-Carreras
-
Constructor Summary
Constructors Constructor Description VoxelRecord(int x, int y, int z, double value)
Creates a voxel record from a position and a double value.VoxelRecord(Cursor3D cursor, double value)
Creates a voxel record from a cursor and a double value. -
Method Summary
Modifier and Type Method Description int
compareTo(VoxelRecord v2)
Compare with a voxel record based on its value and timestampdouble
euclideanDistance(VoxelRecord vr)
Calculate Euclidean distance to another voxel recordCursor3D
getCursor()
double
getValue()
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
VoxelRecord
Creates a voxel record from a cursor and a double value.- Parameters:
cursor
- the position of the recordvalue
- voxel intensity value
-
VoxelRecord
public VoxelRecord(int x, int y, int z, double value)Creates a voxel record from a position and a double value.- Parameters:
x
- the x-position of the recordy
- the y-position of the recordz
- the z-position of the recordvalue
- voxel intensity value
-
-
Method Details
-
getCursor
- Returns:
- the position of this VoxelRecord, as a Cursor3D.
-
getValue
public double getValue()- Returns:
- the value stored by this VoxelRecord.
-
compareTo
Compare with a voxel record based on its value and timestamp- Specified by:
compareTo
in interfacejava.lang.Comparable<VoxelRecord>
- Parameters:
v2
- voxel record to compare with- Returns:
- a value smaller than 0 if the v2 voxel value is larger this record voxel value, a value larger than 0 if it is lower. If equal, the records created before are set as smaller.
-
euclideanDistance
Calculate Euclidean distance to another voxel record- Parameters:
vr
- voxel record to calculate distance to- Returns:
- Euclidean distance between this voxel record and the input one
-