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
Modifier and TypeFieldDescriptionfinal double
The area of this ROI in square mm.The histogram of pixel intensities inside an ROI in intensity units.final double
The maximum pixel intensity inside an ROI in intensity units.final double
The mean pixel intensity inside an ROI in intensity units.final double
The minimum pixel intensity inside an ROI in intensity units.final double
The standard deviation pixel intensity inside an ROI in intensity units.final boolean
A flag to indicate that the intensity-based statistics are valid. -
Constructor Summary
ConstructorDescriptionROIStats
(double area) Creates anROIStats
object 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 anROIStats
object with valid intensity and area statistics, but no histogram of intensities.Creates anROIStats
object with valid intensity and area statistics, and a histogram of intensities.Creates a newROIStats
object, copying all values from existing ROIStats.Creates a newROIStats
object, copying all values except the area from existing ROIStats. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears (sets to null) the histogram for these ROIStats.static ROIStats
getCumulativeStats
(List<ROIStats> statsList, PixelDataType dataType) double
Returns the median pixel intensity.boolean
Returns 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 anROIStats
object without valid intensity statistics or histogram of intensities but with a valid area statistic.- Parameters:
area
- the area within the perimieter of anROI
in square mm.
-
ROIStats
public ROIStats(double area, double mean, double stddev, double min, double max) Creates anROIStats
object 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 anROIStats
object 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 newROIStats
object, copying all values from existing ROIStats.- Parameters:
stats
- the ROIStats from which to copy the values.
-
ROIStats
Creates a newROIStats
object, 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. Iftrue
the area is in the List of Strings returned.writeMean
- whether to write the mean statistic. Iftrue
the mean is in the List of Strings returned.writeStddev
- whether to write the standard deviation statistic. Iftrue
the standard deviation is in the List of Strings returned.writeMin
- whether to write the minimum statistic. Iftrue
the minimum is in the List of Strings returned.writeMax
- whether to write the maximum statistic. Iftrue
the maximum is in the List of Strings returned.writeMedian
- whether to write the median statistic. Iftrue
the median is in the List of Strings returned.dataType
- thePixelDataType
of the image for which these statistics were created. Needed because Complex images statistics are annotated according to the ComplexMode.complexMode
- theComplexMode
which 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 aList
ofROIStats
.Note: if any of the
ROIStats
in the list has invalid intensity statistics, then the returnedROIStats
will have invalid intensity statistics.- Parameters:
statsList
- theList
ofROIStats
for which to compute the total statistics.dataType
- thePixelDataType
for the image from which these ROIStats are computed.- Returns:
- the
ROIStats
for the list.
-
toString
-