@ALDAOperator(genericExecutionMode=ALL,
level=APPLICATION)
public class GroundtruthEvaluation
extends MTBOperator
The operator takes a segmentation image and a ground truth image. It evaluates both segmentations based on region and/or contour information
Both images have to be region images and have to have the same size.
| Modifier and Type | Field and Description |
|---|---|
private boolean |
DE
Check if you want to compute the Detection Errors
|
private boolean |
GTC
Check if you want to compute Recall and Precision
|
protected int[] |
gtIDs
Match list of set entries to original groundtruth labels.
|
protected MTBImageShort |
gtLabelImage
Preprocessed groundtruth label image with short pixel type.
|
protected MTBImage |
gtLabelsOrig
Groundtruth labeling.
|
private boolean |
HAU
Check if you want to compute the Hausdorff-Distance
|
protected int |
height
Height of label images.
|
private Boolean |
invertGroundtrouth
Flag to invert ground-truth image prior to evaluation.
|
private Boolean |
invertInputImage
Flag to invert input image.
|
private ArrayList<Integer> |
labelListGT
List of groundtruth region labels.
|
private ArrayList<Integer> |
labelListSG
List of labels found in segmentation.
|
protected TreeSet<Integer> |
labelSetGT
Set of available groundtruth labels.
|
protected TreeSet<Integer> |
labelSetSG
Set of available segmentation labels.
|
protected byte[][] |
matchingMatrix
Matching matrix.
|
protected int |
maxRegionCount
Maximum number of regions in groundtruth or segmented region set.
|
protected String |
measureInfo
Info string to structure GUI.
|
protected int |
minRegionCount
Minimum number of regions in groundtruth or segmented region set.
|
protected int |
n
For Odet's criteria only
|
private boolean |
Odet
Check if you want to compute Odet's criteria
|
private Boolean |
omitAssignment
Flag to omit region assignment.
|
private boolean |
PRA
Check if you want to compute Pratt's figure of merit
|
private de.unihalle.informatik.Alida.datatypes.ALDFileString |
resultFile
Optional file where to save the result table.
|
protected MTBTableModel |
resultTable
Table with result data.
|
protected double[][] |
scoreMatrix
Score matrix with pairwise overlaps.
|
protected MTBImageShort |
segLabelImage
Preprocessed segmentation label image with short pixel type.
|
protected MTBImage |
segLabelsOrig
Label image of segmentation result.
|
protected int[] |
sgIDs
Match list of set entries to original segmentation labels.
|
protected HashMap<Integer,Integer> |
sizesGT
Array of sizes of groundtruth regions.
|
protected HashMap<Integer,Integer> |
sizesSG
Array of sizes of segmented regions.
|
protected int |
width
Width of label images.
|
| Constructor and Description |
|---|
GroundtruthEvaluation()
Default constructor.
|
GroundtruthEvaluation(MTBImage _segLabels,
MTBImage _gtLabels,
Boolean noAssignment)
Default constructor with parameters.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
convertLabelImages()
Converts input images to short pixel format and optionally inverts them.
|
protected void |
createResultTable()
This method prepares the result table for the solution.
|
protected HashMap<String,HashMap<Integer,Double>> |
doEvaluation()
Calculates evaluation measures.
|
protected void |
extractLabelsSizesOverlaps()
Extracts evaluation data in terms of overlaps and missed pixels.
|
protected void |
fillResultTable(HashMap<String,HashMap<Integer,Double>> data)
Method to fill the result table.
|
MTBTableModel |
getResultTable()
Get evaluation results.
|
protected void |
operate() |
readResolveaddOperatorExecutionProgressEventListener, addParameter, addParameter, addParameterUnconditioned, fieldContained, fireOperatorExecutionProgressEvent, getALDPortHashAccessKey, getConstructionMode, getDocumentation, getHidingMode, getInactiveParameterNames, getInInoutNames, getInInoutNames, getInNames, getInOutNames, getMissingRequiredInputs, getName, getNumParameters, getOutInoutNames, getOutNames, getParameter, getParameterDescriptor, getParameterDescriptorUnconditioned, getParameterNames, getParameterUnconditioned, getSupplementalNames, getVerbose, getVersion, handleOperatorExecutionProgressEvent, hasInOutParameters, hasParameter, isAnnotatedParameter, isConfigured, print, print, print, printInterface, printInterface, readHistory, reinitializeParameterDescriptors, removeOperatorExecutionProgressEventListener, removeParameter, runOp, runOp, runOp, setConstructionMode, setConstructionMode, setConstructionMode, setHidingMode, setName, setParameter, setParameterUnconditioned, setVerbose, toStringVerbose, unconfiguredItems, validate, validateCustom, validateGeneric, writeHistory, writeHistory, writeHistory@Parameter(label="Groundtruth Label Image",
required=true,
direction=IN,
dataIOOrder=0,
description="Groundtruth label image.")
protected transient MTBImage gtLabelsOrig
@Parameter(label="Segmentation Label Image",
required=true,
direction=IN,
dataIOOrder=1,
description="Segmentation result label image.")
protected transient MTBImage segLabelsOrig
@Parameter(label="Result data table",
direction=OUT,
supplemental=true,
description="Result data table")
protected MTBTableModel resultTable
@Parameter(label="Measure info string",
required=true,
dataIOOrder=2,
direction=IN,
description="Info string.",
info=true)
protected String measureInfo
@Parameter(label="Recalls, Precisions, F1-Scores and Jaccard Indices",
required=true,
dataIOOrder=3,
direction=IN,
description="Calculate recalls, precisions, F1-scores and Jaccard indices.")
private boolean GTC
@Parameter(label="Pratt\'s Figure of Merit",
required=true,
dataIOOrder=4,
direction=IN,
description="Calculate Pratt\'s figure of merit.")
private boolean PRA
@Parameter(label="Hausdorff Distance",
required=true,
dataIOOrder=5,
direction=IN,
description="Calculate Hausdorff distance.")
private boolean HAU
@Parameter(label="Detection Errors",
required=true,
dataIOOrder=6,
direction=IN,
description="Calculate Detection Errors.")
private boolean DE
@Parameter(label="Odet\'s criteria",
required=true,
dataIOOrder=7,
direction=IN,
description="Calculate Odet\'s criteria.")
private boolean Odet
@Parameter(label="Odet\'s criteria exponent",
required=true,
dataIOOrder=8,
direction=IN,
description="Exponent for calculating Odet\'s criterias.")
protected int n
@Parameter(label="Invert groundtruth image",
required=false,
direction=IN,
dataIOOrder=1,
description="Apply inversion to groundtruth image.")
private Boolean invertGroundtrouth
@Parameter(label="Invert input image",
required=false,
direction=IN,
dataIOOrder=2,
description="Apply inversion to input image.")
private Boolean invertInputImage
@Parameter(label="Automatic region assignment off",
required=false,
direction=IN,
dataIOOrder=3,
description="No automatic region assignment.")
private Boolean omitAssignment
@Parameter(label="(Optional) result file",
required=false,
direction=IN,
dataIOOrder=4)
private de.unihalle.informatik.Alida.datatypes.ALDFileString resultFile
protected int width
protected int height
protected MTBImageShort gtLabelImage
protected MTBImageShort segLabelImage
protected int[] gtIDs
protected int[] sgIDs
protected int minRegionCount
protected int maxRegionCount
protected double[][] scoreMatrix
protected byte[][] matchingMatrix
public GroundtruthEvaluation()
throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException - Thrown in case of failure.public GroundtruthEvaluation(MTBImage _segLabels, MTBImage _gtLabels, Boolean noAssignment) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
_segLabels - Label image of segmentation result._gtLabels - Label image of groundtruth segmentation.noAssignment - Flag, set true if label images imply assignment.de.unihalle.informatik.Alida.exceptions.ALDOperatorException - Thrown in case of failure.public MTBTableModel getResultTable()
protected void operate()
throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
operate in class de.unihalle.informatik.Alida.operator.ALDOperatorde.unihalle.informatik.Alida.exceptions.ALDOperatorExceptionprotected void convertLabelImages()
throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException,
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException - Thrown in case of failure.de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException - Thrown in case of failure.protected void extractLabelsSizesOverlaps()
protected HashMap<String,HashMap<Integer,Double>> doEvaluation() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException - Thrown in case of failure.de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException - Thrown in case of failure.protected void fillResultTable(HashMap<String,HashMap<Integer,Double>> data)
data - Evaluation data to fill into the table.protected void createResultTable()
Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.