![]() |
open_iA
2019.12
A tool for the visual analysis and processing of volumetric datasets, with a focus on industrial computed tomography.
|
Base class for image filters Derived classes should: More...
#include <iAFilter.h>
Public Member Functions | |
| void | addInput (iAConnector *con) |
| Adds an image as input. More... | |
| void | addMsg (QString msg) |
| Adds some message to the targeted output place for this filter Typically this will go into the log window of the result MdiChild. More... | |
| void | addOutputValue (QString const &name) |
| Adds an output value name. More... | |
| void | addOutputValue (QString const &name, QVariant value) |
| Adds an output value. More... | |
| void | addParameter (QString const &name, iAValueType valueType, QVariant defaultValue=0.0, double min=std::numeric_limits< double >::lowest(), double max=std::numeric_limits< double >::max()) |
| Adds the description of a parameter to the filter. More... | |
| QString | category () const |
| Retrieve the filter category (if sub-categories were specified, this only returns the first one) More... | |
| virtual bool | checkParameters (QMap< QString, QVariant > ¶meters) |
| Check whether the filter can be run with the given parameters. More... | |
| void | clearInput () |
| Clears the list of input images to this filter. More... | |
| QString | description () const |
| Retrieve the filter description. More... | |
| unsigned int | firstInputChannels () const |
| returns the number of input channels from the first input image More... | |
| QString | fullCategory () const |
| Retrieve the full category string (just as specified in the constructor) More... | |
| iAFilter (QString const &name, QString const &category, QString const &description="", unsigned int requiredInputs=1, unsigned int outputCount=1) | |
| Constructor initializing name, category and description of the filter. More... | |
| const QVector< iAConnector * > & | input () |
| input/output connectors More... | |
| QString | inputName (int i) const |
| Retrieve the name of the input image with index i. More... | |
| itk::ImageIOBase::IOComponentType | inputPixelType () const |
| iALogger * | logger () |
| QString | name () const |
| Retrieve the filter name. More... | |
| const QVector< iAConnector * > & | output () |
| int | outputCount () const |
| The planned number of outputs the filter will produce. More... | |
| QString | outputName (int i, QString defaultName=QString()) const |
| Retrieve the name of the output image with index i. More... | |
| const QVector< QString > & | outputValueNames () const |
| Retrieve a list of names of the output values that this filter can produce. More... | |
| const QVector< QPair< QString, QVariant > > & | outputValues () const |
| retrieve a list of output values More... | |
| const QVector< pParameter > & | parameters () const |
| Retrieve a list of the filter parameters. More... | |
| vtkSmartPointer< vtkPolyData > | polyOutput () const |
| Retrieves output mesh if existing. More... | |
| iAProgress * | progress () |
| Retrieve the progress reporting object for this filter. More... | |
| int | requiredInputs () const |
| Returns the number of image inputs required by this filter. More... | |
| bool | run (QMap< QString, QVariant > const ¶meters) |
| Initialize and run the filter. More... | |
| void | setFirstInputChannels (unsigned int c) |
| sets the first input channels More... | |
| void | setLogger (iALogger *logger) |
| Set the logger to be used for status output / error messages. More... | |
| void | setPolyOutput (vtkSmartPointer< vtkPolyData > poly) |
| Sets the mesh output of this filter. More... | |
| void | setProgress (iAProgress *progress) |
| Set the facility for progress reporting. More... | |
| virtual | ~iAFilter () |
| Destructor. More... | |
| void | addOutput (itk::ImageBase< 3 > *img) |
| void | addOutput (vtkSmartPointer< vtkImageData > img) |
Protected Member Functions | |
| void | setInputName (int i, QString const &name) |
| Set the name of the input with the given index. More... | |
| void | setOutputName (int i, QString const &name) |
| Set the name of the output with the given index. More... | |
Base class for image filters Derived classes should:
| iAFilter::iAFilter | ( | QString const & | name, |
| QString const & | category, | ||
| QString const & | description = "", |
||
| unsigned int | requiredInputs = 1, |
||
| unsigned int | outputCount = 1 |
||
| ) |
Constructor initializing name, category and description of the filter.
| name | The name of the filter. It will be used in its menu entry, as part of the title of the result window, and as title for the parameter selection dialog. |
| category | The filter category. It will be used for putting the filter into a fitting submenu and for categorizing the filter parameters when storing them in the registry you can use the slash character ("/") to specify subcategories. A category of "Segmentation/Global Thresholding" for example would put menu, which in turn is added as submenu to the Filter menu. When left empty, the filter will be added directly in the Filter menu |
| description | An (optional) description of the filter algorithm, and ideally its settings. Can contain HTML (e.g. links) |
| requiredInputs | The number of inputs required for this filter; by default, filters are assumed to require exactly one input image; you can override the number of inputs required for your filter with this parameter |
| outputCount | the number of outputs this filter creates. Set it to 0 to disable image output. If you don't know this yet at the time of creating the filter (because it for example depends on the number of input images or the parameters), you can always adapt it at a later point (e.g. during iAFilter::Run) by calling SetOutputCount; but if you have some image output, make sure that you leave it at the default value of 1 or set it to some value other than zero, because setting it to zero has immediate side effects (e.g. not opening a result window if configured, in the GUI). |
|
virtual |
Destructor.
| void iAFilter::addInput | ( | iAConnector * | con | ) |
Adds an image as input.
| void iAFilter::addMsg | ( | QString | msg | ) |
Adds some message to the targeted output place for this filter Typically this will go into the log window of the result MdiChild.
| msg | the message to print |
| void iAFilter::addOutput | ( | itk::ImageBase< 3 > * | img | ) |
Adds an output image
| img | output image from the filter |
| void iAFilter::addOutput | ( | vtkSmartPointer< vtkImageData > | img | ) |
| void iAFilter::addOutputValue | ( | QString const & | name | ) |
Adds an output value name.
Call this method in the constructor of derived classes, to let the filter know which output values will later be added via the addOutputValue method with two parameters
| name | the name of the output value |
| void iAFilter::addOutputValue | ( | QString const & | name, |
| QVariant | value | ||
| ) |
Adds an output value.
| name | the name of the output value |
| value | the actual output value |
| void iAFilter::addParameter | ( | QString const & | name, |
| iAValueType | valueType, | ||
| QVariant | defaultValue = 0.0, |
||
| double | min = std::numeric_limits<double>::lowest(), |
||
| double | max = std::numeric_limits<double>::max() |
||
| ) |
Adds the description of a parameter to the filter.
| name | the parameter's name |
| valueType | the type of value this parameter can have |
| defaultValue | the default value of the parameter; for Categorical valueTypes, this should be the list of possible values |
| min | the minimum value this parameter can have (inclusive). |
| max | the maximum value this parameter can have (inclusive) |
| QString iAFilter::category | ( | ) | const |
Retrieve the filter category (if sub-categories were specified, this only returns the first one)
|
virtual |
Check whether the filter can be run with the given parameters.
If you need to perform special checks on your parameters, override this method. The standard implementation here just checks parameters with Discrete and Continuous value type for minimum and maximum values.
| parameters | the generic list of parameters that the filter will be called with |
| void iAFilter::clearInput | ( | ) |
Clears the list of input images to this filter.
Call this in case you are re-using a filter already called before, and you want to call it with new input images
| QString iAFilter::description | ( | ) | const |
Retrieve the filter description.
| unsigned int iAFilter::firstInputChannels | ( | ) | const |
returns the number of input channels from the first input image
| QString iAFilter::fullCategory | ( | ) | const |
Retrieve the full category string (just as specified in the constructor)
| const QVector< iAConnector * > & iAFilter::input | ( | ) |
input/output connectors
| QString iAFilter::inputName | ( | int | i | ) | const |
Retrieve the name of the input image with index i.
| itk::ImageIOBase::IOComponentType iAFilter::inputPixelType | ( | ) | const |
| iALogger * iAFilter::logger | ( | ) |
| QString iAFilter::name | ( | ) | const |
Retrieve the filter name.
| const QVector< iAConnector * > & iAFilter::output | ( | ) |
| int iAFilter::outputCount | ( | ) | const |
The planned number of outputs the filter will produce.
| QString iAFilter::outputName | ( | int | i, |
| QString | defaultName = QString() |
||
| ) | const |
Retrieve the name of the output image with index i.
| const QVector< QString > & iAFilter::outputValueNames | ( | ) | const |
Retrieve a list of names of the output values that this filter can produce.
| const QVector< QPair< QString, QVariant > > & iAFilter::outputValues | ( | ) | const |
retrieve a list of output values
| const QVector< pParameter > & iAFilter::parameters | ( | ) | const |
Retrieve a list of the filter parameters.
| vtkSmartPointer< vtkPolyData > iAFilter::polyOutput | ( | ) | const |
Retrieves output mesh if existing.
| iAProgress * iAFilter::progress | ( | ) |
Retrieve the progress reporting object for this filter.
| int iAFilter::requiredInputs | ( | ) | const |
Returns the number of image inputs required by this filter.
for typical image filters, this returns 1.
| bool iAFilter::run | ( | QMap< QString, QVariant > const & | parameters | ) |
Initialize and run the filter.
| parameters | the map of parameters to use in this specific filter run |
| void iAFilter::setFirstInputChannels | ( | unsigned int | c | ) |
sets the first input channels
|
protected |
Set the name of the input with the given index.
| void iAFilter::setLogger | ( | iALogger * | logger | ) |
Set the logger to be used for status output / error messages.
|
protected |
Set the name of the output with the given index.
| void iAFilter::setPolyOutput | ( | vtkSmartPointer< vtkPolyData > | poly | ) |
Sets the mesh output of this filter.
| void iAFilter::setProgress | ( | iAProgress * | progress | ) |
Set the facility for progress reporting.
1.8.16