ITK  5.2.0
Insight Toolkit
itkNumericTraitsDiffusionTensor3DPixel.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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 itkNumericTraitsDiffusionTensor3DPixel_h
19 #define itkNumericTraitsDiffusionTensor3DPixel_h
20 
21 #include "itkNumericTraits.h"
22 #include "itkDiffusionTensor3D.h"
23 
24 // This file is meant to define numeric traits for tensor pixels types in itk
25 
26 namespace itk
27 {
44 template <typename T>
46 {
47 private:
53 
54 public:
56  using ValueType = T;
57 
59 
62 
65 
69 
72 
75 
78 
81 
87  static const Self
88  max(const Self &)
89  {
90  return Self(NumericTraits<T>::max());
91  }
92 
93  static const Self
94  min(const Self &)
95  {
96  return Self(NumericTraits<T>::min());
97  }
98 
99  static const Self
101  {
103  }
104 
105  static const Self
106  ZeroValue(const Self &)
107  {
109  }
110 
111  static const Self
112  OneValue(const Self &)
113  {
115  }
116 
117  static const Self
118  max()
119  {
120  return Self(NumericTraits<T>::max());
121  }
122 
123  static const Self
124  min()
125  {
126  return Self(NumericTraits<T>::min());
127  }
128 
129  static const Self
131  {
133  }
134 
135  static const Self
137  {
139  }
140 
141  static const Self
143  {
145  }
146 
150 
155  static void
156  SetLength(DiffusionTensor3D<T> & m, const unsigned int s)
157  {
158  if (s != 6)
159  {
160  itkGenericExceptionMacro(<< "Cannot set the size of a DiffusionTensor3D "
161  "to anything other than 6.");
162  }
164  }
166 
168  static unsigned int
170  {
171  return 6;
172  }
173 
175  static unsigned int
177  {
178  return 6;
179  }
180 
181  static void
183  {
184  mv = v;
185  }
186 
187  template <typename TArray>
188  static void
189  AssignToArray(const Self & v, TArray & mv)
190  {
191  for (unsigned int i = 0; i < 6; i++)
192  {
193  mv[i] = v[i];
194  }
195  }
196 
200  static const Self ITKCommon_EXPORT Zero;
201  static const Self ITKCommon_EXPORT One;
202 };
203 } // end namespace itk
204 
205 #endif // itkNumericTraitsTensorPixel_h
itk::NumericTraits< DiffusionTensor3D< T > >::ElementAbsType
typename NumericTraits< T >::AbsType ElementAbsType
Definition: itkNumericTraitsDiffusionTensor3DPixel.h:48
itk::NumericTraits< DiffusionTensor3D< T > >::One
static const Self ITKCommon_EXPORT One
Definition: itkNumericTraitsDiffusionTensor3DPixel.h:201
itk::NumericTraits< DiffusionTensor3D< T > >::max
static const Self max()
Definition: itkNumericTraitsDiffusionTensor3DPixel.h:118
itk::NumericTraits< DiffusionTensor3D< T > >::ZeroValue
static const Self ZeroValue(const Self &)
Definition: itkNumericTraitsDiffusionTensor3DPixel.h:106
itk::NumericTraits< DiffusionTensor3D< T > >::GetLength
static unsigned int GetLength()
Definition: itkNumericTraitsDiffusionTensor3DPixel.h:176
itkDiffusionTensor3D.h
itk::NumericTraits< DiffusionTensor3D< T > >::ElementFloatType
typename NumericTraits< T >::FloatType ElementFloatType
Definition: itkNumericTraitsDiffusionTensor3DPixel.h:50
itk::NumericTraits::AccumulateType
double AccumulateType
Definition: itkNumericTraits.h:74
itk::DiffusionTensor3D
Represent a diffusion tensor as used in DTI images.
Definition: itkDiffusionTensor3D.h:79
itk::NumericTraits< DiffusionTensor3D< T > >::ValueType
T ValueType
Definition: itkNumericTraitsDiffusionTensor3DPixel.h:56
itk::NumericTraits< DiffusionTensor3D< T > >::min
static const Self min()
Definition: itkNumericTraitsDiffusionTensor3DPixel.h:124
itk::NumericTraits< DiffusionTensor3D< T > >::ElementPrintType
typename NumericTraits< T >::PrintType ElementPrintType
Definition: itkNumericTraitsDiffusionTensor3DPixel.h:51
itk::NumericTraits::IsSigned
static constexpr bool IsSigned
Definition: itkNumericTraits.h:133
itk::NumericTraits< DiffusionTensor3D< T > >::NonpositiveMin
static const Self NonpositiveMin()
Definition: itkNumericTraitsDiffusionTensor3DPixel.h:130
itk::NumericTraits< DiffusionTensor3D< T > >::OneValue
static const Self OneValue(const Self &)
Definition: itkNumericTraitsDiffusionTensor3DPixel.h:112
itk::NumericTraits::IsInteger
static constexpr bool IsInteger
Definition: itkNumericTraits.h:138
itk::NumericTraits< DiffusionTensor3D< T > >::NonpositiveMin
static const Self NonpositiveMin(const Self &)
Definition: itkNumericTraitsDiffusionTensor3DPixel.h:100
itk::NumericTraits< DiffusionTensor3D< T > >::GetLength
static unsigned int GetLength(const DiffusionTensor3D< T > &)
Definition: itkNumericTraitsDiffusionTensor3DPixel.h:169
itk::NumericTraits::PrintType
T PrintType
Definition: itkNumericTraits.h:68
itk::NumericTraits< DiffusionTensor3D< T > >::ScalarRealType
ElementRealType ScalarRealType
Definition: itkNumericTraitsDiffusionTensor3DPixel.h:77
itk::NumericTraits
Define additional traits for native types such as int or float.
Definition: itkNumericTraits.h:58
itk::NumericTraits< DiffusionTensor3D< T > >::ElementRealType
typename NumericTraits< T >::RealType ElementRealType
Definition: itkNumericTraitsDiffusionTensor3DPixel.h:52
itk::NumericTraits< DiffusionTensor3D< T > >::min
static const Self min(const Self &)
Definition: itkNumericTraitsDiffusionTensor3DPixel.h:94
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::NumericTraits< DiffusionTensor3D< T > >::AssignToArray
static void AssignToArray(const Self &v, MeasurementVectorType &mv)
Definition: itkNumericTraitsDiffusionTensor3DPixel.h:182
itk::NumericTraits::IsComplex
static constexpr bool IsComplex
Definition: itkNumericTraits.h:143
itk::NumericTraits< DiffusionTensor3D< T > >::SetLength
static void SetLength(DiffusionTensor3D< T > &m, const unsigned int s)
Definition: itkNumericTraitsDiffusionTensor3DPixel.h:156
itk::NumericTraits< DiffusionTensor3D< T > >::ZeroValue
static const Self ZeroValue()
Definition: itkNumericTraitsDiffusionTensor3DPixel.h:136
itkNumericTraits.h
itk::NumericTraits< DiffusionTensor3D< T > >::ElementAccumulateType
typename NumericTraits< T >::AccumulateType ElementAccumulateType
Definition: itkNumericTraitsDiffusionTensor3DPixel.h:49
itk::NumericTraits::RealType
double RealType
Definition: itkNumericTraits.h:84
itk::NumericTraits< DiffusionTensor3D< T > >::AssignToArray
static void AssignToArray(const Self &v, TArray &mv)
Definition: itkNumericTraitsDiffusionTensor3DPixel.h:189
itk::NumericTraits::FloatType
float FloatType
Definition: itkNumericTraits.h:81
itk::NumericTraits< DiffusionTensor3D< T > >::OneValue
static const Self OneValue()
Definition: itkNumericTraitsDiffusionTensor3DPixel.h:142
itk::NumericTraits< DiffusionTensor3D< T > >::max
static const Self max(const Self &)
Definition: itkNumericTraitsDiffusionTensor3DPixel.h:88
itk::NumericTraits< DiffusionTensor3D< T > >::Zero
static const Self ITKCommon_EXPORT Zero
Definition: itkNumericTraitsDiffusionTensor3DPixel.h:200
itk::NumericTraits::AbsType
T AbsType
Definition: itkNumericTraits.h:71
itk::FixedArray< TComponent, NDimension *(NDimension+1)/2 >::Fill
void Fill(const ValueType &)