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 
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:
64  enum LayoutVisibility {
65  VIEWER_ALL,
66  VIEWER_3D,
67  VIEWER_AXIAL,
68  VIEWER_CORONAL,
69  VIEWER_SAGITTAL,
70  VIEWER_ARBITRARY
71  };
73 
74  Q_INVOKABLE MedicalImageViewer(QString);
75 
77  virtual ~MedicalImageViewer() override;
78 
81  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 
113 public slots:
115  void synchronizeSelection();
116 
117 private:
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 
134  QMenu* viewerMenu;
135 
137  LayoutVisibility visibleLayout;
138 
140  QMap<LayoutVisibility, Viewer*> viewers;
141 
143  QList<LayoutVisibility> viewerVisibility;
144 
146  unsigned int displayedTopLevelComponents;
147 
149  bool autoUpdateToolbarVisibility;
150 };
151 
152 Q_DECLARE_METATYPE(MedicalImageViewer::LayoutVisibility)
153 
154 #endif
155 
MedicalImageViewer::VIEWER_CORONAL
@ VIEWER_CORONAL
Only the coronal InteractiveViewer are visible.
Definition: MedicalImageViewer.h:91
camitk::Viewer::setDescription
void setDescription(QString)
set the viewer's description
Definition: Viewer.cpp:104
InteractiveSliceViewer
Interactive single slice viewer.
Definition: InteractiveSliceViewer.h:63
MedicalImageViewer::LayoutVisibility
LayoutVisibility
Definition: MedicalImageViewer.h:87
MedicalImageViewer::getWidget
QWidget * getWidget() override
get the viewer widget.
Definition: MedicalImageViewer.cpp:103
InteractiveGeometryViewer.h
camitk::Viewer::setToolBarVisibility
void setToolBarVisibility(bool)
set the visibility of the toolbar in the main window (true by default).
Definition: Viewer.cpp:130
MedicalImageViewer::VIEWER_3D
@ VIEWER_3D
Only the 3D InteractiveViewer are visible.
Definition: MedicalImageViewer.h:89
MedicalImageViewer
All-in-one medical image viewer.
Definition: MedicalImageViewer.h:59
InteractiveGeometryViewer
Interactive 3D viewer.
Definition: InteractiveGeometryViewer.h:56
MedicalImageViewer::VIEWER_AXIAL
@ VIEWER_AXIAL
Only the axial InteractiveViewer are visible.
Definition: MedicalImageViewer.h:90
MedicalImageViewer::frame
QFrame * frame
the main widget
Definition: MedicalImageViewer.h:154
Action.h
MedicalImageViewerAPI.h
MedicalImageViewer::VIEWER_ALL
@ VIEWER_ALL
All InteractiveViewer are visible.
Definition: MedicalImageViewer.h:88
MedicalImageViewer::visibleLayout
LayoutVisibility visibleLayout
which viewer(s) is/are currently visible
Definition: MedicalImageViewer.h:160
MEDICALIMAGEVIEWER_API
#define MEDICALIMAGEVIEWER_API
Definition: MedicalImageViewerAPI.h:54
Log.h
MedicalImageViewer::displayedTopLevelComponents
unsigned int displayedTopLevelComponents
number of top-level component that are currently displayed
Definition: MedicalImageViewer.h:169
InteractiveSliceViewer.h
MedicalImageViewer::VIEWER_ARBITRARY
@ VIEWER_ARBITRARY
Only the arbitrary InteractiveViewer are visible.
Definition: MedicalImageViewer.h:93
MedicalImageViewer::southWestLayout
QVBoxLayout * southWestLayout
Definition: MedicalImageViewer.h:149
MedicalImageViewer::autoUpdateToolbarVisibility
bool autoUpdateToolbarVisibility
if true, the toolbar automatically updated
Definition: MedicalImageViewer.h:172
MedicalImageViewer::VIEWER_SAGITTAL
@ VIEWER_SAGITTAL
Only the sagittal InteractiveViewer are visible.
Definition: MedicalImageViewer.h:92
camitk::Viewer::Q_ENUM
Q_ENUM(ViewerType) Viewer(QString name
default constructor
CAMITK_ERROR
#define CAMITK_ERROR(MSG)
Log for error verbosity (the minimum verbosity) Will always appear.
Definition: Log.h:276
MedicalImageViewer.h
MedicalImageViewer::northWestLayout
QVBoxLayout * northWestLayout
The four corners of the main layout.
Definition: MedicalImageViewer.h:148
camitk::Viewer::getMenu
virtual QMenu * getMenu()
get the viewer menu (returns nullptr by default, i.e. there are no default edit menu)
Definition: Viewer.h:245
MedicalImageViewer::synchronizeSelection
void synchronizeSelection()
called when an internal InteractiveViewers has emitted a selectionChanged signal
Definition: MedicalImageViewer.cpp:288
MedicalImageViewer::getPropertyObject
QObject * getPropertyObject() override
get the propertyObject (only the 3D Scene one)
Definition: MedicalImageViewer.cpp:196
MedicalImageViewer::getToolBar
QToolBar * getToolBar() override
get the viewer toolbar
Definition: MedicalImageViewer.cpp:238
camitk::Viewer::selectionChanged
void selectionChanged()
this signal is emitted when the current selection was changed by the viewer
MedicalImageViewer::getVisibleViewer
LayoutVisibility getVisibleViewer() const
get the current layout value
Definition: MedicalImageViewer.cpp:250
MedicalImageViewer::viewers
QMap< LayoutVisibility, Viewer * > viewers
contains all InteractiveViewer instance (access them by LayoutVisibility)
Definition: MedicalImageViewer.h:163
MedicalImageViewer::setToolbarAutoVisibility
virtual void setToolbarAutoVisibility(bool)
force toolbar visibility.
Definition: MedicalImageViewer.cpp:302
MedicalImageViewer::setVisibleViewer
void setVisibleViewer(LayoutVisibility)
called to change the layout, i.e. which viewer is visible
Definition: MedicalImageViewer.cpp:244
MedicalImageViewer::southEastLayout
QVBoxLayout * southEastLayout
Definition: MedicalImageViewer.h:151
camitk::Viewer
Viewer is an abstract class that is the base class for all viewers.
Definition: Viewer.h:180
camitk::Viewer::getWidget
virtual QWidget * getWidget()=0
get the viewer widget.
MedicalImageViewer::getMenu
QMenu * getMenu() override
get the viewer menu
Definition: MedicalImageViewer.cpp:201
MedicalImageViewer::~MedicalImageViewer
virtual ~MedicalImageViewer() override
destructor
Definition: MedicalImageViewer.cpp:62
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::Viewer::getPropertyObject
virtual QObject * getPropertyObject()
get the viewer property object (returns nullptr by default, i.e. there are no property to edit)
Definition: Viewer.h:240
MedicalImageViewer::northEastLayout
QVBoxLayout * northEastLayout
Definition: MedicalImageViewer.h:150
MedicalImageViewer::viewerMenu
QMenu * viewerMenu
the QMenu for the MedicalImageViewer
Definition: MedicalImageViewer.h:157
MedicalImageViewer::refresh
void refresh(Viewer *whoIsAsking=nullptr) override
Definition: MedicalImageViewer.cpp:73
MedicalImageViewer::frameLayout
QGridLayout * frameLayout
The main layout.
Definition: MedicalImageViewer.h:145
MedicalImageViewer::updateLayout
void updateLayout()
set the current visibility of the different viewer
Definition: MedicalImageViewer.cpp:255
MedicalImageViewer::MedicalImageViewer
Q_INVOKABLE MedicalImageViewer(QString)
Definition: MedicalImageViewer.cpp:44
camitk::Viewer::getToolBar
virtual QToolBar * getToolBar()
get the viewer toolbar (returns nullptr by default, i.e. there are no default toolbar)
Definition: Viewer.h:250
MedicalImageViewer::viewerVisibility
QList< LayoutVisibility > viewerVisibility
viewer visibility enum
Definition: MedicalImageViewer.h:166
Application.h
camitk
Definition: Action.cpp:35