MeVisLab Toolbox Reference
mlFileListFilterPluginBase.h
Go to the documentation of this file.
1// Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2// **InsertLicense** code
3//----------------------------------------------------------------------------------
5
10//----------------------------------------------------------------------------------
11#pragma once
12
13// Local includes
15
16// ML includes
17#include <mlModuleIncludes.h>
18
19// Collecting messages during calls.
20#include "mlFilterMessage.h"
21
22// DCMTree prototypes.
23#include <DCMTree_Lib.h>
24
25ML_START_NAMESPACE
26
27// Forward to internally used classes.
28namespace FileListTools {
29 class FileAttribute;
30}
31
32//----------------------------------------------------------------------------------
34//----------------------------------------------------------------------------------
36{
37public:
38
40 typedef std::map< std::string, FileListTools::FileAttribute > FileAttributeMap;
41
42
44 FileListFilterPluginBase(int numIns=0, int numOuts=0);
45
48
58 virtual void filterFile(FileListTools::FileAttribute &filterAttributes) const;
59
65 virtual void filterFile(FileListTools::FileAttribute &filterAttributes,
66 FilterMessageList *messageList) const;
67
77 virtual void postFilterAll(FileAttributeMap &filterAttributeMap) const;
78
84 virtual void postFilterAll(FileAttributeMap &filterAttributeMap,
85 FilterMessageList *messageList) const;
86
88 inline BaseField &getInputFilterPluginFld () const { return *_inputFilterPluginFld ; }
89 inline BaseField &getOutputFilterPluginFld () const { return *_outputFilterPluginFld; }
91
92protected:
93
96 void handleNotification(Field *field) override;
97
99 virtual BaseField &_getInputFilterPluginFld() { return *_inputFilterPluginFld; }
100
102 virtual BaseField &_getOutputFilterPluginFld() { return *_outputFilterPluginFld; }
103
105 virtual void _touchOutputFilterPluginFld() { _outputFilterPluginFld->touch(); }
106
112 FilterMessageList *messageList=nullptr) const;
113
118 virtual void _callInputPostFilter(FileAttributeMap &filterAttributeMap,
119 FilterMessageList *messageList=nullptr) const;
120
121private:
124 BaseField *_inputFilterPluginFld;
125
129 BaseField *_outputFilterPluginFld;
130
133};
134
137
138ML_END_NAMESPACE
Project global and OS specific declarations.
#define MLFILE_LIST_TOOLS_EXPORT
DLL export macro definition.
Field to encapsulate a pointer to an ML base object.
Definition mlFields.h:729
Base class for all fields used in the ML.
Definition mlField.h:73
A base class for plugins which can be used by file list importers to filter and classify files.
virtual BaseField & _getInputFilterPluginFld()
Return a reference to the _inputFilterPluginFld.
virtual BaseField & _getOutputFilterPluginFld()
Return a reference to the _outputFilterPluginFld.
virtual void postFilterAll(FileAttributeMap &filterAttributeMap) const
This virtual function is called by the FileListTools to provide the option of a post classification o...
virtual void postFilterAll(FileAttributeMap &filterAttributeMap, FilterMessageList *messageList) const
Alternative version of postFilterAll(FileAttributeMap &filterAttributeMap) which allows passing a lis...
void handleNotification(Field *field) override
Handle field changes of the field field, typically of the input field where changes are passes as not...
virtual void filterFile(FileListTools::FileAttribute &filterAttributes, FilterMessageList *messageList) const
Alternative version of filterFile(FileListTools::FileAttribute &filterAttributes) which allows passin...
virtual void _callInputPostFilter(FileAttributeMap &filterAttributeMap, FilterMessageList *messageList=nullptr) const
Calls postFilterAll-functionality of connected plugins and is already called by the base class implem...
BaseField & getInputFilterPluginFld() const
Provide programming access to field interface, see corresponding fields for documentation.
std::map< std::string, FileListTools::FileAttribute > FileAttributeMap
A map type assigning an attribute container to file paths.
virtual const FileListFilterPluginBase * getConnectedInputFilterPlugin() const
Returns a connected input plugin if there is one; otherwise nullptr is returned.
virtual void _callInputFileFilter(FileListTools::FileAttribute &filterAttributes, FilterMessageList *messageList=nullptr) const
Calls filterFile-functionality of connected plugins and is already called by the base class implement...
virtual void _touchOutputFilterPluginFld()
Convenience method to touch the output fields.
FileListFilterPluginBase(int numIns=0, int numOuts=0)
Constructor. Input and out images are probably not used.
virtual void filterFile(FileListTools::FileAttribute &filterAttributes) const
This virtual function is called by the FileListTools to check whether a file shall be imported.
Attributes assigned to files in a FileList according to filter operations on the file names or DICOM ...
Base class for an image processing module of the ML.
Definition mlModule.h:151
#define ML_MODULE_CLASS_HEADER(className)
Similar to ML_CLASS_HEADER for the usage of derived classes from Module.
Header file of helper class to store and handle error messages occuring in filter calls as well as to...
Namespace containing a number of tools and classes to scan directories for files, assign attributes t...
std::list< FilterMessage > FilterMessageList
List of messages which can occur during filter calls.