Class VOIStats

java.lang.Object
com.xinapse.multisliceimage.roi.VOIStats

public class VOIStats extends Object
A Class containing the statistics that are computed for a Volume-of-Interest (VOI).
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int
    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

    Constructors
    Constructor
    Description
    VOIStats(List<ROIStats> roiStatsList, int firstSlice, int lastSlice, float sliceThickness, PixelDataType dataType)
    Creates a VOIStats object without valid intensity statistics or histogram of intensities but with a valid volume statistic.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the column formats when writing VOIStats in columns.
    Returns the column headers when writing VOIStats in columns.
    double[]
    Returns the VOIStats statistics.
    double
    Returns the median pixel intensity.
    boolean
    Returns whether this VOIStats has valid intensity-related statistics.
    static List<VOIStats>
    getVOIStats(ReadableImage image, List<ROI> rois, boolean createVOIGroups, ComplexMode complexMode, MonitorWorker worker)
    Returns a List 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 a java.util.List<String> of each of the requested statistics, correctly formatted for writing.
    Returns a String describing this VOIStats object.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • volume

      public final double volume
      The volume of the VOI in cubic mm.
    • mean

      public final double mean
      The mean pixel intensity inside the VOI in intensity units.
    • stddev

      public final double stddev
      The standard deviation pixel intensity inside the VOI in intensity units.
    • min

      public final double min
      The minimum pixel intensity inside the VOI in intensity units.
    • max

      public final double max
      The maximum pixel intensity inside the VOI in intensity units.
    • histo

      public Histogram histo
      The histogram of pixel intensities inside the VOI in intensity units.
    • firstSlice

      public int firstSlice
      The first slice number which this VOI spans (indexed from zero).
    • lastSlice

      public int lastSlice
      The last slice number which this VOI spans (indexed from zero).
    • validIntensityStats

      public final boolean validIntensityStats
      A 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 a VOIStats 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 the VOI.
      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

      public double getMedian() throws ROIException
      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 a java.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. If true the volume is in the List of Strings returned.
      writeMean - whether to write the mean statistic. If true the mean is in the List of Strings returned.
      writeStddev - whether to write the standard deviation statistic. If true the standard deviation is in the List of Strings returned.
      writeMin - whether to write the minimum statistic. If true the minimum is in the List of Strings returned.
      writeMax - whether to write the maximum statistic. If true the maximum is in the List of Strings returned.
      writeMedian - whether to write the median statistic. If true the median is in the List of Strings returned.
      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[] containing each of the requested statistics correctly formatted for saving.
    • getColumnHeaders

      public String[] getColumnHeaders()
      Returns the column headers when writing VOIStats in columns.
      Returns:
      the column headers when writing VOIStats in columns.
    • getColumnFormats

      public DecimalFormat[] 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 a List 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 - the List of ROIs to test for 3-D connectivity.
      createVOIGroups - if ROI groups are to be created from the VOIs.
      complexMode - the ComplexMode for intensity statistics of complex images.
      worker - if non-null, the MonitorWorker 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

      public String toString()
      Returns a String describing this VOIStats object.
      Overrides:
      toString in class Object
      Returns:
      a String describing this VOIStats object.