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
Modifier and TypeFieldDescriptionint
The first slice number which this VOI spans (indexed from zero).The histogram of pixel intensities inside the VOI in intensity units.int
The last slice number which this VOI spans (indexed from zero).final double
The maximum pixel intensity inside the VOI in intensity units.final double
The mean pixel intensity inside the VOI in intensity units.final double
The minimum pixel intensity inside the VOI in intensity units.final double
The standard deviation pixel intensity inside the VOI in intensity units.final boolean
A flag to indicate that the intensity-based statistics are valid.final double
The volume of the VOI in cubic mm. -
Constructor Summary
ConstructorDescriptionVOIStats
(List<ROIStats> roiStatsList, int firstSlice, int lastSlice, float sliceThickness, PixelDataType dataType) Creates aVOIStats
object 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.double
Returns the median pixel intensity.boolean
Returns whether this VOIStats has valid intensity-related statistics.getVOIStats
(ReadableImage image, List<ROI> rois, boolean createVOIGroups, ComplexMode complexMode, MonitorWorker worker) Returns aList
of 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 aVOIStats
object 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. Iftrue
the volume 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.
-
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 aList
of the VOIStats for the 3-D connected VOIs formed by a set of ROIs.- Parameters:
image
- the image to which the ROIs apply.rois
- theList
of ROIs to test for 3-D connectivity.createVOIGroups
- if ROI groups are to be created from the VOIs.complexMode
- theComplexMode
for intensity statistics of complex images.worker
- if non-null, theMonitorWorker
that 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
-