OpenWalnut  1.5.0dev
WMDiffTensorScalars.h
1 //---------------------------------------------------------------------------
2 //
3 // Project: OpenWalnut ( http://www.openwalnut.org )
4 //
5 // Copyright 2015 OpenWalnut Community, Nemtics, BSV@Uni-Leipzig
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 WMDIFFTENSORSCALARS_H
26 #define WMDIFFTENSORSCALARS_H
27 
28 #include <memory>
29 #include <string>
30 
31 
32 #include "WDataSetDTIToScalar_I.h"
33 #include "core/common/WObjectNDIP.h"
34 #include "core/common/WStrategyHelper.h"
35 #include "core/dataHandler/WDataSetDTI.h"
36 #include "core/dataHandler/WDataSetScalar.h"
37 #include "core/dataHandler/WDataSetVector.h"
38 #include "core/kernel/WModule.h"
39 #include "core/kernel/WModuleContainer.h"
40 #include "core/kernel/WModuleInputData.h"
41 #include "core/kernel/WModuleInputForwardData.h"
42 #include "core/kernel/WModuleOutputForwardData.h"
43 
44 /**
45  * Computes a scalar dataset for a given tensor dataset.
46  *
47  * \ingroup modules
48  */
50 {
51 public:
52  /**
53  * Default constructor.
54  */
56 
57  /**
58  * Destructor.
59  */
60  virtual ~WMDiffTensorScalars();
61 
62  /**
63  * Due to the prototype design pattern used to build modules, this method returns a new instance of this method. NOTE: it
64  * should never be initialized or modified in some other way. A simple new instance is required.
65  *
66  * \return the prototype used to create every module in OpenWalnut.
67  */
68  virtual std::shared_ptr< WModule > factory() const;
69 
70 protected:
71  /**
72  * Entry point after loading the module. Runs in separate thread.
73  */
74  virtual void moduleMain();
75 
76  /**
77  * Initialize the connectors this module is using.
78  */
79  virtual void connectors();
80 
81  /**
82  * Initialize the properties for this module.
83  */
84  virtual void properties();
85 
86  /**
87  * Create and initialize submodule instances, wires them and forward connectors as well as some properties.
88  */
89  virtual void initSubModules();
90 
91 private:
92  /**
93  * Input connector required by this module.
94  */
95  std::shared_ptr< WModuleInputForwardData< WDataSetDTI > > m_tensorsIC;
96 
97  /**
98  * Internal input connector for the Eigenvalues computed by the submodule EigenSystem.
99  */
100  std::shared_ptr< WModuleInputData< WDataSetVector > > m_evalsIC;
101 
102  /**
103  * Dataset for the Eigenvalues.
104  */
105  std::shared_ptr< WDataSetVector > m_evals;
106 
107  /**
108  * Dataset for the Tensors.
109  */
110  std::shared_ptr< WDataSetDTI > m_tensors;
111 
112  /**
113  * Output connector for the computed scalars.
114  */
115  std::shared_ptr< WModuleOutputData< WDataSetScalar > > m_scalarOC;
116 
117  /**
118  * Submodule doing computation of eigenvalues and eigenvectors.
119  * This uses WMEigenSystem.
120  */
121  std::shared_ptr< WModule > m_eigenSystem;
122 
124 };
125 
126 #endif // WMDIFFTENSORSCALARS_H
Computes a scalar dataset for a given tensor dataset.
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...
std::shared_ptr< WModule > m_eigenSystem
Submodule doing computation of eigenvalues and eigenvectors.
WStrategyHelper< WObjectNDIP< WDataSetDTIToScalar_I > > m_strategy
the strategy currently active.
std::shared_ptr< WDataSetDTI > m_tensors
Dataset for the Tensors.
virtual void initSubModules()
Create and initialize submodule instances, wires them and forward connectors as well as some properti...
std::shared_ptr< WModuleInputForwardData< WDataSetDTI > > m_tensorsIC
Input connector required by this module.
std::shared_ptr< WModuleInputData< WDataSetVector > > m_evalsIC
Internal input connector for the Eigenvalues computed by the submodule EigenSystem.
virtual void connectors()
Initialize the connectors this module is using.
std::shared_ptr< WModuleOutputData< WDataSetScalar > > m_scalarOC
Output connector for the computed scalars.
WMDiffTensorScalars()
Default constructor.
std::shared_ptr< WDataSetVector > m_evals
Dataset for the Eigenvalues.
virtual void properties()
Initialize the properties for this module.
virtual ~WMDiffTensorScalars()
Destructor.
virtual void moduleMain()
Entry point after loading the module.
Class able to contain other modules.
This class allows for an easy strategy pattern-based switching between properties and strategy instan...