Class Dice

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

public class Dice extends Object
A class for calculating Dice similarity scores between two sets of ROIs.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Dice(List<ROI> rois1, List<ROI> rois2, float pixelZSize)
    Calculate the Dice similarity scores between two sets of ROIs.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Returns the Dice similarity score.
    double
    Returns the volume of the first set of ROIs.
    double
    Returns the volume of the second set of ROIs.
    static void
    main(String[] args)
    Calculates and prints the Dice score and volume for two sets of ROIs read from disk files.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Dice

      public Dice(List<ROI> rois1, List<ROI> rois2, float pixelZSize) throws ROIException, CancelledException
      Calculate the Dice similarity scores between two sets of ROIs.
      Parameters:
      rois1 - the first set of ROIs.
      rois2 - the second set of ROIs.
      pixelZSize - the slice thickness, used to calculate the ROIs volumes.
      Throws:
      ROIException - if there is an error related to the ROIs.
      CancelledException - if the operation is cancelled.
  • Method Details

    • getScore

      public double getScore()
      Returns the Dice similarity score.
      Returns:
      the Dice similarity score.
    • getV1

      public double getV1()
      Returns the volume of the first set of ROIs.
      Returns:
      the volume of the first set of ROIs.
    • getV2

      public double getV2()
      Returns the volume of the second set of ROIs.
      Returns:
      the volume of the second set of ROIs.
    • main

      public static void main(String[] args)
      Calculates and prints the Dice score and volume for two sets of ROIs read from disk files.
      Parameters:
      args - the program arguments. Three arguments are expected: the first is image name; the second is the name of the first ROI file; the third argument is the name of the second ROI file.