CustusX  15.3.3-beta
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cx::Filter Class Referenceabstract

#include <cxFilter.h>

Inheritance diagram for cx::Filter:
cx::FilterImpl cx::BinaryThinningImageFilter3DFilter cx::BinaryThresholdImageFilter cx::ContourFilter cx::DilationFilter cx::DummyFilter cx::LevelSetFilter cx::ResampleImageFilter cx::RouteToTargetFilter cx::SmoothingImageFilter cx::TubeSegmentationFilter

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
< SelectDataStringPropertyBasePtr
getInputTypes ()=0
 
virtual std::vector
< SelectDataStringPropertyBasePtr
getOutputTypes ()=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 71 of file cxFilter.h.

Constructor & Destructor Documentation

cx::Filter::Filter ( )

Definition at line 38 of file cxFilter.cpp.

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

Definition at line 77 of file cxFilter.h.

Member Function Documentation

void cx::Filter::changed ( )
signal

Signals that the filters internal structures has changed.

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.

Parameters
inputList of data inputs corresponding to getInputTypes()
settingsReference to settings file containing algorithm-specific settings
Returns
success.

Implemented in cx::TubeSegmentationFilter, cx::RouteToTargetFilter, cx::BinaryThresholdImageFilter, cx::ContourFilter, cx::LevelSetFilter, cx::BinaryThinningImageFilter3DFilter, cx::SmoothingImageFilter, cx::DummyFilter, cx::ResampleImageFilter, and cx::DilationFilter.

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

Generates a preset from the filters currently set options.

Implemented in cx::TubeSegmentationFilter, and cx::FilterImpl.

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

List of input arguments.

Implemented in cx::FilterImpl.

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.

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

Return a help text describing algorithm usage.

Implemented in cx::FilterImpl.

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

Returns the filters presets.

Implemented in cx::TubeSegmentationFilter, and cx::FilterImpl.

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

Return a unique string for this algorithm.

Implemented in cx::FilterImpl.

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

Checks wheter the filter has defined a set of presets.

Implemented in cx::TubeSegmentationFilter, and cx::FilterImpl.

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.

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::TubeSegmentationFilter, cx::RouteToTargetFilter, cx::BinaryThresholdImageFilter, cx::ContourFilter, cx::LevelSetFilter, cx::BinaryThinningImageFilter3DFilter, cx::SmoothingImageFilter, cx::DummyFilter, cx::ResampleImageFilter, and cx::DilationFilter.

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)

Parameters
outputPathis path to data files for current patient.
Returns
success.

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

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

Ask the filter to load a preset.

Implemented in cx::TubeSegmentationFilter.

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, cx::ContourFilter, and cx::LevelSetFilter.


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