OpenWalnut  1.5.0dev
WDataSetDTIToScalar_I.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 WDATASETDTITOSCALAR_I_H
26 #define WDATASETDTITOSCALAR_I_H
27 
28 #include "core/common/math/linearAlgebra/WVectorFixed.h"
29 #include "core/common/math/WTensorSym.h"
30 #include "core/common/WFlag.h"
31 #include "core/common/WProgress.h"
32 #include "core/dataHandler/WDataSetDTI.h"
33 #include "core/dataHandler/WDataSetScalar.h"
34 #include "core/dataHandler/WDataSetVector.h"
35 
36 /**
37  * Interface to compute various measures on tensors. Prominent examples are the
38  * Fractional Anisotropy (FA), trace, Relative Anisotropy, Mean Diffusivity, Radial Diffusivity, etc.
39  * As many scalar measures may use either the tensor components directly or rely on derived
40  * measures such as eigenvalues, both are needed for generating the scalar.
41  */
43 {
44 public:
45  /**
46  * This runs the given strategy on the given dataset.
47  *
48  * \param progress the progress instance you should increment each time you fill the value for one voxel.
49  * \param shutdown Possibility to abort in case of shutdown.
50  * \param tensors The tensor components
51  * \param evals The Eigenvalues
52  *
53  * \return The scalar dataset, for which each tensor a scalar value is derived according to the subclass implementation.
54  */
55  virtual WDataSetScalar::SPtr operator()( WProgress::SPtr progress, WBoolFlag const &shutdown,
56  WDataSetDTI::SPtr tensors, WDataSetVector::SPtr evals );
57 
58  /**
59  * Destructor
60  */
61  virtual ~WDataSetDTIToScalar_I();
62 
63 protected:
64  /**
65  * Actual scalar computation.
66  *
67  * \param evals Eigenvalues
68  * \param tensor Tensor components
69  *
70  * \return Scalar value derived either from tensor components, eigenvalues or both.
71  */
72  virtual double tensorToScalar( const WVector3d& evals, const WTensorSym< 2, 3, float >& tensor ) = 0;
73 };
74 
75 #endif // WDATASETDTITOSCALAR_I_H
Interface to compute various measures on tensors.
virtual ~WDataSetDTIToScalar_I()
Destructor.
virtual WDataSetScalar::SPtr operator()(WProgress::SPtr progress, WBoolFlag const &shutdown, WDataSetDTI::SPtr tensors, WDataSetVector::SPtr evals)
This runs the given strategy on the given dataset.
virtual double tensorToScalar(const WVector3d &evals, const WTensorSym< 2, 3, float > &tensor)=0
Actual scalar computation.
std::shared_ptr< WDataSetScalar > SPtr
shared_ptr abbreviation
std::shared_ptr< WDataSetVector > SPtr
shared_ptr abbreviation
std::shared_ptr< WDataSet > SPtr
Shared pointer abbreviation to a instance of this class.
Definition: WDataSet.h:55
std::shared_ptr< WProgress > SPtr
Shared pointer on a WProgress.
Definition: WProgress.h:48
Implements a symmetric tensor that has the same number of components in every direction.
Definition: WTensorSym.h:73