Package com.xinapse.multisliceimage.roi
Class Dice
java.lang.Object
com.xinapse.multisliceimage.roi.Dice
A class for calculating Dice similarity scores between two sets of ROIs.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
getScore()
Returns the Dice similarity score.double
getV1()
Returns the volume of the first set of ROIs.double
getV2()
Returns the volume of the second set of ROIs.static void
Calculates and prints the Dice score and volume for two sets of ROIs read from disk files.
-
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
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.
-