@ALDAOperator(genericExecutionMode=ALL, level=APPLICATION) public class DrawEllipse extends MTBOperator
Note that this is a really brute-force implementation. Ellipses are sampled only with 360 steps and no Bresenham algorithm or something similar is applied. Also there are no special efforts to make the drawing process efficient.
Modifier and Type | Field and Description |
---|---|
private Color |
color
Color or gray value to use.
|
private boolean |
copyInputImage
Flag to enable/disable plotting directly into input image.
|
private MTBQuadraticCurve2D |
ellipse
Ellipse to draw.
|
private MTBImage |
inImg
Input image where to draw the ellipse into.
|
private MTBImage |
outImg
Result image.
|
private int[] |
ztcCoords
Optional coordinates for slices in ztc stack.
|
Constructor and Description |
---|
DrawEllipse()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
private void |
drawEllipse()
Draw ellipse to image.
|
MTBImage |
getResultImage()
Get result image.
|
void |
operate() |
void |
setColor(Color c)
Specify color to use.
|
void |
setCopyInputImage(boolean f)
Enable/disable copy of input image.
|
void |
setEllipse(MTBQuadraticCurve2D e)
Specify ellipse to draw.
|
void |
setInputImage(MTBImage img)
Specify input image.
|
void |
setZTCCoordinates(int z,
int t,
int c)
Specify optional coordinates if input image is a stack.
|
readResolve
addOperatorExecutionProgressEventListener, 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, dataIOOrder=0, description="Input image where to draw ellipse.") private transient MTBImage inImg
@Parameter(label="Ellipse", required=true, direction=IN, dataIOOrder=1, description="Ellipse to draw.") private MTBQuadraticCurve2D ellipse
@Parameter(label="Color", required=true, direction=IN, dataIOOrder=2, description="Color or gray value to use.") private Color color
@Parameter(label="Copy Input Image?", required=false, direction=IN, dataIOOrder=0, description="If false, input image is directly modified.") private boolean copyInputImage
@Parameter(label="Optional z/t/c coordinates", required=false, direction=IN, dataIOOrder=1, description="Optional coordinates to draw into stack.") private int[] ztcCoords
@Parameter(label="Result Image", direction=OUT, dataIOOrder=0, description="Output image where to draw ellipse.") private transient MTBImage outImg
This image is of the same type than the input image.
public DrawEllipse() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
- Thrown in case of initialization problems.public void setInputImage(MTBImage img)
img
- Image where to draw into.public void setEllipse(MTBQuadraticCurve2D e)
Note that you have to make sure that the quadratic curve refers to a valid, non-degenerate ellipse.
e
- Ellipse to draw.public void setColor(Color c)
c
- Color to use for drawing.public void setCopyInputImage(boolean f)
f
- If true (default), input image is copied.public void setZTCCoordinates(int z, int t, int c)
z
- z-slice coordinate.t
- t-slice coordinate.c
- c-slice coordinate.public MTBImage getResultImage()
public void operate()
operate
in class de.unihalle.informatik.Alida.operator.ALDOperator
private void drawEllipse()
Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.