Project

General

Profile

Implementing the Image Fusion GUI » History » Version 2

Peter Qian, 24/07/2021 03:23 PM

1 1 Peter Qian
h1. Implementing the Image Fusion GUI
2
3
View>mainpage>MainPage.py
4
5
This file is responsible for displaying the main window of the OnkoDICOM program. In order to implement both the button that opens the image fusion window and the tab to which the user can view the image fusion, the tab must be implemented here. Due to the similar nature of the DICOMView.py, the code was copied and refactored so that the mainpage folder contains an ImageFusionView.py. This file is responsible for displaying the Image Fusion tab.
6
7
To create the button to activate Image Fusion, a button is created in the ActionHandler.py file within the Controller folder.
8
<pre><code class="python">
9
# Image Fusion Action
10
        self.icon_image_fusion = QtGui.QIcon()
11
        self.icon_image_fusion.addPixmap(
12
            QtGui.QPixmap(resource_path("res/images/btn-icons/image_fusion_purple_icon.png")),
13
            QtGui.QIcon.Normal,
14
            QtGui.QIcon.On
15
        )
16
        self.action_image_fusion = QtGui.QAction()
17
        self.action_image_fusion.setIcon(self.icon_image_fusion)
18
        self.action_image_fusion.setIconVisibleInMenu(True)
19
        self.action_image_fusion.setText("Image Fusion")
20
        self.action_image_fusion.triggered.connect(self.image_fusion_handler)
21
</code></pre>
22
23 2 Peter Qian
While created, this is not displayed just yet. To display the button, one must go to the src>View>mainpage>ToolBar.py
24
25
26
<pre><code class="python">
27
self.addSeparator()
28
self.addAction(self.action_handler.action_image_fusion)
29
</code></pre>
30
31
32 1 Peter Qian
Has been added on line 158. Once the button is pressed, the function "image_fusion_handler", will be constructed to open the patient window for selecting an image to fuse with.