OpenWalnut  1.5.0dev
WDataSetDTI.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 WDATASETDTI_H
26 #define WDATASETDTI_H
27 
28 #include <memory>
29 #include <string>
30 
31 
32 #include "../common/math/WTensorSym.h"
33 #include "WDataSetSingle.h"
34 
35 
36 /**
37  * Represents a Diffusion-Tensor-Image dataset. Diffusion tensors are symmetric matrices.
38  */
40 {
41 public:
42  /**
43  * Creates a new DTI dataset out of a value set and a grid.
44  *
45  * \param newValueSet Valueset having vectors of dimension 6.
46  * \param newGrid
47  */
48  WDataSetDTI( std::shared_ptr< WValueSetBase > newValueSet, std::shared_ptr< WGrid > newGrid );
49 
50  /**
51  * Constructs a new set of tracts. The constructed instance is not usable but needed for prototype mechanism.
52  */
53  WDataSetDTI();
54 
55  /**
56  * Destructs this dataset.
57  */
58  ~WDataSetDTI();
59 
60  /**
61  * Creates a copy (clone) of this instance but allows one to change the valueset. Unlike copy construction, this is a very useful function if you
62  * want to keep the dynamic type of your dataset.
63  *
64  * \param newValueSet the new valueset.
65  * \param newGrid the new grid.
66  *
67  * \return the clone
68  */
69  virtual WDataSetSingle::SPtr clone( std::shared_ptr< WValueSetBase > newValueSet, std::shared_ptr< WGrid > newGrid ) const;
70 
71  /**
72  * Creates a copy (clone) of this instance but allows one to change the valueset. Unlike copy construction, this is a very useful function if you
73  * want to keep the dynamic type of your dataset even if you just have a WDataSetSingle.
74  *
75  * \param newValueSet the new valueset.
76  *
77  * \return the clone
78  */
79  virtual WDataSetSingle::SPtr clone( std::shared_ptr< WValueSetBase > newValueSet ) const;
80 
81  /**
82  * Creates a copy (clone) of this instance but allows one to change the grid. Unlike copy construction, this is a very useful function if you
83  * want to keep the dynamic type of your dataset even if you just have a WDataSetSingle.
84  *
85  * \param newGrid the new grid.
86  *
87  * \return the clone
88  */
89  virtual WDataSetSingle::SPtr clone( std::shared_ptr< WGrid > newGrid ) const;
90 
91  /**
92  * Creates a copy (clone) of this instance. Unlike copy construction, this is a very useful function if you
93  * want to keep the dynamic type of your dataset even if you just have a WDataSetSingle.
94  *
95  * \return the clone
96  */
97  virtual WDataSetSingle::SPtr clone() const;
98 
99  /**
100  * Retrieves the i'th tensor.
101  *
102  * \warning Here is dynamical allocation used inside, this may be a problem when used with multithreading.
103  *
104  * \param index The position of the tensor to retrieve
105  *
106  * \return The new constructed symmetrical matrix as tensor.
107  */
108  WTensorSym< 2, 3, float > getTensor( size_t index ) const;
109 
110  /**
111  * Gets the name of this prototype.
112  *
113  * \return the name.
114  */
115  virtual const std::string getName() const;
116 
117  /**
118  * Gets the description for this prototype.
119  *
120  * \return the description
121  */
122  virtual const std::string getDescription() const;
123 
124  /**
125  * Returns a prototype instantiated with the true type of the deriving class.
126  *
127  * \return the prototype.
128  */
129  static std::shared_ptr< WPrototyped > getPrototype();
130 
131 protected:
132  /**
133  * The prototype as singleton.
134  */
135  static std::shared_ptr< WPrototyped > m_prototype;
136 
137 private:
138 };
139 
140 #endif // WDATASETDTI_H
Represents a Diffusion-Tensor-Image dataset.
Definition: WDataSetDTI.h:40
virtual const std::string getName() const
Gets the name of this prototype.
Definition: WDataSetDTI.cpp:80
virtual WDataSetSingle::SPtr clone() const
Creates a copy (clone) of this instance.
Definition: WDataSetDTI.cpp:68
WDataSetDTI()
Constructs a new set of tracts.
Definition: WDataSetDTI.cpp:33
virtual const std::string getDescription() const
Gets the description for this prototype.
Definition: WDataSetDTI.cpp:85
WTensorSym< 2, 3, float > getTensor(size_t index) const
Retrieves the i'th tensor.
Definition: WDataSetDTI.cpp:73
static std::shared_ptr< WPrototyped > m_prototype
The prototype as singleton.
Definition: WDataSetDTI.h:135
~WDataSetDTI()
Destructs this dataset.
Definition: WDataSetDTI.cpp:49
static std::shared_ptr< WPrototyped > getPrototype()
Returns a prototype instantiated with the true type of the deriving class.
Definition: WDataSetDTI.cpp:91
A data set consisting of a set of values based on a grid.
std::shared_ptr< WDataSetSingle > SPtr
Convenience typedef for a std::shared_ptr.
Implements a symmetric tensor that has the same number of components in every direction.
Definition: WTensorSym.h:73