OpenWalnut  1.5.0dev
WMFiberFilterROI.h
1 //---------------------------------------------------------------------------
2 //
3 // Project: OpenWalnut ( http://www.openwalnut.org )
4 //
5 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6 // For more information see http://www.openwalnut.org/copying
7 //
8 // This file is part of OpenWalnut.
9 //
10 // OpenWalnut is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // OpenWalnut is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
22 //
23 //---------------------------------------------------------------------------
24 
25 #ifndef WMFIBERFILTERROI_H
26 #define WMFIBERFILTERROI_H
27 
28 #include <memory>
29 #include <string>
30 
31 #include "core/dataHandler/WDataSetFiberClustering.h"
32 #include "core/dataHandler/WDataSetFibers.h"
33 #include "core/kernel/WFiberSelector.h"
34 #include "core/kernel/WModule.h"
35 #include "core/kernel/WModuleInputData.h"
36 #include "core/kernel/WModuleOutputData.h"
37 
38 /**
39  * This module is intended to allow the user to filter a fiber dataset using the current ROI config
40  *
41  * \ingroup modules
42  */
44 {
45 public:
46  /**
47  * Default constructor.
48  */
50 
51  /**
52  * Destructor.
53  */
54  virtual ~WMFiberFilterROI();
55 
56  /**
57  * Gives back the name of this module.
58  * \return the module's name.
59  */
60  virtual const std::string getName() const;
61 
62  /**
63  * Gives back a description of this module.
64  * \return description to module.
65  */
66  virtual const std::string getDescription() const;
67 
68  /**
69  * Due to the prototype design pattern used to build modules, this method returns a new instance of this method. NOTE: it
70  * should never be initialized or modified in some other way. A simple new instance is required.
71  *
72  * \return the prototype used to create every module in OpenWalnut.
73  */
74  virtual std::shared_ptr< WModule > factory() const;
75 
76 protected:
77  /**
78  * Entry point after loading the module. Runs in separate thread.
79  */
80  virtual void moduleMain();
81 
82  /**
83  * Initialize the connectors this module is using.
84  */
85  virtual void connectors();
86 
87  /**
88  * Initialize the properties for this module.
89  */
90  virtual void properties();
91 
92 private:
93  /**
94  * An input for the fiber data.
95  */
96  std::shared_ptr< WModuleInputData< WDataSetFibers > > m_input;
97 
98  /**
99  * The output connector for the filtered data.
100  */
101  std::shared_ptr< WModuleOutputData< WDataSetFibers > > m_fiberOutput;
102 
103  /**
104  * The output connector for the resulting clustering.
105  */
106  std::shared_ptr< WModuleOutputData< WDataSetFiberClustering > > m_clusterOutput;
107 
108  /**
109  * A condition used to notify about changes in several properties.
110  */
111  std::shared_ptr< WCondition > m_propCondition;
112 
113  /**
114  * Trigger output update
115  */
116  WPropTrigger m_aTrigger;
117 
118  /**
119  * Selector for the current fiber data or NULL of none.
120  */
122 
123  /**
124  * Fiber data.
125  */
127 
128  /**
129  * Updates the output using the ROI configuration.
130  */
131  void updateOutput();
132 };
133 
134 #endif // WMFIBERFILTERROI_H
135 
std::shared_ptr< WDataSetFibers > SPtr
Pointer to dataset.
std::shared_ptr< WFiberSelector > SPtr
Fiber selector pointer.
This module is intended to allow the user to filter a fiber dataset using the current ROI config.
std::shared_ptr< WModuleOutputData< WDataSetFiberClustering > > m_clusterOutput
The output connector for the resulting clustering.
WFiberSelector::SPtr m_fiberSelector
Selector for the current fiber data or NULL of none.
virtual const std::string getName() const
Gives back the name of this module.
virtual void properties()
Initialize the properties for this module.
std::shared_ptr< WCondition > m_propCondition
A condition used to notify about changes in several properties.
virtual const std::string getDescription() const
Gives back a description of this module.
virtual ~WMFiberFilterROI()
Destructor.
virtual void connectors()
Initialize the connectors this module is using.
void updateOutput()
Updates the output using the ROI configuration.
WMFiberFilterROI()
Default constructor.
std::shared_ptr< WModuleInputData< WDataSetFibers > > m_input
An input for the fiber data.
std::shared_ptr< WModuleOutputData< WDataSetFibers > > m_fiberOutput
The output connector for the filtered data.
WPropTrigger m_aTrigger
Trigger output update.
WDataSetFibers::SPtr m_fibers
Fiber data.
virtual std::shared_ptr< WModule > factory() const
Due to the prototype design pattern used to build modules, this method returns a new instance of this...
virtual void moduleMain()
Entry point after loading the module.
Class representing a single module of OpenWalnut.
Definition: WModule.h:72