main¶

Main module for the tiatoolbox visualization bokeh app.

Functions

add_layer

Add a new layer to the visualization.

bind_cb_obj

Wrapper to bind a callback to a bokeh object.

bind_cb_obj_tog

Wrapper to bind a callback to a bokeh toggle object.

blur_spinner_cb

Callback to change the blur radius.

build_predicate

Builds a predicate string.

change_tiles

Update tilesources.

cmap_select_cb

Callback to change the color map.

color_input_cb

Callback to handle changing the color of an annotation type.

control_tabs_cb

Callback to handle selecting active window.

control_tabs_remove_cb

Callback to handle removing a window.

cprop_input_cb

Change property to color by.

edge_size_cb

Callback to change the size of the edges.

filter_input_cb

Change predicate to be used to filter annotations.

fixed_layer_select_cb

Callback to handle toggling non-annotation layers on and off.

format_info

Format the slide info for display.

gather_ui_elements

Gather all the ui elements into a dict.

get_from_config

Helper to get a value from a config dict.

get_mapper_for_prop

Helper to get appropriate mapper for a property.

get_view_bounds

Helper to get the current view bounds.

handle_graph_layer

Handle adding a graph layer.

hex2rgb

Covert hex rgb string to float rgb(a) tuple.

initialise_overlay

Initialise the newly selected overlay.

initialise_slide

Initialise the newly selected slide.

layer_drop_cb

Set up the newly chosen overlay.

layer_select_cb

Callback to handle toggling specific annotation types on and off.

layer_slider_cb

Callback to handle changing the alpha of a layer.

make_color_dict

Helper to make a color dict from a list of types.

make_color_seq_from_cmap

Helper to make a color sequence from a colormap.

make_safe_name

Helper to make a name safe for use in a URL.

make_ts

Helper to make a tile source.

make_window

Make a new window for a slide.

model_drop_cb

Callback to handle model selection.

name2type

Helper to get original type from stringified version.

node_select_cb

Placeholder callback to do something on node selection.

opt_buttons_cb

Callback to handle options changes in the ui widget.

overlay_alpha_cb

Callback to change the alpha of all overlay layers.

overlay_toggle_cb

Callback to toggle the overlay on/off.

populate_layer_list

Populate the layer list with the available overlays.

populate_slide_list

Populate the slide list with the available slides.

pt_size_cb

Callback to change the size of the points.

res_switch_cb

Callback to switch between resolutions.

rgb2hex

Covert float rgb(a) tuple to hex string.

save_cb

Callback to handle saving annotations.

scale_spinner_cb

Callback to change the max scale.

segment_on_box

Callback to run hovernet on a region of the slide.

set_alpha_glyph

Set the fill and line alpha for a glyph.

setup_config_ui_settings

Set up the UI settings from the config file.

slide_alpha_cb

Callback to change the alpha of the slide.

slide_select_cb

Set up the newly chosen slide.

slide_toggle_cb

Callback to toggle the slide on/off.

tap_event_cb

Callback to handle double tap events to inspect annotations.

to_float_rgb

Helper to convert from int to float rgb(a) tuple.

to_int_rgb

Helper to convert from float to int rgb(a) tuple.

to_model_cb

Callback to run currently selected model.

to_num

Convert a str representation of a number to a numerical value.

type_cmap_cb

Callback to handle changing a type-specific color property.

update

Callback to ensure tiles are updated when needed.

update_mapper

Helper to update the color mapper.

update_renderer

Helper to update a renderer property.

update_ui_on_new_annotations

Update the UI when new annotations are added.

Classes

ColorCycler

Class to cycle through a list of colors.

DocConfig

class to configure and set up a document.

DummyAttr

Dummy class to enable triggering a callback independently of a widget.

TileGroup

Class to keep track of the current tile group.

UIWrapper

Wrapper class to access ui elements.

ViewerState

Class to keep track of the current state of the viewer.