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

#include <cxFilterImpl.h>

Inheritance diagram for cx::FilterImpl:
cx::Filter 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)
 
- Public Slots inherited from cx::Filter
virtual void requestSetPresetSlot (QString name)=0
 

Public Member Functions

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

Protected Member Functions

 FilterImpl (VisServicesPtr services)
 
ImagePtr getCopiedInputImage (int index=0)
 
void updateThresholdFromImageChange (QString uid, DoublePropertyPtr threshold)
 
void updateThresholdPairFromImageChange (QString uid, DoublePairPropertyPtr threshold)
 
virtual void createOptions ()=0
 
virtual void createInputTypes ()=0
 
virtual void createOutputTypes ()=0
 
PatientModelServicePtr patientService ()
 

Protected Attributes

std::vector< SelectDataStringPropertyBasePtrmInputTypes
 
std::vector< SelectDataStringPropertyBasePtrmOutputTypes
 
std::vector< PropertyPtrmOptionsAdapters
 
QDomElement mOptions
 
std::vector< DataPtrmCopiedInput
 
QDomElement mCopiedOptions
 
bool mActive
 
VisServicesPtr mServices
 

Additional Inherited Members

- Signals inherited from cx::Filter
void changed ()
 

Detailed Description

Helper implementation for Filter.

Inherit from this class to get access to useful functionality common to Filter descendants.

Date
Nov 21, 2012
Author
Christian Askeland, SINTEF

Definition at line 36 of file cxFilterImpl.h.

Constructor & Destructor Documentation

◆ ~FilterImpl()

virtual cx::FilterImpl::~FilterImpl ( )
inlinevirtual

Definition at line 41 of file cxFilterImpl.h.

◆ FilterImpl()

cx::FilterImpl::FilterImpl ( VisServicesPtr  services)
explicitprotected

Definition at line 25 of file cxFilterImpl.cpp.

Member Function Documentation

◆ createInputTypes()

◆ createOptions()

◆ createOutputTypes()

◆ generatePresetFromCurrentlySetOptions()

virtual QDomElement cx::FilterImpl::generatePresetFromCurrentlySetOptions ( QString  name)
inlinevirtual

Generates a preset from the filters currently set options.

Implements cx::Filter.

Definition at line 50 of file cxFilterImpl.h.

◆ getCopiedInputImage()

ImagePtr cx::FilterImpl::getCopiedInputImage ( int  index = 0)
protected

Helper: Return the index'th input type as an image. Return zero if not available (as image).

Definition at line 104 of file cxFilterImpl.cpp.

◆ getInputTypes()

std::vector< SelectDataStringPropertyBasePtr > cx::FilterImpl::getInputTypes ( )
virtual

List of input arguments.

Implements cx::Filter.

Definition at line 59 of file cxFilterImpl.cpp.

◆ getOptions()

std::vector< PropertyPtr > cx::FilterImpl::getOptions ( )
virtual

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

Implements cx::Filter.

Definition at line 50 of file cxFilterImpl.cpp.

◆ getOutputTypes()

std::vector< SelectDataStringPropertyBasePtr > cx::FilterImpl::getOutputTypes ( )
virtual

Return a help text describing algorithm usage.

Implements cx::Filter.

Definition at line 69 of file cxFilterImpl.cpp.

◆ getPresets()

virtual PresetsPtr cx::FilterImpl::getPresets ( )
inlinevirtual

Returns the filters presets.

Implements cx::Filter.

Definition at line 49 of file cxFilterImpl.h.

◆ getUid()

QString cx::FilterImpl::getUid ( ) const
virtual

Return a unique string for this algorithm.

Implements cx::Filter.

Definition at line 35 of file cxFilterImpl.cpp.

◆ hasPresets()

virtual bool cx::FilterImpl::hasPresets ( )
inlinevirtual

Checks wheter the filter has defined a set of presets.

Implements cx::Filter.

Definition at line 48 of file cxFilterImpl.h.

◆ initialize()

void cx::FilterImpl::initialize ( QDomElement  root,
QString  uid = "" 
)
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.

Implements cx::Filter.

Definition at line 42 of file cxFilterImpl.cpp.

◆ patientService()

PatientModelServicePtr cx::FilterImpl::patientService ( )
protected

Definition at line 30 of file cxFilterImpl.cpp.

◆ preProcess()

bool cx::FilterImpl::preProcess ( )
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.

Implements cx::Filter.

Reimplemented in cx::AirwaysFilter, cx::BinaryThresholdImageFilter, cx::ContourFilter, cx::BinaryThinningImageFilter3DFilter, and cx::DilationFilter.

Definition at line 85 of file cxFilterImpl.cpp.

◆ requestSetPresetSlot

virtual void cx::FilterImpl::requestSetPresetSlot ( QString  name)
inlinevirtualslot

Definition at line 55 of file cxFilterImpl.h.

◆ setActive()

void cx::FilterImpl::setActive ( bool  on)
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.

Implements cx::Filter.

Reimplemented in cx::BinaryThresholdImageFilter, and cx::ContourFilter.

Definition at line 79 of file cxFilterImpl.cpp.

◆ updateThresholdFromImageChange()

void cx::FilterImpl::updateThresholdFromImageChange ( QString  uid,
DoublePropertyPtr  threshold 
)
protected

Helper: Call if you have an image threshold Property that need update from an image change.

Definition at line 111 of file cxFilterImpl.cpp.

◆ updateThresholdPairFromImageChange()

void cx::FilterImpl::updateThresholdPairFromImageChange ( QString  uid,
DoublePairPropertyPtr  threshold 
)
protected

Definition at line 129 of file cxFilterImpl.cpp.

Member Data Documentation

◆ mActive

bool cx::FilterImpl::mActive
protected

Definition at line 81 of file cxFilterImpl.h.

◆ mCopiedInput

std::vector<DataPtr> cx::FilterImpl::mCopiedInput
protected

Definition at line 79 of file cxFilterImpl.h.

◆ mCopiedOptions

QDomElement cx::FilterImpl::mCopiedOptions
protected

Definition at line 80 of file cxFilterImpl.h.

◆ mInputTypes

std::vector<SelectDataStringPropertyBasePtr> cx::FilterImpl::mInputTypes
protected

Definition at line 73 of file cxFilterImpl.h.

◆ mOptions

QDomElement cx::FilterImpl::mOptions
protected

Definition at line 76 of file cxFilterImpl.h.

◆ mOptionsAdapters

std::vector<PropertyPtr> cx::FilterImpl::mOptionsAdapters
protected

Definition at line 75 of file cxFilterImpl.h.

◆ mOutputTypes

std::vector<SelectDataStringPropertyBasePtr> cx::FilterImpl::mOutputTypes
protected

Definition at line 74 of file cxFilterImpl.h.

◆ mServices

VisServicesPtr cx::FilterImpl::mServices
protected

Definition at line 82 of file cxFilterImpl.h.


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