landmark.hh
Go to the documentation of this file.
1 /* -*- mia-c++ -*-
2  *
3  * This file is part of MIA - a toolbox for medical image analysis
4  * Copyright (c) Leipzig, Madrid 1999-2017 Gert Wollny
5  *
6  * MIA is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with MIA; if not, see <http://www.gnu.org/licenses/>.
18  *
19  */
20 
21 #ifndef mia_3d_landmarks_hh
22 #define mia_3d_landmarks_hh
23 
24 #include <memory>
25 #include <vector>
26 #include <mia/3d/defines3d.hh>
27 #include <mia/3d/camera.hh>
28 #include <mia/2d/image.hh>
29 
30 namespace boost {
31 namespace filesystem {
32 class path;
33 }}
34 
36 
45 public:
46 
48  typedef std::shared_ptr<C3DLandmark> Pointer;
49 
55  C3DLandmark(const std::string& name, const C3DFVector& location);
56 
61  C3DLandmark(const std::string& name);
62 
64  C3DLandmark(const C3DLandmark& other) = default;
65 
66 
70  const std::string& get_name() const;
71 
73  const C3DFVector& get_location() const;
74 
75 
77  const C3DCamera& get_view() const;
78 
79 
81  const std::string& get_picture_file()const;
82 
89  P2DImage get_picture(const boost::filesystem::path& root_path) const;
90 
92  float get_isovalue()const;
93 
94 
99  void set_location(const C3DFVector& pos);
100 
104  void set_view(const C3DCamera& view);
105 
110  void set_picture_file(const std::string& picfile);
111 
116  void set_isovalue(float value);
117 
119  bool has_location()const;
120 
121  void print(std::ostream& os)const;
122 
123 private:
124  // required attributes
125  std::string m_name;
126  bool m_has_location;
127  C3DFVector m_location;
128 
129 
130  // additional attributes
131  std::string m_picfile;
132  float m_isovalue;
133  C3DCamera m_view;
134 
135  mutable P2DImage m_picture;
136 };
137 
138 bool EXPORT_3D operator == (const C3DLandmark& a, const C3DLandmark& b);
139 
140 inline
141 std::ostream& operator << (std::ostream& os, const C3DLandmark& lm)
142 {
143  lm.print(os);
144  return os;
145 }
146 
148 
150 
151 #endif
152 
C2DImage::Pointer P2DImage
Shared pointer representation of the 2D Image.
Definition: 2d/image.hh:119
std::ostream & operator<<(std::ostream &os, const C3DLandmark &lm)
Definition: landmark.hh:141
void print(std::ostream &os) const
std::shared_ptr< C3DLandmark > Pointer
Shared pointer type of the landmark.
Definition: landmark.hh:48
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition: defines.hh:33
#define EXPORT_3D
Definition: defines3d.hh:44
a named 3D landmark
Definition: landmark.hh:44
C3DLandmark::Pointer P3DLandmark
Definition: landmark.hh:147
bool EXPORT_3D operator==(const C3DLandmark &a, const C3DLandmark &b)
this class defines the view point for 3D visualization
Definition: camera.hh:34
#define NS_MIA_END
conveniance define to end the mia namespace
Definition: defines.hh:36