ITK  6.0.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:
65
71 using FieldType = std::pair<std::string, float>;
72 using FieldListType = std::vector<FieldType>;
73
75#if !defined(ITK_LEGACY_REMOVE)
77 using FieldEnumType = DTITubeSpatialObjectPointFieldEnum;
78 // We need to expose the enum values at the class level
79 // for backwards compatibility
80 static constexpr DTITubeSpatialObjectPointFieldEnum FA = DTITubeSpatialObjectPointFieldEnum::FA;
81 static constexpr DTITubeSpatialObjectPointFieldEnum ADC = DTITubeSpatialObjectPointFieldEnum::ADC;
82 static constexpr DTITubeSpatialObjectPointFieldEnum GA = DTITubeSpatialObjectPointFieldEnum::GA;
83#endif
84
88
90 ~DTITubeSpatialObjectPoint() override = default;
91
93 void
95 {
96 std::copy(matrix.Begin(), matrix.End(), m_TensorMatrix);
97 }
98
99 void
101 {
102 std::copy(matrix.Begin(), matrix.End(), m_TensorMatrix);
103 }
104
105 void
106 SetTensorMatrix(const float * matrix)
107 {
108 for (unsigned int i = 0; i < 6; ++i)
109 {
110 m_TensorMatrix[i] = matrix[i];
111 }
112 }
113
114 const float *
116 {
117 return m_TensorMatrix;
118 }
119
121 void
122 AddField(const char * name, float value);
123
125 void
127
129 void
131
132 void
133 SetField(const char * name, float value);
134
136 const FieldListType &
137 GetFields() const
138 {
139 return m_Fields;
140 }
141
143 float
144 GetField(const char * name) const;
145
146 float
148
149protected:
150 float m_TensorMatrix[6]{};
151 FieldListType m_Fields{};
152
154 void
155 PrintSelf(std::ostream & os, Indent indent) const override;
156
158 std::string
160};
161} // end of namespace itk
162
163#ifndef ITK_MANUAL_INSTANTIATION
164# include "itkDTITubeSpatialObjectPoint.hxx"
165#endif
166
167#endif // itkDTITubeSpatialObjectPoint_h
Contains all enum classes used by DTITubeSpatialObjectPoint class.
Point used for a tube definition.
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)
ITK_DEFAULT_COPY_AND_MOVE(DTITubeSpatialObjectPoint)
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
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....
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, typename AnatomicalOrientation::CoordinateEnum value)