entry_exit_mouse_box package
Submodules
- entry_exit_mouse_box.convert_format module
- entry_exit_mouse_box.mask_from_video module
- entry_exit_mouse_box.measures module
MiceVisibilityProcessor
MiceVisibilityProcessor.filter_visibility()
MiceVisibilityProcessor.get_session_length()
MiceVisibilityProcessor.process_sessions()
MiceVisibilityProcessor.process_visibility_pos()
MiceVisibilityProcessor.smooth_centroids()
MiceVisibilityProcessor.split_frame_ranges()
MiceVisibilityProcessor.start_processing()
MiceVisibilityProcessor.worker()
QtWorkerMVP
- entry_exit_mouse_box.media_manager module
MediaManager
MediaManager.add_source()
MediaManager.get_current_frame_number()
MediaManager.get_fps()
MediaManager.get_height()
MediaManager.get_n_frames()
MediaManager.get_n_sources()
MediaManager.get_source_by_index()
MediaManager.get_source_by_name()
MediaManager.get_video_properties()
MediaManager.get_width()
MediaManager.release()
MediaManager.release_source()
MediaManager.set_frame()
MediaManager.set_logger()
properties_match()
- entry_exit_mouse_box.results_table module
- entry_exit_mouse_box.utils module
- entry_exit_mouse_box.video_mean_processor module
Module contents
- class entry_exit_mouse_box.MediaManager(viewer)[source]
Bases:
object
- add_source(file_path, target_layer, img_type, process=None)[source]
Add a new video source to the manager.
- Parameters:
file_path – Path of the video file to be opened.
target_layer – Name of the layer to which each frame of the video will be loaded.
img_type – Type of the image to be loaded (‘image’ or ‘labels’).
process – Function to be applied to each frame of the video before displaying it.
- Raises:
FileNotFoundError – If the file is not found at the specified path.
IOError – If the file cannot be opened.
ValueError – If the properties of the video do not match the properties of the media already opened.
- Returns:
The properties of the last video added under the form of a dictionary.
- class entry_exit_mouse_box.MouseInOutWidget(napari_viewer: Viewer)[source]
Bases:
QWidget
- background_ready
- calibrate_results()[source]
Applies the calibration to the distance traveled by the mice, stored in the sessions table.
- 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.
- measures_ready
- 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_active_ui(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.
- switch_log_file(new_file_name)[source]
Creates a new log file when we switch to a new experiment video.
- tracking_ready
- update_mouse_length_from_line()[source]
Uses a line or the value in the spinbox to determine a length in pixels that will be converted to physical units. The length is used to determine the size of the mouse in pixels. Later, a fraction of this length will be used to determine the minimum length of a path.
- class entry_exit_mouse_box.QtWorkerMFV(in_path, out_path, ref, t, s, r)[source]
Bases:
QObject
- mask_ready
- class entry_exit_mouse_box.QtWorkerMVP(mask_path, areas, ma, start, duration)[source]
Bases:
QObject
- measures_ready
- class entry_exit_mouse_box.ResultsTable(data, name='Data Table', parent=None)[source]
Bases:
QMainWindow
- 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