@ALDAOperator(genericExecutionMode=ALL, level=STANDARD, allowBatchMode=false) public class FieldOperations2D extends MTBOperator
Modifier and Type | Class and Description |
---|---|
static class |
FieldOperations2D.FieldOperation
Several operation types on a 2D vector field.
|
Modifier and Type | Field and Description |
---|---|
private int |
fieldSizeX
Vector field size in x-direction.
|
private int |
fieldSizeY
Vector field size in y-direction.
|
private FieldOperations2D.FieldOperation |
operationType
The operation which should be applied to the input vector field.
|
private MTBImage |
resultImage
Several result formats.
|
private double[] |
U
U-component-vector of the vector field.
|
private double[] |
V
V-component-vector of the vector field.
|
private MTBVectorField2D |
vectorField
The 2D vector field for several operations.
|
private MTBImageDouble |
vectorFieldImage
The 2D vector field stored to an image.
|
private MTBVectorField2D |
workVectorField
Local vector field variable actually used during operator run.
|
Constructor and Description |
---|
FieldOperations2D()
Standard constructor.
|
FieldOperations2D(MTBVectorField2D inField,
FieldOperations2D.FieldOperation op)
Constructor to create a new field operation operator.
|
FieldOperations2D(MTBVectorField2D inField,
MTBImageDouble inFieldImage,
FieldOperations2D.FieldOperation op)
Constructor to create a new field operation operator.
|
Modifier and Type | Method and Description |
---|---|
protected MTBImageRGB |
colorPlot()
Plots the field in colored image.
|
protected MTBImage |
getDiffX_image()
Calculate the image from the first order partial derivative in x-direction
from the vectors U.
|
protected MTBImage |
getDiffY_image()
Calculate the image from the first order partial derivative in y-direction
from the vectors V.
|
int |
getFieldSizeX()
Get the field size in x-direction.
|
int |
getFieldSizeY()
Get the field size in y-direction.
|
protected MTBImage |
getMagImage()
Calculate the gradient magnitude image from the vectors U and V.
|
protected MTBImage |
getNormedMagImage()
Normalize the gradient magnitude values into a range of [0,1].
|
FieldOperations2D.FieldOperation |
getOperationType()
Get the operation type which should be applied to the input vector field.
|
MTBImage |
getResultImage()
Get result image of the operation on the vector field.
|
MTBVectorField2D |
getVectorField()
Get the operation based 2D vector field.
|
MTBImageDouble |
getVectorFieldImage()
Get the operation based 2D vector field image.
|
protected void |
operate()
This method does the actual work.
|
void |
setFieldSizeX(int sizeX)
Set the field size in x-direction.
|
void |
setFieldSizeY(int sizeY)
Set the field size in y-direction.
|
void |
setOperationType(FieldOperations2D.FieldOperation type) |
void |
setVectorField(MTBVectorField2D inField)
Set the operation based 2D vector field.
|
void |
setVectorFieldImage(MTBImageDouble inFieldImage)
Set the operation based 2D vector field image.
|
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
private transient double[] U
private transient double[] V
private int fieldSizeX
private int fieldSizeY
@Parameter(label="Vector Field", required=false, direction=IN, description="2D vector field input", dataIOOrder=0) private transient MTBVectorField2D vectorField
@Parameter(label="Vector Field Image", required=false, direction=IN, description="Vector field image.", dataIOOrder=1) 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.
@Parameter(label="Operation Type", required=true, direction=IN, description="Type of used field operation.", dataIOOrder=2) private FieldOperations2D.FieldOperation operationType
@Parameter(label="Result Image", required=false, direction=OUT, description="Result image.") private transient MTBImage resultImage
private transient MTBVectorField2D workVectorField
public FieldOperations2D() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public FieldOperations2D(MTBVectorField2D inField, MTBImageDouble inFieldImage, FieldOperations2D.FieldOperation op) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
inField
- input 2D vector fieldinFieldImage
- input 2D vector field imageop
- operator typede.unihalle.informatik.Alida.exceptions.ALDOperatorException
public FieldOperations2D(MTBVectorField2D inField, FieldOperations2D.FieldOperation op) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
inField
- input 2D vector fieldop
- operator typede.unihalle.informatik.Alida.exceptions.ALDOperatorException
public MTBVectorField2D getVectorField()
public void setVectorField(MTBVectorField2D inField)
public MTBImageDouble getVectorFieldImage()
public void setVectorFieldImage(MTBImageDouble inFieldImage)
public FieldOperations2D.FieldOperation getOperationType()
public void setOperationType(FieldOperations2D.FieldOperation type)
public int getFieldSizeX()
public void setFieldSizeX(int sizeX)
public int getFieldSizeY()
public void setFieldSizeY(int sizeY)
public MTBImage getResultImage()
protected void operate() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
operate
in class de.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
protected MTBImage getMagImage()
protected MTBImage getNormedMagImage()
protected MTBImage getDiffX_image()
protected MTBImage getDiffY_image()
protected MTBImageRGB colorPlot() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
Plots the field in colored image. The colors derived from the field vectors magnitude (length of the vector) and their direction (degree from x-axis to y-axis). HSV color spaced is used to represent direction and magnitude. To view the field, HSV color space is converted to RGBcolor space. H: (the used color) is derived from the angle of the vector. S: (saturation) of color H is derived from the vector magnitude. V: (brightness value) is set to 1.0 (100%), to get colors only from 0% saturation of color H (white) to 100% saturation of color H. Ranges of HSV: H in [0, 360) (representing degrees), S and I in [0, 1] (representing [0, 100 %]).
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.