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 timestamp
    double euclideanDistance​(VoxelRecord vr)
    Calculate Euclidean distance to another voxel record
    Cursor3D getCursor()  
    double getValue()  

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • VoxelRecord

      public VoxelRecord​(Cursor3D cursor, double value)
      Creates a voxel record from a cursor and a double value.
      Parameters:
      cursor - the position of the record
      value - 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 record
      y - the y-position of the record
      z - the z-position of the record
      value - voxel intensity value
  • Method Details

    • getCursor

      public Cursor3D getCursor()
      Returns:
      the position of this VoxelRecord, as a Cursor3D.
    • getValue

      public double getValue()
      Returns:
      the value stored by this VoxelRecord.
    • compareTo

      public int compareTo​(VoxelRecord v2)
      Compare with a voxel record based on its value and timestamp
      Specified by:
      compareTo in interface java.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

      public double euclideanDistance​(VoxelRecord vr)
      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