Computer Assited Medical Intervention Tool Kit  version 5.0
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-2021 Univ. Grenoble Alpes, CNRS, Grenoble INP, 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
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
62public:
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
89 QObject* getPropertyObject() override;
90
92 QMenu* getMenu() override;
93
95 QToolBar* getToolBar() override;
96
104 virtual void setToolbarAutoVisibility(bool);
106
108 void setVisibleViewer(LayoutVisibility);
109
111 LayoutVisibility getVisibleViewer() const;
112
113public slots:
115 void synchronizeSelection();
116
117private:
119 void updateLayout();
120
122 QGridLayout* frameLayout;
123
125 QVBoxLayout* northWestLayout;
126 QVBoxLayout* southWestLayout;
127 QVBoxLayout* northEastLayout;
128 QVBoxLayout* southEastLayout;
129
131 QFrame* frame;
132
135
138
140 QMap<LayoutVisibility, Viewer*> viewers;
141
143 QList<LayoutVisibility> viewerVisibility;
144
147
150};
151
152Q_DECLARE_METATYPE(MedicalImageViewer::LayoutVisibility)
153
154#endif
155
#define MEDICALIMAGEVIEWER_API
Definition: MedicalImageViewerAPI.h:54
All-in-one medical image viewer.
Definition: MedicalImageViewer.h:59
QMenu * viewerMenu
the QMenu for the MedicalImageViewer
Definition: MedicalImageViewer.h:134
QGridLayout * frameLayout
The main layout.
Definition: MedicalImageViewer.h:122
QVBoxLayout * northEastLayout
Definition: MedicalImageViewer.h:127
Q_ENUM(LayoutVisibility)
QVBoxLayout * southEastLayout
Definition: MedicalImageViewer.h:128
unsigned int displayedTopLevelComponents
number of top-level component that are currently displayed
Definition: MedicalImageViewer.h:146
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
QVBoxLayout * southWestLayout
Definition: MedicalImageViewer.h:126
LayoutVisibility visibleLayout
which viewer(s) is/are currently visible
Definition: MedicalImageViewer.h:137
QMap< LayoutVisibility, Viewer * > viewers
contains all InteractiveViewer instance (access them by LayoutVisibility)
Definition: MedicalImageViewer.h:140
bool autoUpdateToolbarVisibility
if true, the toolbar automatically updated
Definition: MedicalImageViewer.h:149
QList< LayoutVisibility > viewerVisibility
viewer visibility enum
Definition: MedicalImageViewer.h:143
QFrame * frame
the main widget
Definition: MedicalImageViewer.h:131
QVBoxLayout * northWestLayout
The four corners of the main layout.
Definition: MedicalImageViewer.h:125
Viewer is an abstract class that is the base class for all viewers.
Definition: Viewer.h:180
virtual QToolBar * getToolBar()
get the viewer toolbar (returns nullptr by default, i.e. there are no default toolbar)
Definition: Viewer.h:250
virtual QWidget * getWidget()=0
get the viewer widget.
virtual void refresh(Viewer *whoIsAsking=nullptr)=0
refresh the view (can be interesting to know which other viewer is calling this)
virtual QObject * getPropertyObject()
get the viewer property object (returns nullptr by default, i.e. there are no property to edit)
Definition: Viewer.h:240
virtual QMenu * getMenu()
get the viewer menu (returns nullptr by default, i.e. there are no default edit menu)
Definition: Viewer.h:245