widgets#

A set of custom widgets

class DataFrameWidget(df, n_digits=2, parent=None)[source]#

Bases: QWidget

set_content()[source]#
class LandmarksSelectorDialog(src_folder, params=None, app=None)[source]#

Bases: WizardDialog

add_marker()[source]#
connect_buttons()[source]#
fixed_coords()[source]#
get_new_color()[source]#
moving_coords()[source]#
remove_marker()[source]#
set_fixed_coords(x, y, z)[source]#
set_moving_coords(x, y, z)[source]#
setup()[source]#
property colors#
property current_color#
property current_marker#
property style_sheets#
class OrthoViewer(img=None, parent=None)[source]#

Bases: object

Orthogonal viewer for 3D images

This is a class that allows to visualize 3D images in 3 orthogonal views.

add_regions()[source]#

Add the regions to the viewer .. rubric:: Returns

plot_orthogonal_views(img=None, parent=None)[source]#

Plot the orthogonal views of the image

Parameters:
  • img (np.ndarray) – The image to plot. If None, the image set at initialization will be used

  • parent (QWidget) – The parent widget to plot into. If None, the parent set at initialization will be used

Returns

setup(img, params, parent=None)[source]#

Initialize the viewer after the object has been created

Parameters:
  • img (np.ndarray) – The 3D image to visualize

  • params (UiParameter) – The parameters object

  • parent (QWidget) – The parent widget

Returns

update_ranges(ranges)[source]#

Update the ranges (min, max) for each axis of the viewer

Parameters:

ranges (list(tuple(float, float)))

Returns

property depth#

Get the depth of the image .. rubric:: Returns

property height#

Get the height of the image .. rubric:: Returns

property shape#

Get the shape of the image .. rubric:: Returns

property width#

Get the width of the image .. rubric:: Returns

class PatternDialog(src_folder, params=None, app=None, min_file_number=10, tile_extension='.ome.tif')[source]#

Bases: WizardDialog

add_group()[source]#
connect_buttons()[source]#
get_patterns()[source]#
get_widgets(image_group_id, axis)[source]#
save_results()[source]#
setup()[source]#
validate_pattern()[source]#
class PerfMonitor(parent, fast_period, slow_period, *args, **kwargs)[source]#

Bases: QWidget

get_cpu_percent()[source]#
get_ram_percent()[source]#
get_thread_percent()[source]#
handle_gpu_vals_updated()[source]#
handle_proc_changed(file_path)[source]#
start()[source]#
stop()[source]#
update_cpu_values()[source]#
update_gpu_values()[source]#
cpu_vals_changed#
gpu_vals_changed#
percent_thread#

The percentage of the CPU used by the most active process of ClearMap

class ProgressWatcher(max_progress=100, main_max_progress=1, parent=None)[source]#

Bases: QWidget

A QWidget that watches the progress of a process. It uses signals to update the progress bar and the text The main setup methods are setup and prepare_for_substep It is meant to be used in conjunction with a ProgressWatcherDialog to which it is connected through its signals

count_dones()[source]#
finish()[source]#
get_progress()[source]#
increment(increment)[source]#
increment_main_progress(increment=1)[source]#
prepare_for_substep(step_length, pattern, step_name)[source]#
Parameters:
  • step_name – str

  • step_length – int The number of steps in the operation

  • pattern – str or re.Pattern or (str, re.Pattern) the text to look for in the logs to check for progress

Returns

reset()[source]#

Reset all the values to their initial state

Returns

reset_log_length()[source]#
set_main_progress(value)[source]#
set_progress(value)[source]#
setup(main_step_name, main_step_length, sub_step_length=0, pattern=None)[source]#

Post initialisation of the

Parameters:
  • main_step_name

  • main_step_length

  • sub_step_length

  • pattern

Returns

aborted#
finished#
main_max_changed#
property main_max_progress#
main_progress_changed#
property main_step_name#
main_step_name_changed#
max_changed#
property max_progress#
progress_changed#
property sub_step_name#
sub_step_name_changed#
class SamplePickerDialog(src_folder, params=None, app=None)[source]#

Bases: WizardDialog

apply_changes()[source]#
connect_buttons()[source]#
handle_add_group(add_to_params=True)[source]#
handle_group_changed()[source]#
parse_sample_folders()[source]#
setup()[source]#
update_current_group_paths()[source]#
class StructurePickerWidget(parent=None)[source]#

Bases: QTreeWidget

static build_tree(tree=None, parent=None)[source]#
static parse_json()[source]#
print_id(itm, col)[source]#
DARK_COLOR = '#2E3436'#
LIGHT_COLOR = 'white'#
class StructureSelector(src_folder, params=None, app=None)[source]#

Bases: WizardDialog

close()[source]#
connect_buttons()[source]#
setup()[source]#
show()[source]#
class TwoListSelection(parent=None)[source]#

Bases: QWidget

addAvailableItems(items)[source]#
connections()[source]#
get_left_elements()[source]#
get_right_elements()[source]#
layout_buttons()[source]#
on_mBtnDown_clicked()[source]#
on_mBtnMoveToAvailable_clicked()[source]#
on_mBtnMoveToSelected_clicked()[source]#
on_mBtnUp_clicked()[source]#
on_mButtonToAvailable_clicked()[source]#
on_mButtonToSelected_clicked()[source]#
setSelectedItems(items)[source]#
setup_layout()[source]#
update_buttons_status()[source]#
class WizardDialog(src_folder, ui_name, ui_title, size, params=None, app=None)[source]#

Bases: object

connect_buttons()[source]#
static enable_widgets(widgets)[source]#
exec()[source]#
fix_btn_boxes_text()[source]#
static hide_widgets(widgets)[source]#
setup()[source]#
setup_mini_brain(mini_brain_scaling=(5, 5, 5))[source]#

Create a downsampled version of the Allen Brain Atlas for the mini brain widget

Parameters:

mini_brain_scaling (tuple(int, int, int)) – The scaling factors for the mini brain. Default is (5, 5, 5)

Returns

tuple(scale, downsampled_array)