Package com.xinapse.multisliceimage.roi
Class StatsComparator
java.lang.Object
com.xinapse.multisliceimage.roi.StatsComparator
- All Implemented Interfaces:
Serializable
,Comparator<ROI>
A Comparator used in sorting operations for ROIs based on their statistics.
- See Also:
-
Constructor Summary
ConstructorDescriptionStatsComparator
(StatsType statsType, Object pix, PixelDataType dataType, int nCols, int nRows, float pixelXSize, float pixelYSize, ComplexMode complexMode) Create a new StatsComparator object, for sorting ROIs using the supplied type of statistic to determine the sort order. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
StatsComparator
public StatsComparator(StatsType statsType, Object pix, PixelDataType dataType, int nCols, int nRows, float pixelXSize, float pixelYSize, ComplexMode complexMode) Create a new StatsComparator object, for sorting ROIs using the supplied type of statistic to determine the sort order.- Parameters:
statsType
- theStatsType
on which to sort.pix
- the image pixel values.dataType
- the PixelDataType of the image pixel values.nCols
- the number of image columns.nRows
- the number of image rows.pixelXSize
- the image pixel width, in mm.pixelYSize
- the image pixel height, in mm.complexMode
- the ComplexMode for complex images.
-
-
Method Details
-
compare
Compares the statistics for two ROIs for order. Returns a negative integer, zero, or a positive integer as the statistic for the first ROI is less than, equal to, or greater than the statistic for the second ROI. The statistic to be compared is determined at instantiation of this Comparator.- Specified by:
compare
in interfaceComparator<ROI>
- Parameters:
roi1
- the first ROI for which to compare statistics.roi2
- the second ROI for which to compare statistics.- Returns:
- a negative integer, zero, or a positive integer as the first ROI's statistic is less than, equal to, or greater than the second.
-