@ALDAOperator(genericExecutionMode=ALL) public class Contour2DConcavityCalculator extends MTBOperator
| Modifier and Type | Field and Description |
|---|---|
private Vector<double[]> |
concavenessValues |
private MTBContour2DSet |
contours |
private MTBContour2DSet |
contourWorkSet |
private Boolean |
eightconnected |
private MTBImage |
inImg |
private Boolean |
normalizeConcavities
Normalize values by scaling them to a range of [0,1].
|
private Integer |
radius |
private MTBImage |
resultImg
Result image with concavity values.
|
| Constructor and Description |
|---|
Contour2DConcavityCalculator() |
Contour2DConcavityCalculator(MTBImage inImg) |
Contour2DConcavityCalculator(MTBImage inImg,
int radius,
boolean eightconnected) |
Contour2DConcavityCalculator(MTBImage inImg,
MTBContour2DSet contours,
int radius,
boolean eightconnected) |
| Modifier and Type | Method and Description |
|---|---|
private int |
concaveness(int x,
int y) |
private int[] |
getConcaveness(Vector<Point2D.Double> points) |
Vector<double[]> |
getConcavenessValues() |
MTBImage |
getResultImage() |
protected void |
operate() |
void |
setContours(MTBContour2DSet cset)
Specify optional input contours.
|
void |
setNormalize(Boolean b)
Enable/disable normalization.
|
void |
setRadius(int r)
Specify radius of local mask.
|
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="input image",
required=true,
direction=IN,
supplemental=false,
description="input image")
private MTBImage inImg
@Parameter(label="contours",
required=false,
direction=IN,
supplemental=false,
description="contours whose concaveness has to be calculated")
private MTBContour2DSet contours
@Parameter(label="radius",
required=false,
direction=IN,
supplemental=false,
description="radius of considered neighbors")
private Integer radius
@Parameter(label="is foreground eightconnected",
required=false,
direction=IN,
supplemental=false,
description="are foreground pixels 8-connected or 4-connected")
private Boolean eightconnected
@Parameter(label="Normalize values to [0,1]?",
direction=IN,
supplemental=false,
description="Normalize values by radius and use local average?")
private Boolean normalizeConcavities
In the original paper the values are given by the sum of the concavity values of each three adjacent contour pixels. Each concavity value is equal to the number of pixels in the neighborhood of the contour pixel which lie inside the region. The neighborhood size is defined by the given radius.
In case of normalization the neighborhood size is used as normalization factor and the average of each three adjacent concavity values is used. Thus, the resulting values are scaled to a range of [0,1].
@Parameter(label="result image",
required=true,
direction=OUT,
supplemental=false,
description="resulting image")
private MTBImage resultImg
If non-normalized concavity values are to be computed, the returned image is of type
MTBImageInt, in case of normalized values it is of type MTBImageDouble.
@Parameter(label="concavenessValues",
required=true,
direction=OUT,
supplemental=false,
description="resulting concaveness values for each region")
private Vector<double[]> concavenessValues
private MTBContour2DSet contourWorkSet
public Contour2DConcavityCalculator()
throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorExceptionpublic Contour2DConcavityCalculator(MTBImage inImg) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
de.unihalle.informatik.Alida.exceptions.ALDOperatorExceptionde.unihalle.informatik.Alida.exceptions.ALDProcessingDAGExceptionpublic Contour2DConcavityCalculator(MTBImage inImg, int radius, boolean eightconnected) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
de.unihalle.informatik.Alida.exceptions.ALDOperatorExceptionde.unihalle.informatik.Alida.exceptions.ALDProcessingDAGExceptionpublic Contour2DConcavityCalculator(MTBImage inImg, MTBContour2DSet contours, int radius, boolean eightconnected) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorExceptionpublic void setContours(MTBContour2DSet cset)
cset - Set of contours.public void setRadius(int r)
r - Radius of mask for concavity analysis.public void setNormalize(Boolean b)
b - If true, normalization is enabled.protected void operate()
throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException,
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
operate in class de.unihalle.informatik.Alida.operator.ALDOperatorde.unihalle.informatik.Alida.exceptions.ALDOperatorExceptionde.unihalle.informatik.Alida.exceptions.ALDProcessingDAGExceptionprivate int[] getConcaveness(Vector<Point2D.Double> points)
points - contour pointsinImg - binary imageprivate int concaveness(int x,
int y)
x - y - img - radius - public MTBImage getResultImage()
public Vector<double[]> getConcavenessValues()
Copyright © 2010–2025 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.