My Project
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
30namespace boost
31{
32namespace filesystem
33{
34class path;
35}
36}
37
39
48{
49public:
50
52 typedef std::shared_ptr<C3DLandmark> Pointer;
53
59 C3DLandmark(const std::string& name, const C3DFVector& location);
60
65 C3DLandmark(const std::string& name);
66
68 C3DLandmark(const C3DLandmark& other) = default;
69
70
74 const std::string& get_name() const;
75
77 const C3DFVector& get_location() const;
78
79
81 const C3DCamera& get_view() const;
82
83
85 const std::string& get_picture_file()const;
86
93 P2DImage get_picture(const boost::filesystem::path& root_path) const;
94
96 float get_isovalue()const;
97
98
103 void set_location(const C3DFVector& pos);
104
108 void set_view(const C3DCamera& view);
109
114 void set_picture_file(const std::string& picfile);
115
120 void set_isovalue(float value);
121
123 bool has_location()const;
124
125 void print(std::ostream& os)const;
126
127private:
128 // required attributes
129 std::string m_name;
130 bool m_has_location;
131 C3DFVector m_location;
132
133
134 // additional attributes
135 std::string m_picfile;
136 float m_isovalue;
137 C3DCamera m_view;
138
139 mutable P2DImage m_picture;
140};
141
143
144inline
145std::ostream& operator << (std::ostream& os, const C3DLandmark& lm)
146{
147 lm.print(os);
148 return os;
149}
150
152
154
155#endif
156
C2DImage::Pointer P2DImage
Shared pointer representation of the 2D Image.
Definition: 2d/image.hh:120
this class defines the view point for 3D visualization
Definition: camera.hh:35
a named 3D landmark
Definition: landmark.hh:48
const std::string & get_name() const
void print(std::ostream &os) const
C3DLandmark(const C3DLandmark &other)=default
Standard copy constructor.
const std::string & get_picture_file() const
C3DLandmark(const std::string &name)
P2DImage get_picture(const boost::filesystem::path &root_path) const
void set_picture_file(const std::string &picfile)
std::shared_ptr< C3DLandmark > Pointer
Shared pointer type of the landmark.
Definition: landmark.hh:52
const C3DFVector & get_location() const
bool has_location() const
void set_location(const C3DFVector &pos)
float get_isovalue() const
C3DLandmark(const std::string &name, const C3DFVector &location)
const C3DCamera & get_view() const
void set_view(const C3DCamera &view)
void set_isovalue(float value)
#define EXPORT_3D
Definition: defines3d.hh:45
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition: defines.hh:33
#define NS_MIA_END
conveniance define to end the mia namespace
Definition: defines.hh:36
C3DLandmark::Pointer P3DLandmark
Definition: landmark.hh:151
bool EXPORT_3D operator==(const C3DLandmark &a, const C3DLandmark &b)
std::ostream & operator<<(std::ostream &os, const C3DLandmark &lm)
Definition: landmark.hh:145