Package com.xinapse.multisliceimage.roi
Class ROIStats
java.lang.Object
com.xinapse.multisliceimage.roi.ROIStats
A Class containing the statistics that are computed for an ROI.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal doubleThe area of this ROI in square mm.The histogram of pixel intensities inside an ROI in intensity units.final doubleThe maximum pixel intensity inside an ROI in intensity units.final doubleThe mean pixel intensity inside an ROI in intensity units.final doubleThe minimum pixel intensity inside an ROI in intensity units.final doubleThe standard deviation pixel intensity inside an ROI in intensity units.final booleanA flag to indicate that the intensity-based statistics are valid. -
Constructor Summary
ConstructorsConstructorDescriptionROIStats(double area) Creates anROIStatsobject without valid intensity statistics or histogram of intensities but with a valid area statistic.ROIStats(double area, double mean, double stddev, double min, double max) Creates anROIStatsobject with valid intensity and area statistics, but no histogram of intensities.Creates anROIStatsobject with valid intensity and area statistics, and a histogram of intensities.Creates a newROIStatsobject, copying all values from existing ROIStats.Creates a newROIStatsobject, copying all values except the area from existing ROIStats. -
Method Summary
Modifier and TypeMethodDescriptionvoidClears (sets to null) the histogram for these ROIStats.static ROIStatsgetCumulativeStats(List<ROIStats> statsList, PixelDataType dataType) doubleReturns the median pixel intensity.booleanReturns whether this ROIStats has valid intensity-related statistics.getWriteDescription(boolean writeArea, boolean writeMean, boolean writeStddev, boolean writeMin, boolean writeMax, boolean writeMedian, PixelDataType dataType, ComplexMode complexMode) Returns ajava.util.List<String>of each of the requested statistics, correctly formatted for writing.toString()
-
Field Details
-
area
public final double areaThe area of this ROI in square mm. -
mean
public final double meanThe mean pixel intensity inside an ROI in intensity units. -
stddev
public final double stddevThe standard deviation pixel intensity inside an ROI in intensity units. -
min
public final double minThe minimum pixel intensity inside an ROI in intensity units. -
max
public final double maxThe maximum pixel intensity inside an ROI in intensity units. -
histo
The histogram of pixel intensities inside an ROI in intensity units. -
validIntensityStats
public final boolean validIntensityStatsA flag to indicate that the intensity-based statistics are valid.
-
-
Constructor Details
-
ROIStats
public ROIStats(double area) Creates anROIStatsobject without valid intensity statistics or histogram of intensities but with a valid area statistic.- Parameters:
area- the area within the perimieter of anROIin square mm.
-
ROIStats
public ROIStats(double area, double mean, double stddev, double min, double max) Creates anROIStatsobject with valid intensity and area statistics, but no histogram of intensities.- Parameters:
area- the area within the perimieter of an ROI in square mm.mean- the mean pixel intensity within an ROI.stddev- the standard deviation of pixel intensity within an ROI.min- the minimum pixel intensity within an ROI.max- the maximum pixel intensity within an ROI.
-
ROIStats
Creates anROIStatsobject with valid intensity and area statistics, and a histogram of intensities.- Parameters:
area- the area within the perimieter of an ROI in square mm.mean- the mean pixel intensity within an ROI.stddev- the standard deviation of pixel intensity within an ROI.min- the minimum pixel intensity within an ROI.max- the maximum pixel intensity within an ROI.histo- the histogram of pixel intensities within an ROI.
-
ROIStats
Creates a newROIStatsobject, copying all values from existing ROIStats.- Parameters:
stats- the ROIStats from which to copy the values.
-
ROIStats
Creates a newROIStatsobject, copying all values except the area from existing ROIStats.- Parameters:
stats- the ROIStats from which to copy all the values except the area.area- the area.
-
-
Method Details
-
getValidIntensityStats
public boolean getValidIntensityStats()Returns whether this ROIStats has valid intensity-related statistics.- Returns:
- true if his ROIStats has valid intensity-related statistics; false otherwise.
-
clearHisto
public void clearHisto()Clears (sets to null) the histogram for these ROIStats. -
getMedian
Returns the median pixel intensity.- Returns:
- the median pixel intensity.
- Throws:
ROIException- if the median intensity can't be computed because the stats does not contain a Histogram of intensities.
-
getWriteDescription
public List<String> getWriteDescription(boolean writeArea, boolean writeMean, boolean writeStddev, boolean writeMin, boolean writeMax, boolean writeMedian, PixelDataType dataType, ComplexMode complexMode) Returns ajava.util.List<String>of each of the requested statistics, correctly formatted for writing. This is the format used when ROI statistics are written to disk.- Parameters:
writeArea- whether to write the area statistic. Iftruethe area is in the List of Strings returned.writeMean- whether to write the mean statistic. Iftruethe mean is in the List of Strings returned.writeStddev- whether to write the standard deviation statistic. Iftruethe standard deviation is in the List of Strings returned.writeMin- whether to write the minimum statistic. Iftruethe minimum is in the List of Strings returned.writeMax- whether to write the maximum statistic. Iftruethe maximum is in the List of Strings returned.writeMedian- whether to write the median statistic. Iftruethe median is in the List of Strings returned.dataType- thePixelDataTypeof the image for which these statistics were created. Needed because Complex images statistics are annotated according to the ComplexMode.complexMode- theComplexModewhich reflects which property of a Complex image these statistics represent.- Returns:
- a String[] containing each of the requested statistics correctly formatted for saving.
-
getCumulativeStats
Returns the cumulative stats for aListofROIStats.Note: if any of the
ROIStatsin the list has invalid intensity statistics, then the returnedROIStatswill have invalid intensity statistics.- Parameters:
statsList- theListofROIStatsfor which to compute the total statistics.dataType- thePixelDataTypefor the image from which these ROIStats are computed.- Returns:
- the
ROIStatsfor the list.
-
toString
-