Main Widget¶
GUI Main Widget
This file contains a collection of functions relevant to defining the main widget properties of the GUI.
- Usage:
To use this module, import it and instantiate is as you wish:
from Paint4Brains.GUI.MainWidget import MainWidget
main_widget = MainWidget(parameters)
-
class
Paint4Brains.GUI.MainWidget.MainWidget(brain, parent=None)¶ MainWidget class for Paint4Brains.
This class contains the implementation of a series of functions required for the GUI of the Paint4Brains project.
- Args:
- brain (class): BrainData class for Paint4Brains parent (class): Base or parent class
-
extract()¶ Brain extractor
Performs brain extraction using the DeepBrain neural network
This extraction produces a probability mask. The current implementation is hard coded, to keep voxels with probability larger than a half. If the brain has already been extracted it loads a previous version.
Functionality for this method is defined in the BrainData class. This wrapper has been kept here to ensure the displayed image is updated.
-
full_brain()¶ Returns the image to the original brain and head image
Returns the background image to the unextracted brain. Stores the extracted brain.
Functionality for this method is defined in the BrainData class. This wrapper has been kept here to ensure the displayed image is updated.
-
mouse_tracker(pos)¶ Mouse position tracker
Tracks mouse and prints 3-D position to a label
- Args:
- pos (class): QPointF class defining a point in the plane using floating point precision
-
normalize_intensity()¶ Normalize intensity method
A Method that calls the log_normalization method on the brain
Revert to old buttons
Function which if triggered, reverts to the old button layoyt and style
-
update0()¶ Sets the view along axis 0
This affects both labels and image data. This function is called by the first button.
-
update1()¶ Sets the view along axis 1
This affects both labels and image data. This function is called by the second button.
-
update2()¶ Sets the view along axis 2
This affects both labels and image data. This function is called by the third button.
-
update_after_slider()¶ Updates the viewed image after moving the slider.
Updates the displayed slice depending on the new value of the slider. It does this for both the labels and image data.
-
wheelEvent(a0)¶ Wheel event editor
Edits the behaviour of the mouse wheel.
Functionality for this method is defined in the ImageViewer class. This wrapper has been kept here to ensure the slider position is updated.