ITK  5.4.0
Insight Toolkit
itkDTITubeSpatialObjectPoint.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 * https://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 itkDTITubeSpatialObjectPoint_h
19#define itkDTITubeSpatialObjectPoint_h
20
23#include "vnl/vnl_vector_fixed.h"
24
25namespace itk
26{
32{
33public:
39 enum class DTITubeSpatialObjectPointField : uint8_t
40 {
41 FA = 0,
42 ADC = 1,
43 GA = 2
44 };
45};
46// Define how to print enumeration
47extern ITKSpatialObjects_EXPORT std::ostream &
49
60template <unsigned int TPointDimension = 3>
61class ITK_TEMPLATE_EXPORT DTITubeSpatialObjectPoint : public TubeSpatialObjectPoint<TPointDimension>
62{
63public:
69 using FieldType = std::pair<std::string, float>;
70 using FieldListType = std::vector<FieldType>;
71
73#if !defined(ITK_LEGACY_REMOVE)
75 using FieldEnumType = DTITubeSpatialObjectPointFieldEnum;
76 // We need to expose the enum values at the class level
77 // for backwards compatibility
78 static constexpr DTITubeSpatialObjectPointFieldEnum FA = DTITubeSpatialObjectPointFieldEnum::FA;
79 static constexpr DTITubeSpatialObjectPointFieldEnum ADC = DTITubeSpatialObjectPointFieldEnum::ADC;
80 static constexpr DTITubeSpatialObjectPointFieldEnum GA = DTITubeSpatialObjectPointFieldEnum::GA;
81#endif
82
86
89
91 ~DTITubeSpatialObjectPoint() override = default;
92
94 void
96 {
97 std::copy(matrix.Begin(), matrix.End(), m_TensorMatrix);
98 }
99
100 void
102 {
103 std::copy(matrix.Begin(), matrix.End(), m_TensorMatrix);
104 }
105
106 void
107 SetTensorMatrix(const float * matrix)
108 {
109 for (unsigned int i = 0; i < 6; ++i)
110 {
111 m_TensorMatrix[i] = matrix[i];
112 }
113 }
114
115 const float *
117 {
118 return m_TensorMatrix;
119 }
120
122 Self &
124
126 void
127 AddField(const char * name, float value);
128
130 void
132
134 void
136
137 void
138 SetField(const char * name, float value);
139
141 const FieldListType &
142 GetFields() const
143 {
144 return m_Fields;
145 }
146
148 float
149 GetField(const char * name) const;
150
151 float
153
154protected:
155 float m_TensorMatrix[6]{};
156 FieldListType m_Fields{};
157
159 void
160 PrintSelf(std::ostream & os, Indent indent) const override;
161
163 std::string
165};
166} // end of namespace itk
167
168#ifndef ITK_MANUAL_INSTANTIATION
169# include "itkDTITubeSpatialObjectPoint.hxx"
170#endif
171
172#endif // itkDTITubeSpatialObjectPoint_h
Pixel-wise addition of two images.
Contains all enum classes used by DTITubeSpatialObjectPoint class.
Point used for a tube definition.
DTITubeSpatialObjectPoint(const DTITubeSpatialObjectPoint &other)
void SetTensorMatrix(const DiffusionTensor3D< double > &matrix)
std::string TranslateEnumToChar(DTITubeSpatialObjectPointFieldEnum name) const
~DTITubeSpatialObjectPoint() override=default
void AddField(const char *name, float value)
float GetField(const char *name) const
void SetTensorMatrix(const DiffusionTensor3D< float > &matrix)
void PrintSelf(std::ostream &os, Indent indent) const override
void AddField(DTITubeSpatialObjectPointFieldEnum name, float value)
void SetField(DTITubeSpatialObjectPointFieldEnum name, float value)
float GetField(DTITubeSpatialObjectPointFieldEnum name) const
void SetField(const char *name, float value)
const FieldListType & GetFields() const
std::pair< std::string, float > FieldType
Self & operator=(const DTITubeSpatialObjectPoint &rhs)
Represent a diffusion tensor as used in DTI images.
Iterator End()
Iterator Begin()
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Point used for a tube definition.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
std::ostream & operator<<(std::ostream &os, const Array< TValue > &arr)
Definition: itkArray.h:216