NorMIT-nav  22.09
An IGT application
cxLandmarkRep.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 #ifndef CXLANDMARKREP_H_
13 #define CXLANDMARKREP_H_
14 
15 #include "cxResourceVisualizationExport.h"
16 
17 #include "cxRepImpl.h"
18 
19 #include <map>
20 #include <QColor>
21 #include "cxImage.h"
22 #include "vtkForwardDeclarations.h"
23 #include "cxGraphicalPrimitives.h"
24 #include "cxLandmark.h"
25 
26 namespace cx
27 {
28 class View;
29 }
30 
31 namespace cx
32 {
33 class Reporter;
34 typedef boost::shared_ptr<class LandmarkRep> LandmarkRepPtr;
35 
41 class cxResourceVisualization_EXPORT LandmarksSource: public QObject
42 {
43 Q_OBJECT
44 public:
45  virtual ~LandmarksSource() {}
46  virtual LandmarkMap getLandmarks() const = 0;
47  virtual Transform3D get_rMl() const = 0;
48  virtual Vector3D getTextPos(Vector3D p_l) const = 0;signals:
49  void changed();
50 };
51 typedef boost::shared_ptr<LandmarksSource> LandmarksSourcePtr;
52 
53 typedef boost::shared_ptr<class PatientLandmarksSource> PatientLandmarksSourcePtr;
54 
55 class cxResourceVisualization_EXPORT PatientLandmarksSource: public LandmarksSource
56 {
57 public:
61  virtual LandmarkMap getLandmarks() const;
62  virtual Transform3D get_rMl() const;
63  virtual Vector3D getTextPos(Vector3D p_l) const;
64 private:
65  PatientModelServicePtr mDataManager;
66 };
67 
68 typedef boost::shared_ptr<class ImageLandmarksSource> ImageLandmarksSourcePtr;
69 
70 class cxResourceVisualization_EXPORT ImageLandmarksSource: public LandmarksSource
71 {
72 public:
74  {
76  }
78  virtual ~ImageLandmarksSource() {}
79  virtual LandmarkMap getLandmarks() const;
80  virtual Transform3D get_rMl() const;
81  virtual Vector3D getTextPos(Vector3D p_l) const;
82 
83  void setData(DataPtr image);
84  DataPtr getData();
85 private:
86  DataPtr mData;
87 };
88 
98 class cxResourceVisualization_EXPORT LandmarkRep: public RepImpl
99 {
100 Q_OBJECT
101 public:
102  static LandmarkRepPtr New(PatientModelServicePtr dataManager, const QString& uid = "");
103  virtual ~LandmarkRep();
104 
105  void setColor(QColor color);
106  void setSecondaryColor(QColor color);
107  void showLandmarks(bool on);
108  void setGraphicsSize(double size);
109  void setLabelSize(double size);
110  virtual QString getType() const { return "LandmarkRep"; }
111 
112  void setPrimarySource(LandmarksSourcePtr primary);
113  void setSecondarySource(LandmarksSourcePtr secondary);
114 
115 protected:
116  LandmarkRep(PatientModelServicePtr dataManager);
117  virtual void addRepActorsToViewRenderer(ViewPtr view);
118  virtual void removeRepActorsFromViewRenderer(ViewPtr view);
119  void clearAll();
120  void addAll();
121  void addLandmark(QString uid);
122 
123 protected slots:
124  void internalUpdate();
125 
126 protected:
127  QColor mInactiveColor;
128  QColor mColor;
132  double mLabelSize;
133 
135  {
140  };
141  typedef std::map<QString, LandmarkGraphics> LandmarkGraphicsMapType;
144  void rescale();
145 
148 
150 
151 private:
152  LandmarkRep();
153 };
154 
158 } //namespace cx
159 
160 #endif /* CXLANDMARKREP_H_ */
cx::LandmarkRep::LandmarkGraphics::mPrimaryPoint
GraphicalPoint3DPtr mPrimaryPoint
the primary coordinate of the landmark
Definition: cxLandmarkRep.h:137
cx::LandmarkRep::LandmarkGraphics
Definition: cxLandmarkRep.h:134
cx::GraphicalPoint3DPtr
boost::shared_ptr< class GraphicalPoint3D > GraphicalPoint3DPtr
Definition: cxForwardDeclarations.h:74
cx::LandmarkRep::getType
virtual QString getType() const
Definition: cxLandmarkRep.h:110
cx::LandmarkRep::LandmarkGraphics::mText
FollowerText3DPtr mText
name of landmark, attached to primary point
Definition: cxLandmarkRep.h:139
cxRepImpl.h
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::LandmarkRep::mViewportListener
ViewportListenerPtr mViewportListener
Definition: cxLandmarkRep.h:143
cxImage.h
cx::LandmarkRep::mSecondaryColor
QColor mSecondaryColor
color used on the secondary coordinate
Definition: cxLandmarkRep.h:129
cx::LandmarkRep::mGraphics
LandmarkGraphicsMapType mGraphics
Definition: cxLandmarkRep.h:142
cx::LandmarkMap
std::map< QString, class Landmark > LandmarkMap
Definition: cxLandmarkRegistrationWidget.h:31
cx::PatientLandmarksSource::~PatientLandmarksSource
virtual ~PatientLandmarksSource()
Definition: cxLandmarkRep.h:60
cxGraphicalPrimitives.h
cx::LandmarksSource
Definition: cxLandmarkRep.h:41
cx::LandmarkRep::LandmarkGraphics::mLine
GraphicalLine3DPtr mLine
line between primary and secondary point
Definition: cxLandmarkRep.h:136
cx::LandmarkRep::mSecondary
LandmarksSourcePtr mSecondary
Definition: cxLandmarkRep.h:147
cx::LandmarkRep::mDataManager
PatientModelServicePtr mDataManager
Definition: cxLandmarkRep.h:149
cx::LandmarkRep::mGraphicsSize
double mGraphicsSize
Definition: cxLandmarkRep.h:131
cx::PatientLandmarksSource
Definition: cxLandmarkRep.h:55
cx::ViewportListenerPtr
boost::shared_ptr< class ViewportListener > ViewportListenerPtr
Definition: cxForwardDeclarations.h:170
cx::PatientLandmarksSourcePtr
boost::shared_ptr< class PatientLandmarksSource > PatientLandmarksSourcePtr
Definition: cxLandmarkRep.h:53
cx::ImageLandmarksSourcePtr
boost::shared_ptr< class ImageLandmarksSource > ImageLandmarksSourcePtr
Definition: cxLandmarkImage2ImageRegistrationWidget.h:25
cx::Transform3D
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
Definition: cxLandmarkPatientRegistrationWidget.h:33
cx::PatientModelServicePtr
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
Definition: cxLogicManager.h:25
cx::DataPtr
boost::shared_ptr< class Data > DataPtr
Definition: cxRegistrationApplicator.h:22
vtkForwardDeclarations.h
cx::LandmarkRep
Definition: cxLandmarkRep.h:98
cx::LandmarkRep::mLabelSize
double mLabelSize
Definition: cxLandmarkRep.h:132
cx::LandmarkRep::LandmarkGraphics::mSecondaryPoint
GraphicalPoint3DPtr mSecondaryPoint
secondary landmark coordinate, accosiated with the primary point
Definition: cxLandmarkRep.h:138
cx::ViewPtr
boost::shared_ptr< class View > ViewPtr
Definition: cxForwardDeclarations.h:110
cx::ImageLandmarksSource
Definition: cxLandmarkRep.h:70
cx::RepImpl
Default implementation of Rep.
Definition: cxRepImpl.h:42
cx::PatientLandmarksSource::New
static PatientLandmarksSourcePtr New(PatientModelServicePtr dataManager)
Definition: cxLandmarkRep.h:58
cx::FollowerText3DPtr
boost::shared_ptr< FollowerText3D > FollowerText3DPtr
Definition: cxGraphicalPrimitives.h:253
cx::LandmarksSourcePtr
boost::shared_ptr< LandmarksSource > LandmarksSourcePtr
Definition: cxLandmarkRep.h:51
cx::LandmarkRepPtr
boost::shared_ptr< class LandmarkRep > LandmarkRepPtr
Definition: cxForwardDeclarations.h:78
cx::LandmarkRep::LandmarkGraphicsMapType
std::map< QString, LandmarkGraphics > LandmarkGraphicsMapType
Definition: cxLandmarkRep.h:141
cx::LandmarkRep::mColor
QColor mColor
the color of the landmark actors
Definition: cxLandmarkRep.h:128
cx::LandmarkRep::mPrimary
LandmarksSourcePtr mPrimary
Definition: cxLandmarkRep.h:146
cx::GraphicalLine3DPtr
boost::shared_ptr< class GraphicalLine3D > GraphicalLine3DPtr
Definition: cxForwardDeclarations.h:73
cx::ImageLandmarksSource::~ImageLandmarksSource
virtual ~ImageLandmarksSource()
Definition: cxLandmarkRep.h:78
cx::LandmarkRep::mShowLandmarks
bool mShowLandmarks
whether or not the actors should be showed in (all) views
Definition: cxLandmarkRep.h:130
cx::ImageLandmarksSource::New
static ImageLandmarksSourcePtr New()
Definition: cxLandmarkRep.h:73
cx::LandmarkRep::mInactiveColor
QColor mInactiveColor
color given to inactive landmarks
Definition: cxLandmarkRep.h:127
cx::Vector3D
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42
cxLandmark.h
cx::LandmarksSource::~LandmarksSource
virtual ~LandmarksSource()
Definition: cxLandmarkRep.h:45