Computer Assited Medical Intervention Tool Kit  version 4.1
MedicalImageViewer.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2018 Univ. Grenoble Alpes, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
6  *
7  * Visit http://camitk.imag.fr for more information
8  *
9  * This file is part of CamiTK.
10  *
11  * CamiTK is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * CamiTK is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License version 3 for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22  *
23  * $CAMITK_LICENCE_END$
24  ****************************************************************************/
25 
26 
27 #ifndef MEDICAL_IMAGE_VIEWER_H
28 #define MEDICAL_IMAGE_VIEWER_H
29 
30 // -- Core stuff
31 #include "CamiTKAPI.h"
32 #include "Viewer.h"
33 
34 // -- QT stuff
35 #include <QFrame>
36 #include <QGridLayout>
37 #include <QAction>
38 #include <QBoxLayout>
39 
40 namespace camitk {
41 // -- Core stuff classes
42 class InteractiveViewer;
43 
60 class CAMITK_API MedicalImageViewer : public Viewer {
61  Q_OBJECT
62 
63 public:
65  enum LayoutVisibility {
66  VIEWER_ALL,
67  VIEWER_3D,
68  VIEWER_AXIAL,
69  VIEWER_CORONAL,
70  VIEWER_SAGITTAL,
71  VIEWER_ARBITRARY
72  };
73 
75  static MedicalImageViewer* getInstance();
76 
78  ~MedicalImageViewer() override;
79 
82  unsigned int numberOfViewedComponent() override;
85 
87  void refresh(Viewer* whoIsAsking = nullptr) override;
88 
90  QWidget* getWidget(QWidget* parent = nullptr) override;
91 
93  QObject* getPropertyObject() override;
94 
96  QMenu* getMenu() override;
97 
99  QToolBar* getToolBar() override;
100 
108  virtual void setToolbarAutoVisibility(bool);
110 
112  void setVisibleViewer(LayoutVisibility);
113 
114 public slots:
116  void synchronizeSelection();
117 
118 protected:
119 
122 
123 private:
125  void updateLayout();
126 
128  QGridLayout* frameLayout;
129 
131  QVBoxLayout* topLeftLayout;
132 
134  QFrame* frame;
135 
137  QMenu* viewerMenu;
138 
140  LayoutVisibility visibleLayout;
141 
143  QMap<LayoutVisibility, Viewer*> viewers;
144 
146  QList<LayoutVisibility> viewerVisibility;
147 
149  unsigned int displayedTopLevelComponents;
150 
152  static MedicalImageViewer* singleton;
153 
155  bool autoUpdateToolbarVisibility;
156 };
157 
158 }
159 
160 
161 #endif
162 
CamiTKAPI.h
camitk::MedicalImageViewer::getInstance
static MedicalImageViewer * getInstance()
get singleton instance
Definition: MedicalImageViewer.cpp:64
camitk::MedicalImageViewer
The views manager.
Definition: MedicalImageViewer.h:83
Action.h
camitk::MedicalImageViewer::LayoutVisibility
LayoutVisibility
Definition: MedicalImageViewer.h:88
MedicalImageViewer.h
camitk::MedicalImageViewer::MedicalImageViewer
MedicalImageViewer()
Protected construtor (singleton)
Definition: MedicalImageViewer.cpp:74
camitk::Viewer
Viewer is an abstract viewer.
Definition: Viewer.h:55
InteractiveViewer.h
Viewer.h
camitk::Viewer::refresh
virtual void refresh(Viewer *whoIsAsking=nullptr)=0
refresh the view (can be interesting to know which other viewer is calling this)
camitk::refresh
void refresh()
refresh the display
Application.h
CAMITK_API
#define CAMITK_API
Definition: CamiTKAPI.h:49
camitk
Definition: Action.cpp:36
camitk::MedicalImageViewer::singleton
static MedicalImageViewer * singleton
the default instance (singleton)
Definition: MedicalImageViewer.h:175