Package com.xinapse.multisliceimage.roi
Class VOIStats
java.lang.Object
com.xinapse.multisliceimage.roi.VOIStats
A Class containing the statistics that are computed for a Volume-of-Interest (VOI).
-
Field Summary
FieldsModifier and TypeFieldDescriptionintThe first slice number which this VOI spans (indexed from zero).The histogram of pixel intensities inside the VOI in intensity units.intThe last slice number which this VOI spans (indexed from zero).final doubleThe maximum pixel intensity inside the VOI in intensity units.final doubleThe mean pixel intensity inside the VOI in intensity units.final doubleThe minimum pixel intensity inside the VOI in intensity units.final doubleThe standard deviation pixel intensity inside the VOI in intensity units.final booleanA flag to indicate that the intensity-based statistics are valid.final doubleThe volume of the VOI in cubic mm. -
Constructor Summary
ConstructorsConstructorDescriptionVOIStats(List<ROIStats> roiStatsList, int firstSlice, int lastSlice, float sliceThickness, PixelDataType dataType) Creates aVOIStatsobject without valid intensity statistics or histogram of intensities but with a valid volume statistic. -
Method Summary
Modifier and TypeMethodDescriptionReturns the column formats when writing VOIStats in columns.String[]Returns the column headers when writing VOIStats in columns.double[]getData()Returns the VOIStats statistics.doubleReturns the median pixel intensity.booleanReturns whether this VOIStats has valid intensity-related statistics.getVOIStats(ReadableImage image, List<ROI> rois, boolean createVOIGroups, ComplexMode complexMode, MonitorWorker worker) Returns aListof the VOIStats for the 3-D connected VOIs formed by a set of ROIs.getWriteDescription(boolean writeVolume, 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
-
volume
public final double volumeThe volume of the VOI in cubic mm. -
mean
public final double meanThe mean pixel intensity inside the VOI in intensity units. -
stddev
public final double stddevThe standard deviation pixel intensity inside the VOI in intensity units. -
min
public final double minThe minimum pixel intensity inside the VOI in intensity units. -
max
public final double maxThe maximum pixel intensity inside the VOI in intensity units. -
histo
The histogram of pixel intensities inside the VOI in intensity units. -
firstSlice
public int firstSliceThe first slice number which this VOI spans (indexed from zero). -
lastSlice
public int lastSliceThe last slice number which this VOI spans (indexed from zero). -
validIntensityStats
public final boolean validIntensityStatsA flag to indicate that the intensity-based statistics are valid.
-
-
Constructor Details
-
VOIStats
public VOIStats(List<ROIStats> roiStatsList, int firstSlice, int lastSlice, float sliceThickness, PixelDataType dataType) Creates aVOIStatsobject without valid intensity statistics or histogram of intensities but with a valid volume statistic.- Parameters:
roiStatsList- the List of ROIStats for the ROIs that form theVOI.firstSlice- the first slice which this VOI spans (indexed from zero).lastSlice- the last slice which this VOI spans (indexed from zero).sliceThickness- the image pixel thickness.dataType- the pixel data type.
-
-
Method Details
-
getValidIntensityStats
public boolean getValidIntensityStats()Returns whether this VOIStats has valid intensity-related statistics.- Returns:
- true if his VOIStats has valid intensity-related statistics; false otherwise.
-
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 writeVolume, 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 VOI statistics are written to disk.- Parameters:
writeVolume- whether to write the volume statistic. Iftruethe volume 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.
-
getColumnHeaders
Returns the column headers when writing VOIStats in columns.- Returns:
- the column headers when writing VOIStats in columns.
-
getColumnFormats
Returns the column formats when writing VOIStats in columns.- Returns:
- the column formats when writing VOIStats in columns.
-
getData
public double[] getData()Returns the VOIStats statistics.- Returns:
- the VOIStats statistics.
-
getVOIStats
public static List<VOIStats> getVOIStats(ReadableImage image, List<ROI> rois, boolean createVOIGroups, ComplexMode complexMode, MonitorWorker worker) throws InvalidImageException, ROIException, CancelledException Returns aListof the VOIStats for the 3-D connected VOIs formed by a set of ROIs.- Parameters:
image- the image to which the ROIs apply.rois- theListof ROIs to test for 3-D connectivity.createVOIGroups- if ROI groups are to be created from the VOIs.complexMode- theComplexModefor intensity statistics of complex images.worker- if non-null, theMonitorWorkerthat is running the calculation.- Returns:
- a List of VOIStats for the 3-D connected VOIs formed by the ROIs.
- Throws:
ROIException- if an error occurs during the calculation.CancelledException- if the operation is cancelled.InvalidImageException
-
toString
-