@ALDAOperator(genericExecutionMode=ALL,
level=STANDARD)
public class GradientFieldCalculator2D
extends MTBOperator
Some methods to get derivatives on several operators are implemented like central and forward differences and the Sobel operator.
| Modifier and Type | Class and Description |
|---|---|
static class |
GradientFieldCalculator2D.GradientMode
Provided calculation modes for calculation the gradient image.
|
| Modifier and Type | Field and Description |
|---|---|
private GradientFieldCalculator2D.GradientMode |
gradientMode
The used gradient mode for field calculation.
|
private int |
height
Height of the image.
|
private MTBImage |
inputImage
The input image to get the gradient values and differences.
|
private MTBVectorField2D |
vectorField
The resulting 2D vector field.
|
private MTBImageDouble |
vectorFieldImage
The resulting 2D vector field stored to an image.
|
private int |
width
Width of the image.
|
protected double[] |
xFlow
Vector field flow in x-direction.
|
protected double[] |
yFlow
Vector field flow in y-direction.
|
| Constructor and Description |
|---|
GradientFieldCalculator2D()
Standard constructor.
|
GradientFieldCalculator2D(MTBImage inImg,
GradientFieldCalculator2D.GradientMode mode)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
GradientFieldCalculator2D.GradientMode |
getGradientMode()
Get the used gradient mode for field calculation.
|
int |
getHeight()
Get image height.
|
MTBImage |
getInputImage()
Get the underlying input image of the gradient field..
|
protected void |
getPartialDiffX_forward()
Calculate first order partial derivative in x-direction using forward
differences.
|
protected void |
getPartialDiffX_sobel()
Calculate first order partial derivative in x-direction using Sobel.
|
protected void |
getPartialDiffX()
Calculate first order partial derivative in x-direction using central
differences.
|
protected void |
getPartialDiffY_forward()
Calculate first order partial derivative in y-direction using forward
differences.
|
protected void |
getPartialDiffY_sobel()
Calculate first order partial derivative in y-direction using Sobel.
|
protected void |
getPartialDiffY()
Calculate first order partial derivative in y-direction using central
differences.
|
MTBVectorField2D |
getVectorField()
Get the resulting 2D vector field.
|
MTBImageDouble |
getVectorFieldImage()
Get the resulting 2D vector field image.
|
int |
getWidth()
Get image width.
|
protected void |
operate()
This method does the actual work.
|
void |
setGradientMode(GradientFieldCalculator2D.GradientMode mode)
Set the used gradient mode for field calculation.
|
void |
setHeight(int h)
Set image height.
|
void |
setInputImage(MTBImage inImg)
Set the underlying input image of the gradient field.
|
void |
setWidth(int w)
Set image width.
|
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, writeHistoryprivate transient int width
private transient int height
@Parameter(label="Approximation Mode",
required=true,
direction=IN,
dataIOOrder=-8,
description="Type of the gradient mode")
private GradientFieldCalculator2D.GradientMode gradientMode
@Parameter(label="Input Image",
required=true,
direction=IN,
dataIOOrder=-10,
description="Input image")
private transient MTBImage inputImage
@Parameter(label="Vector Field",
direction=OUT,
description="Gradient field of the 2D image.")
private transient MTBVectorField2D vectorField
@Parameter(label="Vector Field Image",
direction=OUT,
description="Gradient field image.")
private transient MTBImageDouble vectorFieldImage
The image has to layers where the first one contains the values of the x-direction and the second one the values of the y-direction.
protected double[] xFlow
protected double[] yFlow
public GradientFieldCalculator2D()
throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorExceptionpublic GradientFieldCalculator2D(MTBImage inImg, GradientFieldCalculator2D.GradientMode mode) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
inImg - image to work onmode - gradient calculation modede.unihalle.informatik.Alida.exceptions.ALDOperatorExceptionpublic MTBImage getInputImage()
public void setInputImage(MTBImage inImg)
public GradientFieldCalculator2D.GradientMode getGradientMode()
public void setGradientMode(GradientFieldCalculator2D.GradientMode mode)
public MTBVectorField2D getVectorField()
public MTBImageDouble getVectorFieldImage()
public int getWidth()
public void setWidth(int w)
public int getHeight()
public void setHeight(int h)
protected void operate()
operate in class de.unihalle.informatik.Alida.operator.ALDOperatorprotected void getPartialDiffX()
protected void getPartialDiffY()
protected void getPartialDiffX_forward()
protected void getPartialDiffY_forward()
protected void getPartialDiffX_sobel()
protected void getPartialDiffY_sobel()
Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.