Package inra.ijpb.data
Class PixelRecord
java.lang.Object
inra.ijpb.data.PixelRecord
- All Implemented Interfaces:
java.lang.Comparable<PixelRecord>
public class PixelRecord extends java.lang.Object implements java.lang.Comparable<PixelRecord>
Class to store integer pixel coordinates and its
corresponding double value
- Author:
- Ignacio Arganda-Carreras
-
Constructor Summary
Constructors Constructor Description PixelRecord(int x, int y, double value)Create pixel record with cursor position and double valuePixelRecord(Cursor2D cursor, double value)Create pixel record with cursor position and double value -
Method Summary
Modifier and Type Method Description intcompareTo(PixelRecord p2)Compare with a pixel record based on its value and timestampdoubleeuclideanDistance(PixelRecord pr)Calculate Euclidean distance to another pixel recordCursor2DgetCursor()doublegetValue()Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
PixelRecord
Create pixel record with cursor position and double value- Parameters:
cursor- pixel position in 2D coordinatesvalue- pixel intensity value
-
PixelRecord
public PixelRecord(int x, int y, double value)Create pixel record with cursor position and double value- Parameters:
x- the x-position of the recordy- the y-position of the recordvalue- pixel intensity value
-
-
Method Details
-
getCursor
- Returns:
- the position of this PixelRecord, as a Cursor2D.
-
getValue
public double getValue()- Returns:
- the value stored by this PixelRecord.
-
compareTo
Compare with a pixel record based on its value and timestamp- Specified by:
compareToin interfacejava.lang.Comparable<PixelRecord>- Parameters:
p2- pixel record to compare with- Returns:
- a value smaller than 0 if the p2 pixel value is larger this pixel record 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 pixel record- Parameters:
pr- pixel record to calculate distance to- Returns:
- Euclidean distance between this pixel record and the input one
-