ITK  6.0.0
Insight Toolkit
itkAnatomicalOrientation.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 itkAnatomicalOrientation_h
19 #define itkAnatomicalOrientation_h
20 
21 #include "ITKCommonExport.h"
22 #include "itkImageBase.h"
23 #ifndef ITK_FUTURE_LEGACY_REMOVE
24 # include "itkSpatialOrientation.h"
25 #endif
26 #include <map>
27 #include <string>
28 
29 namespace itk
30 {
31 
53 class ITKCommon_EXPORT AnatomicalOrientation
54 {
55 public:
56  static constexpr unsigned int Dimension = 3;
58  static constexpr unsigned int ImageDimension = Dimension;
59 
60 #ifndef ITK_FUTURE_LEGACY_REMOVE
61  using LegacyOrientationType = SpatialOrientationEnums::ValidCoordinateOrientations;
62 #endif
63 
64  // Anatomical names for an axis.
65  //
66  enum class CoordinateEnum : uint8_t
67  {
68  UNKNOWN = 0,
69  RightToLeft = 2,
70  LeftToRight = 3,
71  PosteriorToAnterior = 4,
72  AnteriorToPosterior = 5,
73  InferiorToSuperior = 8,
74  SuperiorToInferior = 9,
75  };
76 
77 protected:
78  enum class CoordinateMajornessTermsEnum : uint8_t
79  {
80  PrimaryMinor = 0,
81  SecondaryMinor = 8,
82  TertiaryMinor = 16
83  };
84 
85  template <CoordinateEnum VPrimary, CoordinateEnum VSecondary, CoordinateEnum VTertiary>
86  static constexpr uint32_t m_OrientationValue =
87  (static_cast<uint32_t>(VPrimary) << static_cast<uint8_t>(CoordinateMajornessTermsEnum::PrimaryMinor)) +
88  (static_cast<uint32_t>(VSecondary) << static_cast<uint8_t>(CoordinateMajornessTermsEnum::SecondaryMinor)) +
89  (static_cast<uint32_t>(VTertiary) << static_cast<uint8_t>(CoordinateMajornessTermsEnum::TertiaryMinor));
90 
92  GetCoordinateTerm(CoordinateMajornessTermsEnum cmt) const;
93 
94 public:
95  // Enumerated acronyms based on the positive or "To" direction of the anatomical coordinates.
96  enum class PositiveEnum : uint32_t
97 
98  {
99  INVALID = 0,
100 
101  RIP = m_OrientationValue<CoordinateEnum::LeftToRight,
102  CoordinateEnum::SuperiorToInferior,
103  CoordinateEnum::AnteriorToPosterior>,
104  LIP = m_OrientationValue<CoordinateEnum::RightToLeft,
105  CoordinateEnum::SuperiorToInferior,
106  CoordinateEnum::AnteriorToPosterior>,
107  RSP = m_OrientationValue<CoordinateEnum::LeftToRight,
108  CoordinateEnum::InferiorToSuperior,
109  CoordinateEnum::AnteriorToPosterior>,
110  LSP = m_OrientationValue<CoordinateEnum::RightToLeft,
111  CoordinateEnum::InferiorToSuperior,
112  CoordinateEnum::AnteriorToPosterior>,
113  RIA = m_OrientationValue<CoordinateEnum::LeftToRight,
114  CoordinateEnum::SuperiorToInferior,
115  CoordinateEnum::PosteriorToAnterior>,
116  LIA = m_OrientationValue<CoordinateEnum::RightToLeft,
117  CoordinateEnum::SuperiorToInferior,
118  CoordinateEnum::PosteriorToAnterior>,
119  RSA = m_OrientationValue<CoordinateEnum::LeftToRight,
120  CoordinateEnum::InferiorToSuperior,
121  CoordinateEnum::PosteriorToAnterior>,
122  LSA = m_OrientationValue<CoordinateEnum::RightToLeft,
123  CoordinateEnum::InferiorToSuperior,
124  CoordinateEnum::PosteriorToAnterior>,
125 
126  IRP = m_OrientationValue<CoordinateEnum::SuperiorToInferior,
127  CoordinateEnum::LeftToRight,
128  CoordinateEnum::AnteriorToPosterior>,
129  ILP = m_OrientationValue<CoordinateEnum::SuperiorToInferior,
130  CoordinateEnum::RightToLeft,
131  CoordinateEnum::AnteriorToPosterior>,
132  SRP = m_OrientationValue<CoordinateEnum::InferiorToSuperior,
133  CoordinateEnum::LeftToRight,
134  CoordinateEnum::AnteriorToPosterior>,
135  SLP = m_OrientationValue<CoordinateEnum::InferiorToSuperior,
136  CoordinateEnum::RightToLeft,
137  CoordinateEnum::AnteriorToPosterior>,
138  IRA = m_OrientationValue<CoordinateEnum::SuperiorToInferior,
139  CoordinateEnum::LeftToRight,
140  CoordinateEnum::PosteriorToAnterior>,
141  ILA = m_OrientationValue<CoordinateEnum::SuperiorToInferior,
142  CoordinateEnum::RightToLeft,
143  CoordinateEnum::PosteriorToAnterior>,
144  SRA = m_OrientationValue<CoordinateEnum::InferiorToSuperior,
145  CoordinateEnum::LeftToRight,
146  CoordinateEnum::PosteriorToAnterior>,
147  SLA = m_OrientationValue<CoordinateEnum::InferiorToSuperior,
148  CoordinateEnum::RightToLeft,
149  CoordinateEnum::PosteriorToAnterior>,
150 
151  RPI = m_OrientationValue<CoordinateEnum::LeftToRight,
152  CoordinateEnum::AnteriorToPosterior,
153  CoordinateEnum::SuperiorToInferior>,
154  LPI = m_OrientationValue<CoordinateEnum::RightToLeft,
155  CoordinateEnum::AnteriorToPosterior,
156  CoordinateEnum::SuperiorToInferior>,
157  RAI = m_OrientationValue<CoordinateEnum::LeftToRight,
158  CoordinateEnum::PosteriorToAnterior,
159  CoordinateEnum::SuperiorToInferior>,
160  LAI = m_OrientationValue<CoordinateEnum::RightToLeft,
161  CoordinateEnum::PosteriorToAnterior,
162  CoordinateEnum::SuperiorToInferior>,
163  RPS = m_OrientationValue<CoordinateEnum::LeftToRight,
164  CoordinateEnum::AnteriorToPosterior,
165  CoordinateEnum::InferiorToSuperior>,
166  LPS = m_OrientationValue<CoordinateEnum::RightToLeft,
167  CoordinateEnum::AnteriorToPosterior,
168  CoordinateEnum::InferiorToSuperior>,
169  RAS = m_OrientationValue<CoordinateEnum::LeftToRight,
170  CoordinateEnum::PosteriorToAnterior,
171  CoordinateEnum::InferiorToSuperior>,
172  LAS = m_OrientationValue<CoordinateEnum::RightToLeft,
173  CoordinateEnum::PosteriorToAnterior,
174  CoordinateEnum::InferiorToSuperior>,
175 
176  PRI = m_OrientationValue<CoordinateEnum::AnteriorToPosterior,
177  CoordinateEnum::LeftToRight,
178  CoordinateEnum::SuperiorToInferior>,
179  PLI = m_OrientationValue<CoordinateEnum::AnteriorToPosterior,
180  CoordinateEnum::RightToLeft,
181  CoordinateEnum::SuperiorToInferior>,
182  ARI = m_OrientationValue<CoordinateEnum::PosteriorToAnterior,
183  CoordinateEnum::LeftToRight,
184  CoordinateEnum::SuperiorToInferior>,
185  ALI = m_OrientationValue<CoordinateEnum::PosteriorToAnterior,
186  CoordinateEnum::RightToLeft,
187  CoordinateEnum::SuperiorToInferior>,
188  PRS = m_OrientationValue<CoordinateEnum::AnteriorToPosterior,
189  CoordinateEnum::LeftToRight,
190  CoordinateEnum::InferiorToSuperior>,
191  PLS = m_OrientationValue<CoordinateEnum::AnteriorToPosterior,
192  CoordinateEnum::RightToLeft,
193  CoordinateEnum::InferiorToSuperior>,
194  ARS = m_OrientationValue<CoordinateEnum::PosteriorToAnterior,
195  CoordinateEnum::LeftToRight,
196  CoordinateEnum::InferiorToSuperior>,
197  ALS = m_OrientationValue<CoordinateEnum::PosteriorToAnterior,
198  CoordinateEnum::RightToLeft,
199  CoordinateEnum::InferiorToSuperior>,
200 
201  IPR = m_OrientationValue<CoordinateEnum::SuperiorToInferior,
202  CoordinateEnum::AnteriorToPosterior,
203  CoordinateEnum::LeftToRight>,
204  SPR = m_OrientationValue<CoordinateEnum::InferiorToSuperior,
205  CoordinateEnum::AnteriorToPosterior,
206  CoordinateEnum::LeftToRight>,
207  IAR = m_OrientationValue<CoordinateEnum::SuperiorToInferior,
208  CoordinateEnum::PosteriorToAnterior,
209  CoordinateEnum::LeftToRight>,
210  SAR = m_OrientationValue<CoordinateEnum::InferiorToSuperior,
211  CoordinateEnum::PosteriorToAnterior,
212  CoordinateEnum::LeftToRight>,
213  IPL = m_OrientationValue<CoordinateEnum::SuperiorToInferior,
214  CoordinateEnum::AnteriorToPosterior,
215  CoordinateEnum::RightToLeft>,
216  SPL = m_OrientationValue<CoordinateEnum::InferiorToSuperior,
217  CoordinateEnum::AnteriorToPosterior,
218  CoordinateEnum::RightToLeft>,
219  IAL = m_OrientationValue<CoordinateEnum::SuperiorToInferior,
220  CoordinateEnum::PosteriorToAnterior,
221  CoordinateEnum::RightToLeft>,
222  SAL = m_OrientationValue<CoordinateEnum::InferiorToSuperior,
223  CoordinateEnum::PosteriorToAnterior,
224  CoordinateEnum::RightToLeft>,
225 
226  PIR = m_OrientationValue<CoordinateEnum::AnteriorToPosterior,
227  CoordinateEnum::SuperiorToInferior,
228  CoordinateEnum::LeftToRight>,
229  PSR = m_OrientationValue<CoordinateEnum::AnteriorToPosterior,
230  CoordinateEnum::InferiorToSuperior,
231  CoordinateEnum::LeftToRight>,
232  AIR = m_OrientationValue<CoordinateEnum::PosteriorToAnterior,
233  CoordinateEnum::SuperiorToInferior,
234  CoordinateEnum::LeftToRight>,
235  ASR = m_OrientationValue<CoordinateEnum::PosteriorToAnterior,
236  CoordinateEnum::InferiorToSuperior,
237  CoordinateEnum::LeftToRight>,
238  PIL = m_OrientationValue<CoordinateEnum::AnteriorToPosterior,
239  CoordinateEnum::SuperiorToInferior,
240  CoordinateEnum::RightToLeft>,
241  PSL = m_OrientationValue<CoordinateEnum::AnteriorToPosterior,
242  CoordinateEnum::InferiorToSuperior,
243  CoordinateEnum::RightToLeft>,
244  AIL = m_OrientationValue<CoordinateEnum::PosteriorToAnterior,
245  CoordinateEnum::SuperiorToInferior,
246  CoordinateEnum::RightToLeft>,
247  ASL = m_OrientationValue<CoordinateEnum::PosteriorToAnterior,
248  CoordinateEnum::InferiorToSuperior,
249  CoordinateEnum::RightToLeft>
250  };
251 
252  // Enumerated acronyms based on the negative or "From" direction of the anatomical coordinates.
253  enum class NegativeEnum : uint32_t
254 
255  {
256  INVALID = 0,
257 
258  RIP = m_OrientationValue<CoordinateEnum::RightToLeft,
259  CoordinateEnum::InferiorToSuperior,
260  CoordinateEnum::PosteriorToAnterior>,
261  LIP = m_OrientationValue<CoordinateEnum::LeftToRight,
262  CoordinateEnum::InferiorToSuperior,
263  CoordinateEnum::PosteriorToAnterior>,
264  RSP = m_OrientationValue<CoordinateEnum::RightToLeft,
265  CoordinateEnum::SuperiorToInferior,
266  CoordinateEnum::PosteriorToAnterior>,
267  LSP = m_OrientationValue<CoordinateEnum::LeftToRight,
268  CoordinateEnum::SuperiorToInferior,
269  CoordinateEnum::PosteriorToAnterior>,
270  RIA = m_OrientationValue<CoordinateEnum::RightToLeft,
271  CoordinateEnum::InferiorToSuperior,
272  CoordinateEnum::AnteriorToPosterior>,
273  LIA = m_OrientationValue<CoordinateEnum::LeftToRight,
274  CoordinateEnum::InferiorToSuperior,
275  CoordinateEnum::AnteriorToPosterior>,
276  RSA = m_OrientationValue<CoordinateEnum::RightToLeft,
277  CoordinateEnum::SuperiorToInferior,
278  CoordinateEnum::AnteriorToPosterior>,
279  LSA = m_OrientationValue<CoordinateEnum::LeftToRight,
280  CoordinateEnum::SuperiorToInferior,
281  CoordinateEnum::AnteriorToPosterior>,
282 
283  IRP = m_OrientationValue<CoordinateEnum::InferiorToSuperior,
284  CoordinateEnum::RightToLeft,
285  CoordinateEnum::PosteriorToAnterior>,
286  ILP = m_OrientationValue<CoordinateEnum::InferiorToSuperior,
287  CoordinateEnum::LeftToRight,
288  CoordinateEnum::PosteriorToAnterior>,
289  SRP = m_OrientationValue<CoordinateEnum::SuperiorToInferior,
290  CoordinateEnum::RightToLeft,
291  CoordinateEnum::PosteriorToAnterior>,
292  SLP = m_OrientationValue<CoordinateEnum::SuperiorToInferior,
293  CoordinateEnum::LeftToRight,
294  CoordinateEnum::PosteriorToAnterior>,
295  IRA = m_OrientationValue<CoordinateEnum::InferiorToSuperior,
296  CoordinateEnum::RightToLeft,
297  CoordinateEnum::AnteriorToPosterior>,
298  ILA = m_OrientationValue<CoordinateEnum::InferiorToSuperior,
299  CoordinateEnum::LeftToRight,
300  CoordinateEnum::AnteriorToPosterior>,
301  SRA = m_OrientationValue<CoordinateEnum::SuperiorToInferior,
302  CoordinateEnum::RightToLeft,
303  CoordinateEnum::AnteriorToPosterior>,
304  SLA = m_OrientationValue<CoordinateEnum::SuperiorToInferior,
305  CoordinateEnum::LeftToRight,
306  CoordinateEnum::AnteriorToPosterior>,
307 
308  RPI = m_OrientationValue<CoordinateEnum::RightToLeft,
309  CoordinateEnum::PosteriorToAnterior,
310  CoordinateEnum::InferiorToSuperior>,
311  LPI = m_OrientationValue<CoordinateEnum::LeftToRight,
312  CoordinateEnum::PosteriorToAnterior,
313  CoordinateEnum::InferiorToSuperior>,
314  RAI = m_OrientationValue<CoordinateEnum::RightToLeft,
315  CoordinateEnum::AnteriorToPosterior,
316  CoordinateEnum::InferiorToSuperior>,
317  LAI = m_OrientationValue<CoordinateEnum::LeftToRight,
318  CoordinateEnum::AnteriorToPosterior,
319  CoordinateEnum::InferiorToSuperior>,
320  RPS = m_OrientationValue<CoordinateEnum::RightToLeft,
321  CoordinateEnum::PosteriorToAnterior,
322  CoordinateEnum::SuperiorToInferior>,
323  LPS = m_OrientationValue<CoordinateEnum::LeftToRight,
324  CoordinateEnum::PosteriorToAnterior,
325  CoordinateEnum::SuperiorToInferior>,
326  RAS = m_OrientationValue<CoordinateEnum::RightToLeft,
327  CoordinateEnum::AnteriorToPosterior,
328  CoordinateEnum::SuperiorToInferior>,
329  LAS = m_OrientationValue<CoordinateEnum::LeftToRight,
330  CoordinateEnum::AnteriorToPosterior,
331  CoordinateEnum::SuperiorToInferior>,
332 
333  PRI = m_OrientationValue<CoordinateEnum::PosteriorToAnterior,
334  CoordinateEnum::RightToLeft,
335  CoordinateEnum::InferiorToSuperior>,
336  PLI = m_OrientationValue<CoordinateEnum::PosteriorToAnterior,
337  CoordinateEnum::LeftToRight,
338  CoordinateEnum::InferiorToSuperior>,
339  ARI = m_OrientationValue<CoordinateEnum::AnteriorToPosterior,
340  CoordinateEnum::RightToLeft,
341  CoordinateEnum::InferiorToSuperior>,
342  ALI = m_OrientationValue<CoordinateEnum::AnteriorToPosterior,
343  CoordinateEnum::LeftToRight,
344  CoordinateEnum::InferiorToSuperior>,
345  PRS = m_OrientationValue<CoordinateEnum::PosteriorToAnterior,
346  CoordinateEnum::RightToLeft,
347  CoordinateEnum::SuperiorToInferior>,
348  PLS = m_OrientationValue<CoordinateEnum::PosteriorToAnterior,
349  CoordinateEnum::LeftToRight,
350  CoordinateEnum::SuperiorToInferior>,
351  ARS = m_OrientationValue<CoordinateEnum::AnteriorToPosterior,
352  CoordinateEnum::RightToLeft,
353  CoordinateEnum::SuperiorToInferior>,
354  ALS = m_OrientationValue<CoordinateEnum::AnteriorToPosterior,
355  CoordinateEnum::LeftToRight,
356  CoordinateEnum::SuperiorToInferior>,
357 
358  IPR = m_OrientationValue<CoordinateEnum::InferiorToSuperior,
359  CoordinateEnum::PosteriorToAnterior,
360  CoordinateEnum::RightToLeft>,
361  SPR = m_OrientationValue<CoordinateEnum::SuperiorToInferior,
362  CoordinateEnum::PosteriorToAnterior,
363  CoordinateEnum::RightToLeft>,
364  IAR = m_OrientationValue<CoordinateEnum::InferiorToSuperior,
365  CoordinateEnum::AnteriorToPosterior,
366  CoordinateEnum::RightToLeft>,
367  SAR = m_OrientationValue<CoordinateEnum::SuperiorToInferior,
368  CoordinateEnum::AnteriorToPosterior,
369  CoordinateEnum::RightToLeft>,
370  IPL = m_OrientationValue<CoordinateEnum::InferiorToSuperior,
371  CoordinateEnum::PosteriorToAnterior,
372  CoordinateEnum::LeftToRight>,
373  SPL = m_OrientationValue<CoordinateEnum::SuperiorToInferior,
374  CoordinateEnum::PosteriorToAnterior,
375  CoordinateEnum::LeftToRight>,
376  IAL = m_OrientationValue<CoordinateEnum::InferiorToSuperior,
377  CoordinateEnum::AnteriorToPosterior,
378  CoordinateEnum::LeftToRight>,
379  SAL = m_OrientationValue<CoordinateEnum::SuperiorToInferior,
380  CoordinateEnum::AnteriorToPosterior,
381  CoordinateEnum::LeftToRight>,
382 
383  PIR = m_OrientationValue<CoordinateEnum::PosteriorToAnterior,
384  CoordinateEnum::InferiorToSuperior,
385  CoordinateEnum::RightToLeft>,
386  PSR = m_OrientationValue<CoordinateEnum::PosteriorToAnterior,
387  CoordinateEnum::SuperiorToInferior,
388  CoordinateEnum::RightToLeft>,
389  AIR = m_OrientationValue<CoordinateEnum::AnteriorToPosterior,
390  CoordinateEnum::InferiorToSuperior,
391  CoordinateEnum::RightToLeft>,
392  ASR = m_OrientationValue<CoordinateEnum::AnteriorToPosterior,
393  CoordinateEnum::SuperiorToInferior,
394  CoordinateEnum::RightToLeft>,
395  PIL = m_OrientationValue<CoordinateEnum::PosteriorToAnterior,
396  CoordinateEnum::InferiorToSuperior,
397  CoordinateEnum::LeftToRight>,
398  PSL = m_OrientationValue<CoordinateEnum::PosteriorToAnterior,
399  CoordinateEnum::SuperiorToInferior,
400  CoordinateEnum::LeftToRight>,
401  AIL = m_OrientationValue<CoordinateEnum::AnteriorToPosterior,
402  CoordinateEnum::InferiorToSuperior,
403  CoordinateEnum::LeftToRight>,
404  ASL = m_OrientationValue<CoordinateEnum::AnteriorToPosterior,
405  CoordinateEnum::SuperiorToInferior,
406  CoordinateEnum::LeftToRight>
407 
408  };
409 
410 
415  constexpr AnatomicalOrientation(CoordinateEnum primary, CoordinateEnum secondary, CoordinateEnum tertiary)
416  : m_Value(
417  SameOrientationAxes(primary, secondary) || SameOrientationAxes(primary, tertiary) ||
418  SameOrientationAxes(secondary, tertiary)
419  ? PositiveEnum::INVALID
420  : static_cast<PositiveEnum>(
421  (static_cast<uint32_t>(primary) << static_cast<uint8_t>(CoordinateMajornessTermsEnum::PrimaryMinor)) +
422  (static_cast<uint32_t>(secondary) << static_cast<uint8_t>(CoordinateMajornessTermsEnum::SecondaryMinor)) +
423  (static_cast<uint32_t>(tertiary) << static_cast<uint8_t>(CoordinateMajornessTermsEnum::TertiaryMinor))))
424  {}
425 
426 
427  constexpr AnatomicalOrientation(PositiveEnum toOrientation)
428  : m_Value(toOrientation)
429  {}
430 
431 
432  constexpr AnatomicalOrientation(NegativeEnum fromOrientation)
433  : m_Value(PositiveEnum(static_cast<uint32_t>(fromOrientation)))
434  {}
435 
436 #ifndef ITK_FUTURE_LEGACY_REMOVE
437 
441 # if defined(ITK_LEGACY_REMOVE) && !defined(ITK_LEGACY_SILENT) && !defined(ITK_WRAPPING)
442  [[deprecated("Use the AnatomicalOrientation::FromEnum type instead.")]]
443 # endif
444  AnatomicalOrientation(LegacyOrientationType legacyOrientation);
445 #endif
446 
451  : m_Value(ConvertDirectionToPositiveEnum(d))
452  {}
453 
457  static AnatomicalOrientation
458  CreateFromPositiveStringEncoding(std::string str);
459 
460  // Same as CreateFromPositiveStringEncoding but for the NegativeEnum encoding.
461  static AnatomicalOrientation
462  CreateFromNegativeStringEncoding(std::string str);
463 
464  operator PositiveEnum() const { return m_Value; }
465 
467  std::string
468  GetAsPositiveStringEncoding() const;
469 
471  std::string
472  GetAsNegativeStringEncoding() const;
473 
482  static std::string
483  ConvertStringEncoding(std::string str);
484 
488  {
489  return ConvertPositiveEnumToDirection(m_Value);
490  }
491 
492  PositiveEnum
494  {
495  return m_Value;
496  }
497 
498  NegativeEnum
500  {
501  return NegativeEnum(uint32_t(this->m_Value));
502  }
503 
504  CoordinateEnum
506  {
507  return GetCoordinateTerm(CoordinateMajornessTermsEnum::PrimaryMinor);
508  }
509 
510  CoordinateEnum
512  {
513  return GetCoordinateTerm(CoordinateMajornessTermsEnum::SecondaryMinor);
514  }
515 
516  CoordinateEnum
518  {
519  return GetCoordinateTerm(CoordinateMajornessTermsEnum::TertiaryMinor);
520  }
521 
522  std::array<CoordinateEnum, 3>
523  GetTerms() const
524  {
525  return { GetPrimaryTerm(), GetSecondaryTerm(), GetTertiaryTerm() };
526  }
527 
528  static constexpr bool
530  {
531  const uint8_t AxisField = ~1; // mask the lowest bit
532  return (static_cast<uint8_t>(a) & AxisField) == (static_cast<uint8_t>(b) & AxisField);
533  }
534 
535 
536  friend ITKCommon_EXPORT std::ostream &
537  operator<<(std::ostream & out, PositiveEnum value);
538 
539 protected:
541  static DirectionType ConvertPositiveEnumToDirection(PositiveEnum);
542 
543 
545  static PositiveEnum
546  ConvertDirectionToPositiveEnum(const DirectionType & dir);
547 
548 
553  static const std::map<PositiveEnum, std::string> &
554  GetCodeToString();
555 
558  static const std::map<std::string, PositiveEnum> &
559  GetStringToCode();
560 
562 };
563 
565 ITKCommon_EXPORT std::ostream &
566  operator<<(std::ostream & out, typename AnatomicalOrientation::CoordinateEnum value);
567 
569 ITKCommon_EXPORT std::ostream &
570  operator<<(std::ostream & out, typename AnatomicalOrientation::PositiveEnum value);
571 
572 
574 ITKCommon_EXPORT std::ostream &
575  operator<<(std::ostream & out, typename AnatomicalOrientation::NegativeEnum value);
576 
577 ITKCommon_EXPORT std::ostream &
578  operator<<(std::ostream & out, const AnatomicalOrientation & orientation);
579 
580 
581 } // end namespace itk
582 
583 
584 #endif
itk::AnatomicalOrientation::AnatomicalOrientation
constexpr AnatomicalOrientation(NegativeEnum fromOrientation)
Definition: itkAnatomicalOrientation.h:432
itk::AnatomicalOrientation::GetAsDirection
DirectionType GetAsDirection() const
Return the direction cosine matrix for the orientation.
Definition: itkAnatomicalOrientation.h:487
itk::GTest::TypedefsAndConstructors::Dimension2::DirectionType
ImageBaseType::DirectionType DirectionType
Definition: itkGTestTypedefsAndConstructors.h:52
itk::AnatomicalOrientation::NegativeEnum
NegativeEnum
Definition: itkAnatomicalOrientation.h:253
itk::AnatomicalOrientation::DirectionType
typename ImageBase< Dimension >::DirectionType DirectionType
Definition: itkAnatomicalOrientation.h:57
itk::AnatomicalOrientation::GetTertiaryTerm
CoordinateEnum GetTertiaryTerm() const
Definition: itkAnatomicalOrientation.h:517
itk::AnatomicalOrientation::GetPrimaryTerm
CoordinateEnum GetPrimaryTerm() const
Definition: itkAnatomicalOrientation.h:505
itk::operator<<
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, typename AnatomicalOrientation::CoordinateEnum value)
itk::AnatomicalOrientation::m_Value
PositiveEnum m_Value
Definition: itkAnatomicalOrientation.h:561
itk::AnatomicalOrientation::CoordinateMajornessTermsEnum
CoordinateMajornessTermsEnum
Definition: itkAnatomicalOrientation.h:78
itk::AnatomicalOrientation::CoordinateEnum
CoordinateEnum
Definition: itkAnatomicalOrientation.h:66
itk::AnatomicalOrientation::GetTerms
std::array< CoordinateEnum, 3 > GetTerms() const
Definition: itkAnatomicalOrientation.h:523
itk::AnatomicalOrientation::SameOrientationAxes
static constexpr bool SameOrientationAxes(CoordinateEnum a, CoordinateEnum b)
Definition: itkAnatomicalOrientation.h:529
itk::AnatomicalOrientation::AnatomicalOrientation
AnatomicalOrientation(const DirectionType &d)
Definition: itkAnatomicalOrientation.h:450
itkSpatialOrientation.h
itk::SpatialOrientationEnums::ValidCoordinateOrientations
ValidCoordinateOrientations
Definition: itkSpatialOrientation.h:111
itk::Matrix< SpacePrecisionType, VImageDimension, VImageDimension >
itk::AnatomicalOrientation::PositiveEnum
PositiveEnum
Definition: itkAnatomicalOrientation.h:96
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::AnatomicalOrientation::AnatomicalOrientation
constexpr AnatomicalOrientation(PositiveEnum toOrientation)
Definition: itkAnatomicalOrientation.h:427
itk::AnatomicalOrientation::GetAsNegativeOrientation
NegativeEnum GetAsNegativeOrientation() const
Definition: itkAnatomicalOrientation.h:499
itk::AnatomicalOrientation::GetAsPositiveOrientation
PositiveEnum GetAsPositiveOrientation() const
Definition: itkAnatomicalOrientation.h:493
itk::AnatomicalOrientation::GetSecondaryTerm
CoordinateEnum GetSecondaryTerm() const
Definition: itkAnatomicalOrientation.h:511
itk::AnatomicalOrientation
Representations of anatomical orientations and methods to convert between conventions.
Definition: itkAnatomicalOrientation.h:53
itk::GTest::TypedefsAndConstructors::Dimension2::Dimension
constexpr unsigned int Dimension
Definition: itkGTestTypedefsAndConstructors.h:44
itk::AnatomicalOrientation::AnatomicalOrientation
constexpr AnatomicalOrientation(CoordinateEnum primary, CoordinateEnum secondary, CoordinateEnum tertiary)
Initialize with CoordinateEnum's from separate axes.
Definition: itkAnatomicalOrientation.h:415
itkImageBase.h