Extensible Processing Component

From user's Wiki!
Jump to: navigation, search

New processing filters can be added to the framework to process data. The processing component uses the Data component to retrieve the required data representation of the filter.

The basic class of this component is called BaseFilter. It has a set of input and output ports that can be configured depending on the requirements of the filter. Some of these features include:

  • Data filtering: For example a filter requires an image as input with modality MRI
  • 3D+T configuration: Allows configuring the input as a single time step or all available time steps. This selection allow to process a filter multiple times for all time steps.

A port uses a DataEntity holder to hold the DataEntity. This DataHolder is an implementation of the subject-observer pattern that notifies observers when the DataEntity changes. Furthermore, two holders can be connected to create a pipeline of notifications.

BaseProcessor is the class you need to use if you need to add a new filter to the framework. This class provides the set of functions you need to use to retrieve input data and update output data.

Rendering tags

When a processor creates a new DataEntity and this data is added to the rendering tree, the default rendering properties are applied. But you can use meta data to set specific rendering properties, like opacity or window level. When the DataEntity is added to the rendering tree, the metadata is scanned and all properties are converted to the specific rendering library (like MITK). All the rendering properties stored in the metadata will be automatically stored in disk when the data is saved. Next time the data is opened, the properties will be restored.

To use this property, you should pass a blTagMap::Pointer to the UpdateOutput( ) function with the properties you want to apply.

Processor Observer

A processor output observer is observing the state of the output of a processor. When the output is modified, the observer can take some default actions, like adding the data to the Data Tree.

Usually, the parameters of the observer are changed on the OnInit() function of your panel widget associated with your processor. The default behavior of the processor observer is to hide the input and publish the output to the global data tree and the active rendering tree. To avoid hiding the input, you should call the function SetHideInput( false ). To change the opacity of the output data, you need to call the function PushProperty( ).

GetProcessorOutputObserver(0)->SetHideInput( false );
GetProcessorOutputObserver(0)->PushProperty(blTag::New( "opacity", 0.5 ));

You can read more details in GmKernel#Output_Observer.

UML class diagram and source code

You can read implementation details in GmFiltering and see example implementations in Image Tools Plugin, Mesh Editor Plugin or Signal Viewer Plugin.

Go back to GIMIAS Architecture