NorMIT-nav  2023.01.05-dev+develop.0da12
An IGT application
cx::Filter Class Referenceabstract

#include <cxFilter.h>

Inheritance diagram for cx::Filter:
cx::FilterImpl cx::AccusurfFilter cx::AirwaysFilter cx::AirwaysFromCenterlineFilter cx::BinaryThinningImageFilter3DFilter cx::BinaryThresholdImageFilter cx::ColorVariationFilter cx::ContourFilter cx::DilationFilter cx::DummyFilter cx::GenericScriptFilter cx::ResampleImageFilter cx::RouteToTargetFilter cx::SmoothingImageFilter

Public Slots

virtual void requestSetPresetSlot (QString name)=0
 

Signals

void changed ()
 

Public Member Functions

 Filter ()
 
virtual ~Filter ()
 
virtual QString getUid () const =0
 
virtual void initialize (QDomElement root, QString uid="")=0
 
virtual QString getType () const =0
 
virtual QString getName () const =0
 
virtual QString getHelp () const =0
 
virtual std::vector< PropertyPtrgetOptions ()=0
 
virtual std::vector< SelectDataStringPropertyBasePtrgetInputTypes ()=0
 
virtual std::vector< SelectDataStringPropertyBasePtrgetOutputTypes ()=0
 
virtual bool hasPresets ()=0
 
virtual PresetsPtr getPresets ()=0
 
virtual QDomElement generatePresetFromCurrentlySetOptions (QString name)=0
 
virtual void setActive (bool on)=0
 
virtual bool preProcess ()=0
 
virtual bool execute ()=0
 
virtual bool postProcess ()=0
 

Detailed Description

Base class for CustusX filters/algorithms

Intended for use in a multithreaded environment.

The methods getHelp(), getName(), getInputTypes(), getOutputTypes(), getOptions() can be used outside of actual filter execution for initialization and gui interaction.

preProcess(), execute() and postProcess() must be called in sequence and together executes the algorithm. They work on a copy of the input data (the input volumes themselved are not copied, only pointers and options).

Date
Nov 16, 2012
Author
christiana

Definition at line 50 of file cxFilter.h.

Constructor & Destructor Documentation

◆ Filter()

cx::Filter::Filter ( )

Definition at line 17 of file cxFilter.cpp.

◆ ~Filter()

virtual cx::Filter::~Filter ( )
inlinevirtual

Definition at line 56 of file cxFilter.h.

Member Function Documentation

◆ changed

void cx::Filter::changed ( )
signal

Signals that the filters internal structures has changed.

◆ execute()

virtual bool cx::Filter::execute ( )
pure virtual

Execute filter with the given inputs and produce an output. This method is threadable - can be executed in a secondary thread. Assumes preprocess has been called.

Returns
success.

Implemented in cx::GenericScriptFilter, cx::AirwaysFilter, cx::RouteToTargetFilter, cx::AirwaysFromCenterlineFilter, cx::AccusurfFilter, cx::BinaryThresholdImageFilter, cx::ContourFilter, cx::ColorVariationFilter, cx::BinaryThinningImageFilter3DFilter, cx::SmoothingImageFilter, cx::DummyFilter, cx::ResampleImageFilter, and cx::DilationFilter.

◆ generatePresetFromCurrentlySetOptions()

virtual QDomElement cx::Filter::generatePresetFromCurrentlySetOptions ( QString  name)
pure virtual

Generates a preset from the filters currently set options.

Implemented in cx::FilterImpl.

◆ getHelp()

◆ getInputTypes()

virtual std::vector<SelectDataStringPropertyBasePtr> cx::Filter::getInputTypes ( )
pure virtual

List of input arguments.

Implemented in cx::FilterImpl.

◆ getName()

◆ getOptions()

virtual std::vector<PropertyPtr> cx::Filter::getOptions ( )
pure virtual

Fill options for this algorithm. The options use the input xml noe from init to fill.

Implemented in cx::FilterImpl.

◆ getOutputTypes()

virtual std::vector<SelectDataStringPropertyBasePtr> cx::Filter::getOutputTypes ( )
pure virtual

Return a help text describing algorithm usage.

Implemented in cx::FilterImpl.

◆ getPresets()

virtual PresetsPtr cx::Filter::getPresets ( )
pure virtual

Returns the filters presets.

Implemented in cx::FilterImpl.

◆ getType()

◆ getUid()

virtual QString cx::Filter::getUid ( ) const
pure virtual

Return a unique string for this algorithm.

Implemented in cx::FilterImpl.

◆ hasPresets()

virtual bool cx::Filter::hasPresets ( )
pure virtual

Checks wheter the filter has defined a set of presets.

Implemented in cx::FilterImpl.

◆ initialize()

virtual void cx::Filter::initialize ( QDomElement  root,
QString  uid = "" 
)
pure virtual

Initialize algorithm Fill options for this algorithm. Input is the root node for this algo, filled with stored settings (if any).

Set uid - if no uid is given, a default based on class name is used.

Implemented in cx::FilterImpl.

◆ postProcess()

virtual bool cx::Filter::postProcess ( )
pure virtual

Perform postprocessing tasks and set result from calculation into the output adapters.

Must be called from the main thread. Assumes execute() has been called.

Returns
success.

Implemented in cx::GenericScriptFilter, cx::AirwaysFilter, cx::RouteToTargetFilter, cx::AirwaysFromCenterlineFilter, cx::AccusurfFilter, cx::BinaryThresholdImageFilter, cx::ContourFilter, cx::ColorVariationFilter, cx::BinaryThinningImageFilter3DFilter, cx::SmoothingImageFilter, cx::DummyFilter, cx::ResampleImageFilter, and cx::DilationFilter.

◆ preProcess()

virtual bool cx::Filter::preProcess ( )
pure virtual

Perform main thread preprocessing. Copies input data from options and the input adapters into thread-safe storage. Assumes getOptions(), getInputTypes(), getOutputTypes() has been called (this initializes options)

Returns
success.

Implemented in cx::AirwaysFilter, cx::FilterImpl, cx::BinaryThresholdImageFilter, cx::ContourFilter, cx::BinaryThinningImageFilter3DFilter, and cx::DilationFilter.

◆ requestSetPresetSlot

virtual void cx::Filter::requestSetPresetSlot ( QString  name)
pure virtualslot

Ask the filter to load a preset.

◆ setActive()

virtual void cx::Filter::setActive ( bool  on)
pure virtual

Set Active state. Active filters are used by the ui (or similar) and can interact with the system, for example by showing a preview.

Inactive filters should no interact with the system.

Implemented in cx::FilterImpl, cx::BinaryThresholdImageFilter, and cx::ContourFilter.


The documentation for this class was generated from the following files: