public abstract class OrientedFilter2D extends MTBOperator implements Cloneable, 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 MTBImageWindow.BoundaryPadding |
paddingVariant
Padding variant in standard convolutional mode.
|
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) |
abstract OrientedFilter2D |
clone() |
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 |
setApplicationMode(OrientedFilter2D.ApplicationMode m)
Set application mode for the filter.
|
void |
setInputImage(MTBImage img)
Set input image to analyze.
|
void |
setPaddingVariant(MTBImageWindow.BoundaryPadding bp)
Set padding variant to be used in standard convolutional mode.
|
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="Image padding variant",
required=true,
dataIOOrder=-7,
direction=IN,
mode=ADVANCED,
description="Image padding variant in standard mode.")
protected MTBImageWindow.BoundaryPadding paddingVariant
The default value is set to zero padding for compatibility reasons. Note that ImgLib2 in FFT mode uses mirroring.
@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()
MTBOperatorThis 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 MTBOperatorpublic abstract OrientedFilter2D clone()
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.ALDOperatorde.unihalle.informatik.Alida.exceptions.ALDOperatorExceptionde.unihalle.informatik.Alida.exceptions.ALDProcessingDAGExceptionpublic void setInputImage(MTBImage img)
img - Input image.public void setAngle(double _angle)
_angle - Orientation to use.public void setApplicationMode(OrientedFilter2D.ApplicationMode m)
m - Mode in which the filter should run.public void setPaddingVariant(MTBImageWindow.BoundaryPadding bp)
Note that in FFT mode always mirroring along the image edges is applied.
bp - Padding variant to be applied.public OrientedFilter2D.ApplicationMode getApplicationMode()
public MTBImageDouble getResultImage()
public void addStatusListener(loci.common.StatusListener statuslistener)
addStatusListener in interface loci.common.StatusReporterpublic void notifyListeners(loci.common.StatusEvent e)
notifyListeners in interface loci.common.StatusReporterpublic void removeStatusListener(loci.common.StatusListener statuslistener)
removeStatusListener in interface loci.common.StatusReporterCopyright © 2010–2025 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.