ITK  6.0.0
Insight Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
itk::AnatomicalOrientation Class Reference

#include <itkAnatomicalOrientation.h>

Detailed Description

Representations of anatomical orientations and methods to convert between conventions.

Defines patient specific anatomical names to the XYZ axes of a 3D image.

A class instances holds the patient orientation stored as an enumerated type. Conversion to different representations such as strings and direction cosine matrices are supported.

The use of unambiguous anatomical orientation names such as "RightToLeft" is preferred, where "Right" is the "from direction" and the negative direction of the coordinates, while "Left" is the "to direction" and the positive direction. The following is an unambiguous construction of an AnatomicalOrientation object:

Definition at line 53 of file itkAnatomicalOrientation.h.

+ Collaboration diagram for itk::AnatomicalOrientation:

Public Types

enum class  CoordinateEnum : uint8_t {
  UNKNOWN = 0 ,
  RightToLeft = 2 ,
  LeftToRight = 3 ,
  PosteriorToAnterior = 4 ,
  AnteriorToPosterior = 5 ,
  InferiorToSuperior = 8 ,
  SuperiorToInferior = 9
}
 
using DirectionType = typename ImageBase< Dimension >::DirectionType
 
enum class  NegativeEnum : uint32_t {
  INVALID = 0 ,
  RIP ,
  LIP ,
  RSP ,
  LSP ,
  RIA ,
  LIA ,
  RSA ,
  LSA ,
  IRP ,
  ILP ,
  SRP ,
  SLP ,
  IRA ,
  ILA ,
  SRA ,
  SLA ,
  RPI ,
  LPI ,
  RAI ,
  LAI ,
  RPS ,
  LPS ,
  RAS ,
  LAS ,
  PRI ,
  PLI ,
  ARI ,
  ALI ,
  PRS ,
  PLS ,
  ARS ,
  ALS ,
  IPR ,
  SPR ,
  IAR ,
  SAR ,
  IPL ,
  SPL ,
  IAL ,
  SAL ,
  PIR ,
  PSR ,
  AIR ,
  ASR ,
  PIL ,
  PSL ,
  AIL ,
  ASL
}
 
enum class  PositiveEnum : uint32_t {
  INVALID = 0 ,
  RIP ,
  LIP ,
  RSP ,
  LSP ,
  RIA ,
  LIA ,
  RSA ,
  LSA ,
  IRP ,
  ILP ,
  SRP ,
  SLP ,
  IRA ,
  ILA ,
  SRA ,
  SLA ,
  RPI ,
  LPI ,
  RAI ,
  LAI ,
  RPS ,
  LPS ,
  RAS ,
  LAS ,
  PRI ,
  PLI ,
  ARI ,
  ALI ,
  PRS ,
  PLS ,
  ARS ,
  ALS ,
  IPR ,
  SPR ,
  IAR ,
  SAR ,
  IPL ,
  SPL ,
  IAL ,
  SAL ,
  PIR ,
  PSR ,
  AIR ,
  ASR ,
  PIL ,
  PSL ,
  AIL ,
  ASL
}
 

Public Member Functions

 AnatomicalOrientation (const DirectionType &d)
 
constexpr AnatomicalOrientation (CoordinateEnum primary, CoordinateEnum secondary, CoordinateEnum tertiary)
 
constexpr AnatomicalOrientation (NegativeEnum fromOrientation)
 
constexpr AnatomicalOrientation (PositiveEnum toOrientation)
 
DirectionType GetAsDirection () const
 
NegativeEnum GetAsNegativeOrientation () const
 
std::string GetAsNegativeStringEncoding () const
 
PositiveEnum GetAsPositiveOrientation () const
 
std::string GetAsPositiveStringEncoding () const
 
CoordinateEnum GetPrimaryTerm () const
 
CoordinateEnum GetSecondaryTerm () const
 
std::array< CoordinateEnum, 3 > GetTerms () const
 
CoordinateEnum GetTertiaryTerm () const
 
 operator PositiveEnum () const
 

Static Public Member Functions

static std::string ConvertStringEncoding (std::string str)
 
static AnatomicalOrientation CreateFromNegativeStringEncoding (std::string str)
 
static AnatomicalOrientation CreateFromPositiveStringEncoding (std::string str)
 
static constexpr bool SameOrientationAxes (CoordinateEnum a, CoordinateEnum b)
 

Static Public Attributes

static constexpr unsigned int Dimension = 3
 
static constexpr unsigned int ImageDimension = Dimension
 

Protected Types

enum class  CoordinateMajornessTermsEnum : uint8_t {
  PrimaryMinor = 0 ,
  SecondaryMinor = 8 ,
  TertiaryMinor = 16
}
 

Protected Member Functions

CoordinateEnum GetCoordinateTerm (CoordinateMajornessTermsEnum cmt) const
 

Static Protected Member Functions

static PositiveEnum ConvertDirectionToPositiveEnum (const DirectionType &dir)
 
static DirectionType ConvertPositiveEnumToDirection (PositiveEnum)
 
static const std::map< PositiveEnum, std::string > & GetCodeToString ()
 
static const std::map< std::string, PositiveEnum > & GetStringToCode ()
 

Protected Attributes

PositiveEnum m_Value
 

Static Protected Attributes

template<CoordinateEnum VPrimary, CoordinateEnum VSecondary, CoordinateEnum VTertiary>
static constexpr uint32_t m_OrientationValue
 

Friends

ITKCommon_EXPORT std::ostream & operator<< (std::ostream &out, PositiveEnum value)
 

Member Typedef Documentation

◆ DirectionType

Definition at line 57 of file itkAnatomicalOrientation.h.

Member Enumeration Documentation

◆ CoordinateEnum

enum class itk::AnatomicalOrientation::CoordinateEnum : uint8_t
strong
Enumerator
UNKNOWN 
RightToLeft 

0b0010

LeftToRight 
PosteriorToAnterior 

to front - 0b0100

AnteriorToPosterior 

to back

InferiorToSuperior 

to head - 0b1000

SuperiorToInferior 

to foot

Definition at line 66 of file itkAnatomicalOrientation.h.

◆ CoordinateMajornessTermsEnum

enum class itk::AnatomicalOrientation::CoordinateMajornessTermsEnum : uint8_t
strongprotected
Enumerator
PrimaryMinor 
SecondaryMinor 
TertiaryMinor 

Definition at line 78 of file itkAnatomicalOrientation.h.

◆ NegativeEnum

enum class itk::AnatomicalOrientation::NegativeEnum : uint32_t
strong
Enumerator
INVALID 
RIP 
LIP 
RSP 
LSP 
RIA 
LIA 
RSA 
LSA 
IRP 
ILP 
SRP 
SLP 
IRA 
ILA 
SRA 
SLA 
RPI 
LPI 
RAI 
LAI 
RPS 
LPS 
RAS 
LAS 
PRI 
PLI 
ARI 
ALI 
PRS 
PLS 
ARS 
ALS 
IPR 
SPR 
IAR 
SAR 
IPL 
SPL 
IAL 
SAL 
PIR 
PSR 
AIR 
ASR 
PIL 
PSL 
AIL 
ASL 

Definition at line 253 of file itkAnatomicalOrientation.h.

◆ PositiveEnum

enum class itk::AnatomicalOrientation::PositiveEnum : uint32_t
strong
Enumerator
INVALID 
RIP 
LIP 
RSP 
LSP 
RIA 
LIA 
RSA 
LSA 
IRP 
ILP 
SRP 
SLP 
IRA 
ILA 
SRA 
SLA 
RPI 
LPI 
RAI 
LAI 
RPS 
LPS 
RAS 
LAS 
PRI 
PLI 
ARI 
ALI 
PRS 
PLS 
ARS 
ALS 
IPR 
SPR 
IAR 
SAR 
IPL 
SPL 
IAL 
SAL 
PIR 
PSR 
AIR 
ASR 
PIL 
PSL 
AIL 
ASL 

Definition at line 96 of file itkAnatomicalOrientation.h.

Constructor & Destructor Documentation

◆ AnatomicalOrientation() [1/4]

constexpr itk::AnatomicalOrientation::AnatomicalOrientation ( CoordinateEnum  primary,
CoordinateEnum  secondary,
CoordinateEnum  tertiary 
)
inlineconstexpr

Initialize with CoordinateEnum's from separate axes.

If multiple CoordinateEnums are from the same axes then the Orientation value is INVALID.

Definition at line 415 of file itkAnatomicalOrientation.h.

◆ AnatomicalOrientation() [2/4]

constexpr itk::AnatomicalOrientation::AnatomicalOrientation ( PositiveEnum  toOrientation)
inlineconstexpr

Definition at line 427 of file itkAnatomicalOrientation.h.

◆ AnatomicalOrientation() [3/4]

constexpr itk::AnatomicalOrientation::AnatomicalOrientation ( NegativeEnum  fromOrientation)
inlineconstexpr

Definition at line 432 of file itkAnatomicalOrientation.h.

◆ AnatomicalOrientation() [4/4]

itk::AnatomicalOrientation::AnatomicalOrientation ( const DirectionType d)
inlineexplicit

Conversion for a Direction Cosine Matrix to the closest anatomical orientation. Any partial axis rotations are rounded to the nearest axis, and lost in this conversion.

Definition at line 450 of file itkAnatomicalOrientation.h.

Member Function Documentation

◆ ConvertDirectionToPositiveEnum()

static PositiveEnum itk::AnatomicalOrientation::ConvertDirectionToPositiveEnum ( const DirectionType dir)
staticprotected

Return the closest orientation for a direction cosine matrix.

◆ ConvertPositiveEnumToDirection()

static DirectionType itk::AnatomicalOrientation::ConvertPositiveEnumToDirection ( PositiveEnum  )
staticprotected

Return the direction cosine matrix for a orientation.

◆ ConvertStringEncoding()

static std::string itk::AnatomicalOrientation::ConvertStringEncoding ( std::string  str)
static

An involution to convert between "positive" and "negative" single character encoding strings.

For example the string "RAS" is converted to "LPI" and vice versa.

The input maybe upper or lower case, while the output is always upper case. There is no check that the input is a valid encoding.

◆ CreateFromNegativeStringEncoding()

static AnatomicalOrientation itk::AnatomicalOrientation::CreateFromNegativeStringEncoding ( std::string  str)
static

◆ CreateFromPositiveStringEncoding()

static AnatomicalOrientation itk::AnatomicalOrientation::CreateFromPositiveStringEncoding ( std::string  str)
static

Creates a AnatomicalOrientation from a string with the PositiveEnum encoding. The string is case-insensitive. If the string is not a valid encoding then the orientation is set to INVALID.

◆ GetAsDirection()

DirectionType itk::AnatomicalOrientation::GetAsDirection ( ) const
inline

Return the direction cosine matrix for the orientation.

Definition at line 487 of file itkAnatomicalOrientation.h.

◆ GetAsNegativeOrientation()

NegativeEnum itk::AnatomicalOrientation::GetAsNegativeOrientation ( ) const
inline

Definition at line 499 of file itkAnatomicalOrientation.h.

◆ GetAsNegativeStringEncoding()

std::string itk::AnatomicalOrientation::GetAsNegativeStringEncoding ( ) const

Returns the NegativeEnum encoding as a string. The string is always upper case.

◆ GetAsPositiveOrientation()

PositiveEnum itk::AnatomicalOrientation::GetAsPositiveOrientation ( ) const
inline

Definition at line 493 of file itkAnatomicalOrientation.h.

◆ GetAsPositiveStringEncoding()

std::string itk::AnatomicalOrientation::GetAsPositiveStringEncoding ( ) const

Returns the PositiveEnum encoding as a string. The string is always upper case.

◆ GetCodeToString()

static const std::map< PositiveEnum, std::string > & itk::AnatomicalOrientation::GetCodeToString ( )
staticprotected

Return the global instance of the map from orientation enum to strings.

The implementation uses a function static local variable so the global is created only if needed, only once.

◆ GetCoordinateTerm()

CoordinateEnum itk::AnatomicalOrientation::GetCoordinateTerm ( CoordinateMajornessTermsEnum  cmt) const
protected

◆ GetPrimaryTerm()

CoordinateEnum itk::AnatomicalOrientation::GetPrimaryTerm ( ) const
inline

Definition at line 505 of file itkAnatomicalOrientation.h.

◆ GetSecondaryTerm()

CoordinateEnum itk::AnatomicalOrientation::GetSecondaryTerm ( ) const
inline

Definition at line 511 of file itkAnatomicalOrientation.h.

◆ GetStringToCode()

static const std::map< std::string, PositiveEnum > & itk::AnatomicalOrientation::GetStringToCode ( )
staticprotected

Return the global instance of the map from string to orientation enum.

◆ GetTerms()

std::array< CoordinateEnum, 3 > itk::AnatomicalOrientation::GetTerms ( ) const
inline

Definition at line 523 of file itkAnatomicalOrientation.h.

◆ GetTertiaryTerm()

CoordinateEnum itk::AnatomicalOrientation::GetTertiaryTerm ( ) const
inline

Definition at line 517 of file itkAnatomicalOrientation.h.

◆ operator PositiveEnum()

itk::AnatomicalOrientation::operator PositiveEnum ( ) const
inline

Definition at line 464 of file itkAnatomicalOrientation.h.

◆ SameOrientationAxes()

static constexpr bool itk::AnatomicalOrientation::SameOrientationAxes ( CoordinateEnum  a,
CoordinateEnum  b 
)
inlinestaticconstexpr

Definition at line 529 of file itkAnatomicalOrientation.h.

Friends And Related Function Documentation

◆ operator<<

ITKCommon_EXPORT std::ostream & operator<< ( std::ostream &  out,
PositiveEnum  value 
)
friend

Outputs the PositiveEnum encoding as a string such as "LPS".

Member Data Documentation

◆ Dimension

constexpr unsigned int itk::AnatomicalOrientation::Dimension = 3
staticconstexpr

Definition at line 56 of file itkAnatomicalOrientation.h.

◆ ImageDimension

constexpr unsigned int itk::AnatomicalOrientation::ImageDimension = Dimension
staticconstexpr

Definition at line 58 of file itkAnatomicalOrientation.h.

◆ m_OrientationValue

template<CoordinateEnum VPrimary, CoordinateEnum VSecondary, CoordinateEnum VTertiary>
constexpr uint32_t itk::AnatomicalOrientation::m_OrientationValue
staticconstexprprotected
Initial value:
=
(static_cast<uint32_t>(VPrimary) << static_cast<uint8_t>(CoordinateMajornessTermsEnum::PrimaryMinor)) +
(static_cast<uint32_t>(VSecondary) << static_cast<uint8_t>(CoordinateMajornessTermsEnum::SecondaryMinor)) +
(static_cast<uint32_t>(VTertiary) << static_cast<uint8_t>(CoordinateMajornessTermsEnum::TertiaryMinor))

Definition at line 86 of file itkAnatomicalOrientation.h.

◆ m_Value

PositiveEnum itk::AnatomicalOrientation::m_Value
protected

Definition at line 561 of file itkAnatomicalOrientation.h.


The documentation for this class was generated from the following file: