iblviewer.qt_application

Functions

main

Classes

MplCanvas

Matplotlib statistics

ViewerApp

This is the main entry point to start a Qt application.

ViewerWindow

This is the main window container that holds the UI, the 3D viewer and statistics

class MplCanvas(parent=None, width=5, height=4, dpi=100, background_color='white')[source]

Bases: matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg

Matplotlib statistics

class ViewerWindow(parent=None)[source]

Bases: PyQt5.QtWidgets.QMainWindow

This is the main window container that holds the UI, the 3D viewer and statistics

initialize(viewer=None, callable=None, stats_callable=None, dark_mode=True, **kwargs)[source]

Initialize the viewer app

Parameters
  • viewer – Either iblviewer.application.Viewer or iblviewer.mouse_brain.MouseBrainViewer

  • callable – A function that you pass to this method. You must write that function with a required parameter (the viewer). This allows you to perform actions with the viewer before content is shown in QT UI. It would also be possible to add a python console in QT in order to run Python code live like in Jupyter notebooks but this isn’t implemented yet.

  • stats_callable – A function that will be executed every time the plot is updated for instance when a new object or sub selecton is made

  • dark_mode – Whether the app is in dark mode or not

initialize_ui()[source]

Initialize the QT UI

onViewerInitialized()[source]
show_viewer()[source]

Show the viewer (when it’s initialized)

set_light_mode()[source]

Set light mode to viewer and stats

set_dark_mode(on=True)[source]

Set dark mode to viewer and stats

Parameters

on – Whether dark mode is on

update_ui()[source]

Update the QT UI

update_statistics()[source]

Update statistics

onObjectsChanged()[source]

Event triggered when the dictionary of 3D objects has been updated

onChangeSelection(value)[source]

Event triggered by QT to change the viewer’s selection

onSelectionChanged()[source]

Event triggered by the viewer when a new valid selection is made

onSearch()[source]
onOpacityChange(value)[source]
onSliceOpacityChange(value)[source]
onTimeSeriesChange(value)[source]
onToggleStatistics()[source]
onToggleMarker()[source]
onToggleOutline()[source]
onToggleColorBar()[source]
onToggleInfoText()[source]
onToggleDarkBackground()[source]
onToggleVolumesLOD()[source]
onToggleMarkerType()[source]
onToggleHollow()[source]
onRemoveObject()[source]
onExportImage()[source]
onExportVideo()[source]
onClipToBounds()[source]
onIsosurface()[source]
onSlicerToggle()[source]
onNewProbe()[source]
onEditProbe()[source]
onToggleOrthoCamera()[source]
onViewSelection()[source]
onToggleAutofocus()[source]
onLeftCameraPreset()[source]
onRightCameraPreset()[source]
onDorsalCameraPreset()[source]
onVentralCameraPreset()[source]
onAnteriorCameraPreset()[source]
onPosteriorCameraPreset()[source]
onClose()[source]
add_input(label_text, change_function=None, layout=None, autocomplete=False)[source]

Add an input line with a label

add_button(label, click_function, layout=None, tooltip=None, auto_render=True, toggle=False, set_checked=False)[source]

Add a new button to a layout

add_checkbox(label, click_function, layout=None, tooltip=None, auto_render=True, set_checked=False)[source]

Add a new checkbox to a layout

add_combo(text, values=None, change_function=None, layout=None, auto_render=True)[source]

Add a new combobox with a label to a layout

add_slider(text, value, min_value=0, max_value=10, step=1, change_function=None, layout=None, ticks=None, label_precision=2, auto_render=True)[source]

Add a new slider with a label to a layout

class ViewerApp[source]

Bases: PyQt5.QtWidgets.QApplication

This is the main entry point to start a Qt application.

initialize(viewer=None, callable=None, stats_callable=None, dark_mode=True, **kwargs)[source]
main()[source]