mdt.gui package¶
Subpackages¶
- mdt.gui.maps_visualizer package
- Subpackages
- mdt.gui.maps_visualizer.config_tabs package
- mdt.gui.maps_visualizer.design package
- Submodules
- mdt.gui.maps_visualizer.design.main_rc module
- mdt.gui.maps_visualizer.design.ui_MainWindow module
- mdt.gui.maps_visualizer.design.ui_MapSpecificOptions module
- mdt.gui.maps_visualizer.design.ui_TabGeneral module
- mdt.gui.maps_visualizer.design.ui_TabMapSpecific module
- mdt.gui.maps_visualizer.design.ui_TabTextual module
- mdt.gui.maps_visualizer.design.ui_save_image_dialog module
- Module contents
- mdt.gui.maps_visualizer.renderers package
- Submodules
- mdt.gui.maps_visualizer.actions module
- mdt.gui.maps_visualizer.base module
- mdt.gui.maps_visualizer.main module
- mdt.gui.maps_visualizer.widgets module
- Module contents
- Subpackages
- mdt.gui.model_fit package
- Subpackages
- mdt.gui.model_fit.design package
- Submodules
- mdt.gui.model_fit.design.main_gui_rc module
- mdt.gui.model_fit.design.ui_about_dialog module
- mdt.gui.model_fit.design.ui_dialog_get_example_data module
- mdt.gui.model_fit.design.ui_fit_model_tab module
- mdt.gui.model_fit.design.ui_generate_brain_mask_tab module
- mdt.gui.model_fit.design.ui_generate_protocol_load_gb_dialog module
- mdt.gui.model_fit.design.ui_generate_protocol_tab module
- mdt.gui.model_fit.design.ui_generate_protocol_update_dialog module
- mdt.gui.model_fit.design.ui_generate_roi_mask_tab module
- mdt.gui.model_fit.design.ui_main_gui module
- mdt.gui.model_fit.design.ui_optimization_extra_data_add_protocol_map_dialog module
- mdt.gui.model_fit.design.ui_optimization_extra_data_dialog module
- mdt.gui.model_fit.design.ui_optimization_options_dialog module
- mdt.gui.model_fit.design.ui_runtime_settings_dialog module
- Module contents
- mdt.gui.model_fit.tabs package
- mdt.gui.model_fit.design package
- Submodules
- mdt.gui.model_fit.qt_main module
- mdt.gui.model_fit.utils module
- Module contents
- Subpackages
- mdt.gui.widgets package
Submodules¶
mdt.gui.utils module¶
-
class
mdt.gui.utils.
ForwardingListener
(queue)[source]¶ Bases:
mdt.lib.log_handlers.LogListenerInterface
Forwards all incoming messages to the given _logging_update_queue.
Instances of this class can be used as a log listener to the MDT LogDispatchHandler and as a sys.stdout replacement.
Parameters: queue (Queue) – the _logging_update_queue to forward the messages to
-
class
mdt.gui.utils.
MessageReceiver
(queue, *args, **kwargs)[source]¶ Bases:
MockClass
A QObject (to be run in a QThread) which sits waiting for data to come through a Queue.Queue().
It blocks until data is available, and one it has got something from the _logging_update_queue, it sends it to the “MainThread” by emitting a Qt Signal.
-
is_running
¶ set to False to stop the receiver.
Type: boolean
-
finished
= <MockNamedComponent name='mock()' id='140084562413384'>¶
-
text_message_signal
= <MockNamedComponent name='mock()' id='140084562413384'>¶
-
-
class
mdt.gui.utils.
UpdateDescriptor
(attribute_name)[source]¶ Bases:
object
Descriptor that will emit a state_updated_signal at each update.
This accesses from the instance the attribute name prepended with an underscore (_).
-
mdt.gui.utils.
blocked_signals
(*widgets)[source]¶ Small context in which the signals of the given widget are blocked.
Parameters: widgets (QWidget) – one or more widgets
-
mdt.gui.utils.
center_window
(window)[source]¶ Center the given window on the screen.
Parameters: - q_app (QApplication) – for desktop information
- window (QMainWindow) – the window to center
-
mdt.gui.utils.
enable_pyqt_exception_hook
()[source]¶ Enable the PyQt exception handling hook for PyQt versions larger than 5.5.
If this is not enabled, exceptions will be handled silently and will not be printed to the user. This makes it harder to solve the issue.
-
mdt.gui.utils.
function_message_decorator
(header, footer)[source]¶ This creates and returns a decorator that prints a header and footer before executing the function.
Parameters: - header (str) – the header text, we will add extra decoration to it
- footer (str) – the footer text, we will add extra decoration to it
Returns: decorator function
-
mdt.gui.utils.
get_script_file_header_text
(info_fields=None)[source]¶ Get the header file text to use when outputting script files matching GUI actions.
Parameters: info_fields (dict) – fields holding information. Common fields are ‘Purpose’ and ‘Example usage’. These fields are appended to the header text. Returns: the header (comment) text for the automatically generated script. Return type: str
-
mdt.gui.utils.
print_welcome_message
()[source]¶ Prints a small welcome message for after the GUI has loaded.
This prints to stdout. We expect the GUI to catch the stdout events and redirect them to the GUI.
-
mdt.gui.utils.
split_long_path_elements
(original_path, max_single_element_length=25)[source]¶ Split long path elements into smaller ones using spaces
Parameters: - original_path (str) – the path you want to split
- max_single_element_length (int) – the maximum length allowed per path component (folders and filename).
Returns: the same path but with spaces in long path elements. The result will no longer be a valid path.
Return type: str