Computer Assisted Medical Intervention Tool Kit  version 5.2
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-2024 Univ. Grenoble Alpes, CNRS, Grenoble INP - UGA, TIMC, 38000 Grenoble, France
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 #include "MedicalImageViewerAPI.h"
31 
32 // -- Core stuff
33 #include <Viewer.h>
34 
35 // -- QT stuff
36 #include <QFrame>
37 #include <QGridLayout>
38 #include <QAction>
39 #include <QBoxLayout>
40 
60  Q_OBJECT
61 
62 public:
70  VIEWER_ARBITRARY
71  };
73 
74  Q_INVOKABLE MedicalImageViewer(QString);
75 
77  virtual ~MedicalImageViewer() override;
78 
83  void refresh(Viewer* whoIsAsking = nullptr) override;
84 
86  QWidget* getWidget() override;
87 
90 
92  QMenu* getMenu() override;
93 
95  QToolBar* getToolBar() override;
96 
110  void setToolBarVisibility(bool) override;
112 
114  void setVisibleViewer(LayoutVisibility);
115 
117  LayoutVisibility getVisibleViewer() const;
118 
120 
133  CAMITK_API_DEPRECATED("This method is deprecated please use setToolbarVisibility(..) instead") virtual void setToolbarAutoVisibility(bool);
135 
136 public slots:
138  void synchronizeSelection();
139 
140 private:
142  void updateLayout();
143 
145  QGridLayout* frameLayout;
146 
148  QVBoxLayout* northWestLayout;
149  QVBoxLayout* southWestLayout;
150  QVBoxLayout* northEastLayout;
151  QVBoxLayout* southEastLayout;
152 
154  QFrame* frame;
155 
157  QMenu* viewerMenu;
158 
160  LayoutVisibility visibleLayout;
161 
163  QMap<LayoutVisibility, Viewer*> viewers;
164 
166  QList<LayoutVisibility> viewerVisibility;
167 
169  unsigned int displayedTopLevelComponents;
170 
172  bool autoUpdateToolbarVisibility;
173 };
174 
175 Q_DECLARE_METATYPE(MedicalImageViewer::LayoutVisibility)
176 
177 #endif
178 
#define CAMITK_API_DEPRECATED(X)
Definition: CamiTKAPI.h:94
#define MEDICALIMAGEVIEWER_API
Definition: MedicalImageViewerAPI.h:54
All-in-one medical image viewer.
Definition: MedicalImageViewer.h:59
Q_ENUM(LayoutVisibility)
LayoutVisibility
describes the possible currently displayed InteractiveViewer
Definition: MedicalImageViewer.h:64
@ VIEWER_3D
Only the 3D InteractiveViewer are visible.
Definition: MedicalImageViewer.h:66
@ VIEWER_CORONAL
Only the coronal InteractiveViewer are visible.
Definition: MedicalImageViewer.h:68
@ VIEWER_SAGITTAL
Only the sagittal InteractiveViewer are visible.
Definition: MedicalImageViewer.h:69
@ VIEWER_AXIAL
Only the axial InteractiveViewer are visible.
Definition: MedicalImageViewer.h:67
@ VIEWER_ALL
All InteractiveViewer are visible.
Definition: MedicalImageViewer.h:65
Definition: PersistenceManager.h:34
This class describes a property object.
Definition: PropertyObject.h:72
Viewer is an abstract class that is the base class for all viewers.
Definition: Viewer.h:181
virtual PropertyObject * getPropertyObject()
get the viewer property object (returns nullptr by default, i.e. there are no property to edit)
Definition: Viewer.h:241
virtual QMenu * getMenu()
get the viewer menu (returns nullptr by default, i.e. there are no default edit menu)
Definition: Viewer.h:246
virtual QWidget * getWidget()=0
get the viewer widget.
virtual void setToolBarVisibility(bool)
set the visibility of the toolbar in the main window (true by default).
Definition: Viewer.cpp:117
virtual void refresh(Viewer *whoIsAsking=nullptr)=0
refresh the view (can be interesting to know which other viewer is calling this)
virtual QToolBar * getToolBar()
get the viewer toolbar (returns nullptr by default, i.e. there are no default toolbar)
Definition: Viewer.h:251