ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkDiffusionTensor3D.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkDiffusionTensor3D_h
19 #define itkDiffusionTensor3D_h
20 
21 // Undefine an eventual DiffusionTensor3D macro
22 #ifdef DiffusionTensor3D
23 #undef DiffusionTensor3D
24 #endif
25 
27 
28 namespace itk
29 {
78 template< typename TComponent >
79 class ITK_TEMPLATE_EXPORT DiffusionTensor3D:public SymmetricSecondRankTensor< TComponent, 3 >
80 {
81 public:
85 
87  using ValueType = typename Superclass::ValueType;
89  using ComponentArrayType = typename Superclass::ComponentArrayType;
90 
93 
96 
98  DiffusionTensor3D() = default;
99 
101  DiffusionTensor3D(const Superclass & r);
102  DiffusionTensor3D(const ComponentType & r);
105 
107  template< typename TCoordRepB >
109  SymmetricSecondRankTensor< TComponent, 3 >(pa) {}
110 
112  Self & operator=(const Superclass & r);
113 
114  Self & operator=(const ComponentType & r);
115 
116  Self & operator=(const ComponentArrayType r);
117 
119  template< typename TCoordRepB >
121  {
122  //NOTE (this != &pa ) because they are different pointer types
123  //if this templated function is called
124  // ComponentType 'itk::DiffusionTensor3D<double> *'
125  // TCoordRepB 'const DiffusionTensor3D<float> *')
127  return *this;
128  }
130 
132  AccumulateValueType GetTrace() const;
133 
135  RealValueType GetFractionalAnisotropy() const;
136 
138  RealValueType GetRelativeAnisotropy() const;
139 
141  RealValueType GetInnerScalarProduct() const;
142 
143 };
144 
145 
146 template<typename T>
148 {
149  a.swap(b);
150 }
151 
152 } // end namespace itk
154 
155 #ifndef ITK_MANUAL_INSTANTIATION
156 #include "itkDiffusionTensor3D.hxx"
157 #endif
158 
159 #endif
A templated class holding a M x N size Matrix.
Definition: itkMatrix.h:49
typename NumericTraits< ValueType >::RealType AccumulateValueType
DiffusionTensor3D(const DiffusionTensor3D< TCoordRepB > &pa)
typename Superclass::ComponentType ComponentType
typename Superclass::EigenValuesArrayType EigenValuesArrayType
Represent a symmetric tensor of second rank.
typename Superclass::ComponentArrayType ComponentArrayType
typename NumericTraits< ValueType >::RealType RealValueType
SymmetricSecondRankTensor & operator=(const SymmetricSecondRankTensor &)=default
typename Superclass::ValueType ValueType
Simulate a standard C array with copy semnatics.
Definition: itkFixedArray.h:51
Self & operator=(const DiffusionTensor3D< TCoordRepB > &pa)
void swap(Array< T > &a, Array< T > &b)
Definition: itkArray.h:211
typename Superclass::RealValueType RealValueType
typename Superclass::AccumulateValueType AccumulateValueType
typename Superclass::EigenVectorsMatrixType EigenVectorsMatrixType
Represent a diffusion tensor as used in DTI images.