public abstract class OrientedFilter2D extends MTBOperator implements loci.common.StatusReporter
This operator supports two modes how to compute the convolution.
The first mode 'STANDARD' is based on the plain implementation of
a convolution, i.e. relies on class LinearFilter
.
The second mode 'FFT' makes use of the fast implementations of
convolutions available in ImgLib2. In particular, we apply FFT
convolution which is almost two times faster than the implementation
of linear filtering from scratch to be found in
OrientedFilter2D
.
Please note that the energy of the input image might be changed by the convolution if mode 'FFT' is applied since the masks of the anisotropic kernels are normalized to a sum of zero rather than 1 as usual.
The code for convolving the input image is leaned on example 6b to be found at the ImgLib2 web page.
Modifier and Type | Class and Description |
---|---|
static class |
OrientedFilter2D.ApplicationMode
Modes how to apply the filter to an image.
|
Modifier and Type | Field and Description |
---|---|
protected Double |
angle
Orientation of the filter.
|
protected MTBImage |
inputImg
Input image to process.
|
protected OrientedFilter2D.ApplicationMode |
mode
Mode of application.
|
protected MTBImageDouble |
resultImg
Filtered image.
|
protected Vector<loci.common.StatusListener> |
statusListeners
Vector of installed objects of type
StatusListener . |
Constructor and Description |
---|
OrientedFilter2D()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addStatusListener(loci.common.StatusListener statuslistener) |
OrientedFilter2D.ApplicationMode |
getApplicationMode()
Get application mode.
|
abstract MTBImageDouble |
getKernel(double _angle)
Calculates kernel for the given orientation.
|
MTBImageDouble |
getResultImage()
Get result image.
|
void |
notifyListeners(loci.common.StatusEvent e) |
protected void |
operate() |
protected Object |
readResolve()
Init function for deserialized objects.
|
void |
removeStatusListener(loci.common.StatusListener statuslistener) |
void |
setAngle(double _angle)
Set orientation of filter.
|
void |
setInputImage(MTBImage img)
Set input image to analyze.
|
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, dataIOOrder=-10, direction=IN, mode=STANDARD, description="Input image.") protected transient MTBImage inputImg
@Parameter(label="Orientation", required=true, dataIOOrder=-9, direction=IN, mode=STANDARD, description="Orientation of the filter to apply (in degrees).") protected Double angle
@Parameter(label="Application Mode", required=true, dataIOOrder=-8, direction=IN, mode=ADVANCED, description="Computation mode.") protected OrientedFilter2D.ApplicationMode mode
@Parameter(label="Result Image", dataIOOrder=-10, direction=OUT, description="Result image.") protected transient MTBImageDouble resultImg
protected transient Vector<loci.common.StatusListener> statusListeners
StatusListener
.public OrientedFilter2D() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
- Thrown in case of failure.protected Object readResolve()
MTBOperator
This function is called on an instance of this class being deserialized from file, prior to handing the instance over to the user. It takes care of a proper initialization of transient member variables as they are not initialized to the default values during deserialization.
readResolve
in class MTBOperator
public abstract MTBImageDouble getKernel(double _angle)
_angle
- Orientation of filter (in degrees).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.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
public void setInputImage(MTBImage img)
img
- Input image.public void setAngle(double _angle)
_angle
- Orientation to use.public OrientedFilter2D.ApplicationMode getApplicationMode()
public MTBImageDouble getResultImage()
public void addStatusListener(loci.common.StatusListener statuslistener)
addStatusListener
in interface loci.common.StatusReporter
public void notifyListeners(loci.common.StatusEvent e)
notifyListeners
in interface loci.common.StatusReporter
public void removeStatusListener(loci.common.StatusListener statuslistener)
removeStatusListener
in interface loci.common.StatusReporter
Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.