public class PreprocessLabelImages extends MTBOperator
This class extracts the intensity values of regions in label images as well as the regions' contours.
| Modifier and Type | Field and Description |
|---|---|
protected ArrayList<ArrayList<Point>> |
gtContours
List of contours of groudtruth objects.
|
protected MTBImage |
gtImage
Groundtruth labeling.
|
protected ArrayList<Integer> |
gtLabels
List of labels of groundtruth regions.
|
protected ArrayList<ArrayList<Point>> |
segContours
List of contours of segmented objects.
|
protected MTBImage |
segImage
Label image of segmentation result.
|
protected ArrayList<Integer> |
segLabels
List of labels of segmented regions.
|
| Constructor and Description |
|---|
PreprocessLabelImages()
Default constructor.
|
PreprocessLabelImages(MTBImage gtImg,
MTBImage segImg,
ArrayList<Integer> sLabels,
ArrayList<Integer> gLabels)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
private boolean[][] |
CollectContoursStageOne(MTBImage img,
ArrayList<Integer> regions)
This method collects all contour pixels for a region in a given MTBImage.
|
private void |
CollectContoursStageTwo(MTBImage img,
ArrayList<Integer> regions,
ArrayList<ArrayList<Point>> contours,
boolean[][] isContour)
This method implements the final stage of the contour detection.
|
ArrayList<ArrayList<Point>> |
getGtContours()
Get list of groundtruth contours.
|
ArrayList<ArrayList<Point>> |
getSegContours()
Get list of segmentation contours.
|
protected void |
operate()
This method initializes all required components.
|
void |
validateCustom() |
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, validateGeneric, writeHistory, writeHistory, writeHistory@Parameter(label="Segmentation label image",
required=true,
direction=IN,
description="Segmentation result label image.")
protected transient MTBImage segImage
@Parameter(label="Groundtruth label image",
required=true,
direction=IN,
description="Groundtruth label image.")
protected transient MTBImage gtImage
@Parameter(label="Segmented Region Labels",
direction=IN,
description="Segmented Region Labels.")
protected transient ArrayList<Integer> segLabels
@Parameter(label="Groundtruth Region Labels",
direction=IN,
description="Groundtruth Labels.")
protected transient ArrayList<Integer> gtLabels
@Parameter(label="Segmented contours.",
direction=OUT,
description="Segmented contours.")
protected ArrayList<ArrayList<Point>> segContours
public PreprocessLabelImages()
throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException - Thrown in case of failure.public PreprocessLabelImages(MTBImage gtImg, MTBImage segImg, ArrayList<Integer> sLabels, ArrayList<Integer> gLabels) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
gtImg - Groundtruth image.segImg - Segmentation image.sLabels - List of labels in segmentation image.gLabels - List of labels in groundtruth image.de.unihalle.informatik.Alida.exceptions.ALDOperatorException - Thrown in case of failure.public void validateCustom()
throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
validateCustom in class de.unihalle.informatik.Alida.operator.ALDOperatorde.unihalle.informatik.Alida.exceptions.ALDOperatorExceptionprotected void operate()
operate in class de.unihalle.informatik.Alida.operator.ALDOperatorprivate boolean[][] CollectContoursStageOne(MTBImage img, ArrayList<Integer> regions)
img - Region image.regions - Label set.private void CollectContoursStageTwo(MTBImage img, ArrayList<Integer> regions, ArrayList<ArrayList<Point>> contours, boolean[][] isContour)
It is needed for region images with unclean borders. PRE: > requires the region image where all contours are white (255) > requires a list of Integer, where these Integer is the color value of a region in the image > requires a list, where the contours have to be stored (will be overwritten) POST: > outputs the new and final contour-list for all regions in the image
img - Region image with white contours.regions - Labels of regions.contours - Data structure for result contours.isContour - Array where contour pixels are marked.public ArrayList<ArrayList<Point>> getSegContours()
Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.