Welcome to Mouse in box’s documentation!

class entry_exit_mouse_box.MouseInOutWidget(napari_viewer: Viewer)[source]
calibrate_results()[source]

Applies the calibration to the distance traveled by the mice, stored in the sessions table.

clear_state()[source]

Resets the state of the widget to its initial state.

dump_table()[source]

Dumps the content of the table in a dictionary.

make_start_frame(row, button)[source]

Sets the frame at which we start measures from the current frame being displayed. The saved index is the one displayed on the screen. (The real one + 1). A source is required before we can set the start frame.

on_table_item_changed(item)[source]

Called when the user modifies an existing line of the table containing the colors and names of the boxes. The new name is processed here before it is provided by the user. Both the layer’s name and the box’s name are updated.

on_threshold_update(value)[source]

Creates a preview layer showing what the mask would be for the current frame for a given threshold. Updates are made only when the threshold is edited. The background reference is required. The produced layer is named ‘threshold_preview’ and is temporary, it will be discarded. This function is the callback for the threshold spinbox.

Parameters:

value – int - The threshold value to use for the preview.

set_min_area()[source]

Uses a polygon drawn by the user over the head of a mouse to define the minimal area to consider that a mouse is present. When summoned, this function must find a shape layer as the active layer, and extract the area of the polygon. The shape layer is then deleted. The value extracted is not stored, it is written in the spinbox.

switch_log_file(new_file_name)[source]

Creates a new log file when we switch to a new experiment video.

toggle_inputs(t)[source]

Used to disable the inputs (buttons and text fields) when a long process is running.

Parameters:

t – bool - True to enable the inputs, False to disable them.

class entry_exit_mouse_box.QtWorkerMFV(in_path, out_path, ref, t, s, r)[source]
class entry_exit_mouse_box.QtWorkerMVP(mask_path, areas, ma, start, duration)[source]
class entry_exit_mouse_box.QtWorkerVMP(video_path, shape)[source]
class entry_exit_mouse_box.ResultsTable(data, name='Data Table', parent=None)[source]
entry_exit_mouse_box.napari_get_reader(path)[source]

A basic implementation of a Reader contribution.

Parameters:

path (str or list of str) – Path to file, or list of paths.

Returns:

If the path is a recognized format, return a function that accepts the same path or list of paths, and returns a list of layer data tuples.

Return type:

function or None

Indices and tables