com.xinapse.multisliceimage.roi
Class ROIStats

java.lang.Object
  extended by com.xinapse.multisliceimage.roi.ROIStats

public class ROIStats
extends java.lang.Object

A Class containing the statistics that are computed for an ROI.


Field Summary
 double area
          The area of this ROI in square mm.
 Histogram histo
          The histogram of pixel intensities inside an ROI in intensity units.
 double max
          The maximum pixel intensity inside an ROI in intensity units.
 double mean
          The mean pixel intensity inside an ROI in intensity units.
 double min
          The minimum pixel intensity inside an ROI in intensity units.
 double stddev
          The standard deviation pixel intensity inside an ROI in intensity units.
 boolean validIntensityStats
          A flag to indicate that the intensity-based statistics are valid.
 
Constructor Summary
ROIStats(double area)
          Creates an ROIStats 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 an ROIStats object with valid intensity and area statistics, but no histogram of intensities.
ROIStats(double area, double mean, double stddev, double min, double max, Histogram histo)
          Creates an ROIStats object with valid intensity and area statistics, and a histogram of intensities.
ROIStats(ROIStats stats)
          Creates a new ROIStats object, copying all values from existing ROIStats.
ROIStats(ROIStats stats, double area)
          Creates a new ROIStats object, copying all values except the area from existing ROIStats.
 
Method Summary
static ROIStats getCumulativeStats(java.util.List<ROIStats> statsList, PixelDataType dataType)
          Returns the cumulative stats for a List of ROIStats.
 double getMedian()
           
 boolean getValidIntensityStats()
          Returns whether this ROIStats has valid intensity-related statistics.
 java.lang.String getWriteDescription(boolean writeArea, boolean writeMean, boolean writeStddev, boolean writeMin, boolean writeMax, boolean writeMedian, PixelDataType dataType, ComplexMode complexMode)
          Returns a String showing the statistics correctly formatted for writing.
 java.lang.String toString()
          Returns a java.lang.String describing this ROIStats object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

area

public final double area
The area of this ROI in square mm.


mean

public final double mean
The mean pixel intensity inside an ROI in intensity units.


stddev

public final double stddev
The standard deviation pixel intensity inside an ROI in intensity units.


min

public final double min
The minimum pixel intensity inside an ROI in intensity units.


max

public final double max
The maximum pixel intensity inside an ROI in intensity units.


histo

public Histogram histo
The histogram of pixel intensities inside an ROI in intensity units.


validIntensityStats

public final boolean validIntensityStats
A flag to indicate that the intensity-based statistics are valid.

Constructor Detail

ROIStats

public ROIStats(double area)
Creates an ROIStats object without valid intensity statistics or histogram of intensities but with a valid area statistic.

Parameters:
area - the area within the perimieter of an ROI in square mm.

ROIStats

public ROIStats(double area,
                double mean,
                double stddev,
                double min,
                double max)
Creates an ROIStats 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

public ROIStats(double area,
                double mean,
                double stddev,
                double min,
                double max,
                Histogram histo)
Creates an ROIStats 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

public ROIStats(ROIStats stats)
Creates a new ROIStats object, copying all values from existing ROIStats.

Parameters:
stats - the ROIStats from which to copy the values.

ROIStats

public ROIStats(ROIStats stats,
                double area)
Creates a new ROIStats 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 Detail

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.

getMedian

public double getMedian()
                 throws ROIException
Throws:
ROIException

getWriteDescription

public java.lang.String getWriteDescription(boolean writeArea,
                                            boolean writeMean,
                                            boolean writeStddev,
                                            boolean writeMin,
                                            boolean writeMax,
                                            boolean writeMedian,
                                            PixelDataType dataType,
                                            ComplexMode complexMode)
Returns a String showing the 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. If true the area is written.
writeMean - whether to write the mean statistic. If true the mean is written.
writeStddev - whether to write the standard deviation statistic. If true the standard deviation is written.
writeMin - whether to write the minimum statistic. If true the minimum is written.
writeMax - whether to write the maximum statistic. If true the maximum is written.
writeMedian - whether to write the median statistic. If true the median is written.
dataType - the PixelDataType of the image for which these statistics were created. Needed because Complex images statistics are annotated according to the ComplexMode.
complexMode - the ComplexMode which reflects which property of a Complex image these statistics represent.
Returns:
a String showing the statistics correctly formatted for saving.

getCumulativeStats

public static ROIStats getCumulativeStats(java.util.List<ROIStats> statsList,
                                          PixelDataType dataType)
Returns the cumulative stats for a List of ROIStats.

Note: if any of the ROIStats in the list has invalid intensity statistics, then the returned ROIStats will have invalid intensity statistics.

Parameters:
statsList - the java.util.List of ROIStats for which to compute the total statistics.
Returns:
the ROIStats for the list.

toString

public java.lang.String toString()
Returns a java.lang.String describing this ROIStats object.

Overrides:
toString in class java.lang.Object
Returns:
a java.lang.String describing this ROIStats object.


Copyright 2006-2011 Xinapse Systems Limited. All Rights Reserved.