STIR 6.4.0
PatientPosition.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2004 - 2007-10-08, Hammersmith Imanet Ltd
3 Copyright (C) 2013, University College London
4 This file is part of STIR.
5
6 SPDX-License-Identifier: Apache-2.0
7
8 See STIR/LICENSE.txt for details
9*/
18
19#ifndef __stir_PatientPosition_H__
20#define __stir_PatientPosition_H__
21
22#include "stir/common.h"
23
24START_NAMESPACE_STIR
29{
30public:
33 {
34 head_in,
35 feet_in,
36 other_orientation,
37 unknown_orientation
38 };
39
40
42 {
43 supine,
44 prone,
45 right,
46 left,
47 other_rotation,
48 unknown_rotation
49 };
50
52
54 {
63 unknown_position
64 };
65
68 : orientation(unknown_orientation),
69 rotation(unknown_rotation)
70 {
71 assert(rotation >= 0);
72 assert(rotation <= unknown_rotation);
73 assert(orientation >= 0);
74 assert(orientation <= unknown_orientation);
75 }
76
77 PatientPosition(OrientationValue orientation, RotationValue rotation)
78 : orientation(orientation),
79 rotation(rotation)
80 {
81 assert(rotation >= 0);
82 assert(rotation <= unknown_rotation);
83 assert(orientation >= 0);
84 assert(orientation <= unknown_orientation);
85 }
86
87 explicit PatientPosition(PositionValue position);
88
89 bool operator==(const PatientPosition& p1) const
90 {
91 return this->get_orientation() == p1.get_orientation() && this->get_position() == p1.get_position()
92 && this->get_position_as_string() == p1.get_position_as_string() && this->get_rotation() == p1.get_rotation();
93 }
94
95 bool operator!=(const PatientPosition& p1) const { return !this->operator==(p1); }
96
97 void set_rotation(const RotationValue rotation_v)
98 {
99 assert(rotation_v >= 0);
100 assert(rotation_v <= unknown_rotation);
101 rotation = rotation_v;
102 }
103 RotationValue get_rotation() const { return rotation; }
104
105 void set_orientation(const OrientationValue orientation_v)
106 {
107 assert(orientation_v >= 0);
108 assert(orientation_v <= unknown_orientation);
109 orientation = orientation_v;
110 }
111 OrientationValue get_orientation() const { return orientation; }
112
113 PositionValue get_position() const;
114
116 const char* get_position_as_string() const;
117
118private:
119 OrientationValue orientation;
120 RotationValue rotation;
121};
122
123END_NAMESPACE_STIR
124#endif
Definition PatientPosition.h:29
PositionValue
enum using DICOM abreviations
Definition PatientPosition.h:54
@ HFDL
Head First-Decubitus Left.
Definition PatientPosition.h:58
@ FFDL
Feet First-Decubitus Left.
Definition PatientPosition.h:62
@ HFS
Head First-Supine.
Definition PatientPosition.h:55
@ FFDR
Feet First-Decubitus Right.
Definition PatientPosition.h:61
@ HFDR
Head First-Decubitus Right.
Definition PatientPosition.h:57
@ HFP
Head First-Prone.
Definition PatientPosition.h:56
@ FFP
Feet First-Prone.
Definition PatientPosition.h:60
@ FFS
Feet First-Supine.
Definition PatientPosition.h:59
RotationValue
enum specifying on what side the patient is lying on
Definition PatientPosition.h:42
OrientationValue
enum specifying if the patient is scanned with the head first in the gantry, or the feet.
Definition PatientPosition.h:33
PatientPosition()
Default constructor (setting to unknown position and orientation)
Definition PatientPosition.h:67
basic configuration include file