OpenWalnut  1.4.0
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 #ifndef Q_MOC_RUN
29 #include <boost/shared_ptr.hpp>
30 #endif
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( boost::shared_ptr< WValueSetBase > newValueSet, boost::shared_ptr< WGrid > newGrid );
49 
50  /**
51  * Destructs this dataset.
52  */
53  ~WDataSetDTI();
54 
55  /**
56  * 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
57  * want to keep the dynamic type of your dataset even if you just have a WDataSetSingle.
58  *
59  * \param newValueSet the new valueset.
60  *
61  * \return the clone
62  */
63  virtual WDataSetSingle::SPtr clone( boost::shared_ptr< WValueSetBase > newValueSet ) const;
64 
65  /**
66  * 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
67  * want to keep the dynamic type of your dataset even if you just have a WDataSetSingle.
68  *
69  * \param newGrid the new grid.
70  *
71  * \return the clone
72  */
73  virtual WDataSetSingle::SPtr clone( boost::shared_ptr< WGrid > newGrid ) const;
74 
75  /**
76  * Creates a copy (clone) of this instance. Unlike copy construction, this is a very useful function if you
77  * want to keep the dynamic type of your dataset even if you just have a WDataSetSingle.
78  *
79  * \return the clone
80  */
81  virtual WDataSetSingle::SPtr clone() const;
82 
83  /**
84  * Retrieves the i'th tensor.
85  *
86  * \warning Here is dynamical allocation used inside, this may be a problem when used with multithreading.
87  *
88  * \param index The position of the tensor to retrieve
89  *
90  * \return The new constructed symmetrical matrix as tensor.
91  */
92  WTensorSym< 2, 3, float > getTensor( size_t index ) const;
93 
94 protected:
95  /**
96  * The prototype as singleton.
97  */
98  static boost::shared_ptr< WPrototyped > m_prototype;
99 
100 private:
101 };
102 
103 #endif // WDATASETDTI_H
Implements a symmetric tensor that has the same number of components in every direction.
Definition: WTensorSym.h:74
WDataSetDTI(boost::shared_ptr< WValueSetBase > newValueSet, boost::shared_ptr< WGrid > newGrid)
Creates a new DTI dataset out of a value set and a grid.
Definition: WDataSetDTI.cpp:31
WTensorSym< 2, 3, float > getTensor(size_t index) const
Retrieves the i'th tensor.
Definition: WDataSetDTI.cpp:60
~WDataSetDTI()
Destructs this dataset.
Definition: WDataSetDTI.cpp:41
A data set consisting of a set of values based on a grid.
boost::shared_ptr< WDataSetSingle > SPtr
Convenience typedef for a boost::shared_ptr.
static boost::shared_ptr< WPrototyped > m_prototype
The prototype as singleton.
Definition: WDataSetDTI.h:98
virtual WDataSetSingle::SPtr clone() const
Creates a copy (clone) of this instance.
Definition: WDataSetDTI.cpp:55
Represents a Diffusion-Tensor-Image dataset.
Definition: WDataSetDTI.h:39