de.unihalle.informatik.MiToBo.fields
Class GradientFieldCalculator2D

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.GradientFieldCalculator2D
All Implemented Interfaces:
de.unihalle.informatik.Alida.datatypes.ALDConfigurationValidator, de.unihalle.informatik.Alida.operator.events.ALDOperatorExecutionProgressEventListener, EventListener

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

Class to calculate a gradient vector field of a given image.

Some methods to get derivatives on several operators are implemented like central and forward differences and the Sobel operator.

Author:
Birgit Möller, Danny Misiak

Nested Class Summary
static class GradientFieldCalculator2D.GradientMode
          Provided calculation modes for calculation the gradient image.
 
Nested classes/interfaces inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.Alida.operator.ALDOperator.HidingMode
 
Field Summary
protected  double[] xFlow
          Vector field flow in x-direction.
protected  double[] yFlow
          Vector field flow in y-direction.
 
Fields inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
completeDAG, name, operatorExecutionEventlistenerList, portHashAccess, verbose, versionProvider
 
Constructor Summary
GradientFieldCalculator2D()
          Standard constructor.
GradientFieldCalculator2D(MTBImage inImg, GradientFieldCalculator2D.GradientMode mode)
          Constructor.
 
Method Summary
 GradientFieldCalculator2D.GradientMode getGradientMode()
          Get the used gradient mode for field calculation.
 void getGradientMode(GradientFieldCalculator2D.GradientMode mode)
          Set 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.
 int getWidth()
          Get image width.
protected  void operate()
          This method does the actual work.
 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.
 
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
 

Field Detail

xFlow

protected double[] xFlow
Vector field flow in x-direction.


yFlow

protected double[] yFlow
Vector field flow in y-direction.

Constructor Detail

GradientFieldCalculator2D

public GradientFieldCalculator2D()
                          throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Standard constructor. A new empty operator object is initialized.

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

GradientFieldCalculator2D

public GradientFieldCalculator2D(MTBImage inImg,
                                 GradientFieldCalculator2D.GradientMode mode)
                          throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Constructor. A new operator object is initialized.

Parameters:
inImg - image to work on
mode - gradient calculation mode
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Method Detail

getInputImage

public MTBImage getInputImage()
Get the underlying input image of the gradient field..


setInputImage

public void setInputImage(MTBImage inImg)
Set the underlying input image of the gradient field.


getGradientMode

public GradientFieldCalculator2D.GradientMode getGradientMode()
Get the used gradient mode for field calculation.


getGradientMode

public void getGradientMode(GradientFieldCalculator2D.GradientMode mode)
Set the used gradient mode for field calculation.


getVectorField

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


getWidth

public int getWidth()
Get image width.


setWidth

public void setWidth(int w)
Set image width.


getHeight

public int getHeight()
Get image height.


setHeight

public void setHeight(int h)
Set image height.


operate

protected void operate()
This method does the actual work. Each subclass needs to overwrite this method. As parameter a MiToBo parameter object is passed to the function where all required data and operator configuration information can be found.

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

getPartialDiffX

protected void getPartialDiffX()
Calculate first order partial derivative in x-direction using central differences.


getPartialDiffY

protected void getPartialDiffY()
Calculate first order partial derivative in y-direction using central differences.


getPartialDiffX_forward

protected void getPartialDiffX_forward()
Calculate first order partial derivative in x-direction using forward differences.


getPartialDiffY_forward

protected void getPartialDiffY_forward()
Calculate first order partial derivative in y-direction using forward differences.


getPartialDiffX_sobel

protected void getPartialDiffX_sobel()
Calculate first order partial derivative in x-direction using Sobel.


getPartialDiffY_sobel

protected void getPartialDiffY_sobel()
Calculate first order partial derivative in y-direction using Sobel.



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