@ALDAOperator(genericExecutionMode=ALL,
level=APPLICATION)
public class OrientedFilter2DBatchAnalyzer
extends MTBOperator
implements loci.common.StatusReporter
The operator applies a given oriented filter in different orientations to the given image. Subsequently all filter responses are merged into a final result using the specified mode for joining.
The computational effort of this operator depends on its configuration. You can configure the oriented filter to be applied via standard convolutions or make use of its FFT mode where ImgLib2 is used to transform image and filter mask into the fourier space first. The FFT mode speeds-up calculations to approximately half of the processing time of an ordinary convolution, of course depending on image and mask sizes. ImgLib2 internally relies on parallelization of calculations.
Besides configuring the oriented filter you can further turn on parallelization for this batch processing operator. In parallelization mode all convolutions are organized in a stream and processed in parallel. Compared to sequential processing this yields a speed-up by a factor of approximately 5 (for common configurations with filter masks of moderate sizes). However, note that running the oriented filters in FFT mode and also activating parallelization does not lead to further speed-ups. The FFT mode already includes parallelization and these collide to a certain degree with the parallel execution of different convolutions.
The largest performance gain for common configurations is to be expected by running the filters in standard convolutional mode and activating parallelization in this filter.
| Modifier and Type | Class and Description |
|---|---|
static class |
OrientedFilter2DBatchAnalyzer.JoinMode
Method for joining the results from the various orientations.
|
| Modifier and Type | Field and Description |
|---|---|
protected double |
angleSampling
Angular sampling step size.
|
protected MTBImage |
inputImg
Input image to process.
|
protected OrientedFilter2DBatchAnalyzer.JoinMode |
jMode
Mode for joining results from different orientations.
|
protected double |
maxAngle
Maximal orientation where to end.
|
private MTBImageByte |
maxIndexMap
Map of indices of maximal responses.
|
protected double |
minAngle
Minimal orientation from where to start.
|
protected OrientedFilter2D |
oFilter
Oriented filter to apply.
|
private static String |
operatorID
Identifier string for this operator class.
|
protected MTBImageDouble |
responseStack
Stack with filter responses of all orientations.
|
protected MTBImageDouble |
resultImg
Result image.
|
protected MTBBooleanData |
runParallel
Flag to disable/enable parallel execution of convolutional filters.
|
protected Vector<loci.common.StatusListener> |
statusListeners
Vector of installed StatusListeners.
|
| Constructor and Description |
|---|
OrientedFilter2DBatchAnalyzer()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addStatusListener(loci.common.StatusListener statuslistener) |
MTBImageDouble |
getFilterResponseStack()
Get individual filter responses.
|
MTBImageByte |
getIndexMap()
Get map of indices of maximal responses.
|
MTBImageDouble |
getResultImage()
Get result image.
|
void |
notifyListeners(loci.common.StatusEvent e) |
protected void |
operate() |
void |
removeStatusListener(loci.common.StatusListener statuslistener) |
void |
setAngleSampling(double s)
Set angular sampling interval.
|
void |
setInputImage(MTBImage img)
Specify the input image.
|
void |
setMaxAngle(double max)
Specify maximal angle to apply.
|
void |
setMinAngle(double min)
Specify minimal angle to apply.
|
void |
setOrientedFilter(OrientedFilter2D filter)
Specify the oriented filter to apply.
|
void |
setRunParallel(boolean flag)
Enable/disable parallel execution mode based on streams.
|
void |
setRunParallel(MTBBooleanData flag)
Enable/disable parallel execution mode based on streams.
|
readResolveaddOperatorExecutionProgressEventListener, 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, writeHistoryprivate static final String operatorID
protected transient Vector<loci.common.StatusListener> statusListeners
@Parameter(label="Input Image",
required=true,
direction=IN,
mode=STANDARD,
description="Input image.",
dataIOOrder=0)
protected transient MTBImage inputImg
@Parameter(label="Oriented Filter",
required=true,
direction=IN,
mode=STANDARD,
description="Oriented Filter to Apply.",
dataIOOrder=1)
protected OrientedFilter2D oFilter
@Parameter(label="Minimal Orientation",
required=true,
dataIOOrder=2,
direction=IN,
mode=ADVANCED,
description="Minimal orientation to consider (in degrees).")
protected double minAngle
@Parameter(label="Maximal Orientation",
required=true,
dataIOOrder=3,
direction=IN,
mode=ADVANCED,
description="Maximal orientation to consider (in degrees).")
protected double maxAngle
@Parameter(label="Angular Sampling Steps",
required=true,
direction=IN,
mode=ADVANCED,
description="Angular sampling step size (in degrees).",
dataIOOrder=4)
protected double angleSampling
@Parameter(label="Join Mode",
required=true,
dataIOOrder=5,
direction=IN,
mode=ADVANCED,
description="Mode for joining different orientation responses.")
protected OrientedFilter2DBatchAnalyzer.JoinMode jMode
@Parameter(label="Run in Parallel?",
required=true,
dataIOOrder=6,
direction=IN,
mode=ADVANCED,
description="Activate/deactivate parallel execution of filter convolutions.")
protected MTBBooleanData runParallel
Attention: Running the oriented filters in FFT mode already makes extensive use of parallelization. Thus, there is no additional speed-up to be expected by activating parallelization here as well.
@Parameter(label="Result Image",
dataIOOrder=0,
direction=OUT,
description="Result image.")
protected transient MTBImageDouble resultImg
@Parameter(label="Filter Response Stack",
dataIOOrder=1,
direction=OUT,
description="Filter response stack.")
protected transient MTBImageDouble responseStack
private transient MTBImageByte maxIndexMap
The map is available after running the operator. Note that this is not an operator parameter because it is only useful internally for some vessel filters.
public OrientedFilter2DBatchAnalyzer()
throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException - Thrown in case of failure.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 - Image to process.public void setOrientedFilter(OrientedFilter2D filter)
filter - Pre-configured filter object.public void setMinAngle(double min)
min - Value of angle in degrees.public void setMaxAngle(double max)
max - Maximal value of angle in degrees.public void setAngleSampling(double s)
s - Sampling interval in degrees.public void setRunParallel(boolean flag)
flag - If true, parallel processing is activated.public void setRunParallel(MTBBooleanData flag)
This function preserves consistency in the processing history by accepting only the wrapper data type instead of a pure boolean value.
flag - If true, parallel processing is activated.public MTBImageDouble getResultImage()
public MTBImageDouble getFilterResponseStack()
public MTBImageByte getIndexMap()
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.