de.unihalle.informatik.MiToBo.fields
Class FieldOperations2D

java.lang.Object
  extended by de.unihalle.informatik.Alida.operator.ALDOperator
      extended by de.unihalle.informatik.MiToBo.core.operator.MTBOperator
          extended by de.unihalle.informatik.MiToBo.fields.FieldOperations2D
All Implemented Interfaces:
de.unihalle.informatik.Alida.datatypes.ALDConfigurationValidator, de.unihalle.informatik.Alida.operator.events.ALDOperatorExecutionProgressEventListener, EventListener

@ALDAOperator(genericExecutionMode=ALL,
              level=STANDARD,
              allowBatchMode=false)
@ALDMetaInfo(export=ALLOWED)
public class FieldOperations2D
extends MTBOperator

Class implements several operations on a 2D vector field.

Author:
Danny Misiak

Nested Class Summary
static class FieldOperations2D.FieldOperation
          Several operation types on a 2D vector field.
 
Nested classes/interfaces inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.Alida.operator.ALDOperator.HidingMode
 
Field Summary
 
Fields inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
completeDAG, name, operatorExecutionEventlistenerList, portHashAccess, verbose, versionProvider
 
Constructor Summary
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.
 
Method Summary
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.
 
Methods inherited from class de.unihalle.informatik.MiToBo.core.operator.MTBOperator
readResolve
 
Methods inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
addOperatorExecutionProgressEventListener, fieldContained, fireOperatorExecutionProgressEvent, getALDPortHashAccessKey, getConstructionMode, getHidingMode, getInInoutNames, getInInoutNames, getInNames, getInOutNames, getMissingRequiredInputs, getName, getNumParameters, getOutInoutNames, getOutNames, getParameter, getParameterDescriptor, getParameterNames, getSupplementalNames, getVerbose, getVersion, handleOperatorExecutionProgressEvent, isConfigured, print, print, print, printInterface, printInterface, readHistory, reinitializeParameterDescriptors, removeOperatorExecutionProgressEventListener, runOp, runOp, runOp, setConstructionMode, setHidingMode, setName, setParameter, setVerbose, toStringVerbose, unconfiguredItems, validate, validateCustom, validateGeneric, writeHistory, writeHistory, writeHistory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldOperations2D

public FieldOperations2D()
                  throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Standard constructor.

Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException

FieldOperations2D

public FieldOperations2D(MTBVectorField2D inField,
                         MTBImageDouble inFieldImage,
                         FieldOperations2D.FieldOperation op)
                  throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Constructor to create a new field operation operator.

Parameters:
inField - input 2D vector field
inFieldImage - input 2D vector field image
op - operator type
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException

FieldOperations2D

public FieldOperations2D(MTBVectorField2D inField,
                         FieldOperations2D.FieldOperation op)
                  throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Constructor to create a new field operation operator.

Parameters:
inField - input 2D vector field
op - operator type
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Method Detail

getVectorField

public MTBVectorField2D getVectorField()
Get the operation based 2D vector field.


setVectorField

public void setVectorField(MTBVectorField2D inField)
Set the operation based 2D vector field.


getVectorFieldImage

public MTBImageDouble getVectorFieldImage()
Get the operation based 2D vector field image.


setVectorFieldImage

public void setVectorFieldImage(MTBImageDouble inFieldImage)
Set the operation based 2D vector field image.


getOperationType

public FieldOperations2D.FieldOperation getOperationType()
Get the operation type which should be applied to the input vector field.

Returns:
Field operation type.

setOperationType

public void setOperationType(FieldOperations2D.FieldOperation type)

getFieldSizeX

public int getFieldSizeX()
Get the field size in x-direction.


setFieldSizeX

public void setFieldSizeX(int sizeX)
Set the field size in x-direction.


getFieldSizeY

public int getFieldSizeY()
Get the field size in y-direction.


setFieldSizeY

public void setFieldSizeY(int sizeY)
Set the field size in y-direction.


getResultImage

public MTBImage getResultImage()
Get result image of the operation on the vector field.


operate

protected void operate()
                throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
This method does the actual work.

Specified by:
operate in class de.unihalle.informatik.Alida.operator.ALDOperator
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException

getMagImage

protected MTBImage getMagImage()
Calculate the gradient magnitude image from the vectors U and V.

Returns:
Gradient magnitude image.

getNormedMagImage

protected MTBImage getNormedMagImage()
Normalize the gradient magnitude values into a range of [0,1].

Returns:
MTBimage with normalized gradient magnitude values.

getDiffX_image

protected MTBImage getDiffX_image()
Calculate the image from the first order partial derivative in x-direction from the vectors U.

Returns:
Gradient image in x-direction.

getDiffY_image

protected MTBImage getDiffY_image()
Calculate the image from the first order partial derivative in y-direction from the vectors V.

Returns:
Gradient image in y-direction.

colorPlot

protected MTBImageRGB colorPlot()
 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 %]).
 

Returns:
RGB image, visualizing the vector field.


Copyright © 2010–2015 Martin Luther University Halle-Wittenberg. All rights reserved.