interfaces#

This module contains the interfaces to the different tabs and dialogs in the ClearMap GUI.

class GenericDialog(main_window, name, file_name)[source]#

Bases: GenericUi

Interface to any dialog associated with parameters

init_ui()[source]#
set_params(*args)[source]#

Set the params object which links the UI and the configuration file :param args:

Returns

class GenericTab(main_window, name, tab_idx, ui_file_name)[source]#

Bases: GenericUi

The interface to all tab managers. A tab manager includes a tab widget, the associated parameters and potentially a processor object which handles the computations.

connect_whats_this(info_btn, whats_this_ctrl)[source]#

Utility function to bind the info button to the display of the detailed whatsThis message associated with the control

Parameters:

widget

Returns

disable()[source]#

Disable this tab (UI element) .. rubric:: Returns

display_whats_this(widget)[source]#

Utility function to display the detailed whatsThis message associated with the control

Parameters:

widget

Returns

fix_config()[source]#

Amend the config for the tabs that required live patching the config .. rubric:: Returns

handle_advanced_checked()[source]#

Activate the advanced mode which will display more controls .. rubric:: Returns

init_ui()[source]#
read_configs(cfg_path)[source]#

Read the configuration file associated with the params from the filesystem

Parameters:

cfg_path

Returns

set_params(*args)[source]#

Set the params object which links the UI and the configuration file :param args:

Returns

setup_workers()[source]#

Setup the optional workers (which handle the computations) associated with this tab .. rubric:: Returns

step_exists(step_name, file_list)[source]#

Check that prerequisite step step_name has been run and produced the outputs in file_list

Parameters:
  • step_name

  • file_list

Returns

wrap_step(task_name, func, step_args=None, step_kw_args=None, n_steps=1, abort_func=None, save_cfg=True, nested=True, close_when_done=True, main_thread=False)[source]#

This function wraps the computations of the tab. It should start a new thread to ensure that the UI remains responsive (unless main_thread is set to True). It will also start a progress dialog

Parameters:
  • task_name (str) – The name of the task to be displayed

  • func (function) – The function to run

  • step_args (list) – The positional arguments to func

  • step_kw_args (dict) – The keyword arguments to func

  • n_steps (int) – The number of top level steps in the computation. This will be disabled if nested is False.

  • abort_func (function) – The function to trigger to abort the execution of the computation (bound to the abort button)

  • save_cfg (bool) – Whether to save the configuration to disk before running the computation. This is usually the right choice to ensure that the config reloaded by func is up to date.

  • nested (bool) – Whether the computation has 2 levels of progress

  • close_when_done (bool) – Close the progress dialog when func has finished executing

  • main_thread (bool) – Whether to run in the main thread. Default is False to ensure that the UI thread remains responsive, a new thread will be spawned.

Returns

class GenericUi(main_window, name, ui_file_name, widget_class_name)[source]#

Bases: object

The first layer of interface. This is not implemented directly but is the base class of GenericTab and GenericDialog, themselves interfaces

init_ui()[source]#
load_config_to_gui()[source]#

Set every control on the UI to the value in the params .. rubric:: Returns

patch_button_boxes()[source]#

Patch the button boxes in the ui so that the text corresponds to that defined in QtCreqtor

Returns

set_params(*args)[source]#

Set the params object which links the UI and the configuration file :param args:

Returns

set_progress_watcher(watcher)[source]#
class PostProcessingTab(main_window, name, tab_idx, ui_file_name)[source]#

Bases: GenericTab

Interface to all the tab managers in charge of post processing the data (e.e. typically detecting relevant info in the data). One particularity of a post processing tab manager is that it includes the corresponding pre processor. A tab manager includes a tab widget, the associated parameters and potentially a processor object which handles the computations.

plot_slicer(slicer_prefix, tab, params)[source]#

Display the orthoslicer to pick a subset of 3D data. This is typically used to create a small dataset to test parameters for long running operations before analysing the whole sample

Parameters:
  • slicer_prefix

  • tab

  • params

Returns

set_params(sample_params, alignment_params)[source]#

Set the params object which links the UI and the configuration file :param args:

Returns

setup_preproc(pre_processor)[source]#

Set the PreProcessor object associated with the sample

Parameters:

pre_processor (PreProcessor)

Returns