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

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

Enumerator
PrimaryMinor 
SecondaryMinor 
TertiaryMinor 

Definition at line 78 of file itkAnatomicalOrientation.h.

◆ NegativeEnum

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

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:
itk::AnatomicalOrientation::CoordinateMajornessTermsEnum::SecondaryMinor
itk::AnatomicalOrientation::CoordinateMajornessTermsEnum::PrimaryMinor
itk::AnatomicalOrientation::CoordinateMajornessTermsEnum::TertiaryMinor
itk::AnatomicalOrientation::CoordinateEnum::AnteriorToPosterior
to back
itk::AnatomicalOrientation::CoordinateEnum::RightToLeft
0b0010
itk::AnatomicalOrientation::CoordinateEnum::InferiorToSuperior
to head - 0b1000
itk::AnatomicalOrientation::AnatomicalOrientation
constexpr AnatomicalOrientation(CoordinateEnum primary, CoordinateEnum secondary, CoordinateEnum tertiary)
Initialize with CoordinateEnum's from separate axes.
Definition: itkAnatomicalOrientation.h:415