DiatomTrack.gui package

Submodules

DiatomTrack.gui.editor module

class DiatomTrack.gui.editor.TrackEditor(tracks, video_path)[source]

Bases: object

Main GUI window of the DiatomTrack editor for manual editing and review.

apply_zoom(image)[source]

Apply zoom on current frame.

build_tree()[source]

Build the forest in the tree widget.

canvas_double_right(event)[source]

Select and highlight closest object in canvas upon double right click.

close_window()[source]

Confirm abrupt exit.

down_arrow_press(*args)[source]

Jump one frame backward upon down arrow press.

draw_overlay(image)[source]

Draw the corresponding overlay on the current video frame for all activated information.

draw_rectangle(event)[source]

Draw rectangle overlay to mark out zoomed area.

end_rectangle(*args)[source]

Set dimensions of rectangle and refresh parameters, canvas and tree.

expand_tree()[source]

Expand all trees.

expand_tree_children(parent)[source]

Expand a tree.

faster_video(*args)[source]

Accelerate video playback.

find_age_line_points(row)[source]

Find end points for drawing the side / age / theca marker lines of the cells.

find_trace_line_points(item)[source]

Find the line points of the long axis to draw the trace of an object for the last 10 frames’ position.

finish()[source]

Close window to progress orderly to the next step.

flip_cell()[source]

Flip assigned age of selected track’s / cell’s children if applicable.

flip_frustule()[source]

Flip the thecae / side assignment for the selected tree item.

flip_selected_cell()[source]

Flip assigned age of the selected cell / track.

get_color(item)[source]

Get a random RGB tuple from an objects id.

highlight_track()[source]

Toggle highliting of the selected track in video.

jump_to_frame(*args)[source]

Jump to a frame in the video and update corresponding widgets and overlay.

jump_to_time(*args)[source]

Jump to a timestamp in the video and update corresponding widgets and overlay.

left_arrow_press(*args)[source]

Jump video backward upon left arrow press.

listbox_double_click(*args)[source]

Jump to double clicked frame in standard listbox view.

listbox_right_click(*args)[source]

Remove selected item from listbox when moving tracks in the forest.

manual_update_canvas()[source]

Update video canvas for cases not covered by update_canvas / manual interventions.

merge()[source]

Merge selected tree items if not occuring in the same frame.

play_video()[source]

Toggle video playback.

remove()[source]

Remove items from tree by setting ‘show’ column to 0 in the dataframe and display them in the sparate deleted listbox.

remove_restore_short()[source]

Automatically remove or restore all tracks that are short (len==1).

reset_zoom(*args)[source]

Reset video zoom and rebuild tree.

restart_video()[source]

Jump to first frame of video.

restore()[source]

Restore elements that were removed from the tree by setting the ‘show’ column to 1 in the dataframe.

right_arrow_press(*args)[source]

Jump video forward upon right arrow press.

scrub(val)[source]

Enable scrubbing of the video scrollbar.

shift_overlay(*args)[source]

Toggle overlay with button press.

slower_video(*args)[source]

Decelerate video playback.

spacebar_press(*args)[source]

Start / stop video playback upon spacebar press.

split()[source]

Split selected tree item / track at selected frame in listbox.

start_rectangle(event)[source]

Start drwaing a rectangle as overlay in the canvas upon left click.

swap_tracklets()[source]

Swap two selected tracks at the selected frame (assign everything after the frame to the other).

toggle_cell_age()[source]

Toggle cell age overlay modes.

toggle_frustule_age()[source]

Toggle theca age overlay modes.

toggle_id()[source]

Toggle between shown id for the objects in the frame.

toggle_merge()[source]

Toggle merge mode of tree items.

toggle_move()[source]

Move tracks within a tree or the forest if not overlapping.

toggle_overlay()[source]

Toggle the drawn overlay in video.

toggle_trace()[source]

Toggle trace overlay for last frames.

toggle_tree(*args)[source]

Toggle between showing only selected tree and all trees.

tree_current()[source]

Toggle tree to only show up to current frame.

tree_double_click(*args)[source]

Show only tree of double clicked item in overlay and forest.

tree_double_right(*args)[source]

Reset selected tree and rebuild forest.

tree_select(*args)[source]

Populate list box with frames upon selecting a tree item and highlight the object in the video frame if applicable.

tree_set_limit(*args)[source]

Limit tree to frame that is set in widget.

tree_zoom()[source]

Only show trees in current video zoom.

ui_init(name)[source]

Initialize all window widgets.

Parameters:

name (str) – Name of the experiment for window naming.

Return type:

None.

up_arrow_press(*args)[source]

Jump one frame forward upon up arrow press.

update_canvas()[source]

Update video canvas and associated parameters if not currently drawing rectangle and video is still playing.

update_frame_number(frame)[source]

Update the frame number widget.

update_speed_display()[source]

Update the speed multiplier widget.

update_time(seconds)[source]

Update the video time widget.

window_exception()[source]

Exit immediately.

DiatomTrack.gui.load module

class DiatomTrack.gui.load.ReadSegmentationWindow(file)[source]

Bases: object

Class containing window and reading of segmentation data.

close_window()[source]

Confirm abrupt exit.

read_file()[source]

Read the data from file.

window_exception()[source]

Exit immediately.

class DiatomTrack.gui.load.ReadTrackVideoWindow(file)[source]

Bases: object

Class containing window and extraction of tracking data from track video file.

close_window()[source]

Confirm abrupt exit.

read_file()[source]

Open video and extract metadata to dataframe.

window_exception()[source]

Exit immediately.

class DiatomTrack.gui.load.ReadTrackWindow(file)[source]

Bases: object

Class containing window and reading of tracking data.

close_window()[source]

Confirm abrupt exit.

read_file()[source]

Read data from csv to dataframe.

window_exception()[source]

Exit immediately.

DiatomTrack.gui.load.read_seg(name)[source]

Create and close window for reading of segmentation data.

Parameters:

name (str) – Path to file.

Returns:

The segmentation data (contours).

Return type:

dict

DiatomTrack.gui.load.read_track(name)[source]

Create and close window for reading of tracking data.

Parameters:

name (str) – Path to file.

Returns:

The tracking data.

Return type:

Pandas dataframe

DiatomTrack.gui.load.read_tvf(name)[source]

Create and close window for extraction of tracking data from tvf.

Parameters:

name (str) – Path to video file.

Returns:

  • Pandas dataframe – The tracking data.

  • name (str) – Path to video file.

DiatomTrack.gui.parser module

class DiatomTrack.gui.parser.ParserDirectory[source]

Bases: object

GUI for parsing initial directories for processing from scratch.

close_window()[source]

Confirm abrupt exit.

invoke_confirm(event)[source]

Invoke the Ok button with Return to progress.

parse()[source]

Parse and check inputs and close window if no error.

reset_inputs()[source]

Reset all input fields.

select_saving()[source]

Select the directory for saving.

select_source()[source]

Select the image directory.

select_states()[source]

Select the model states.

skip_window()[source]

Skip this window and go to the next step.

window_exception()[source]

Exit immediately.

class DiatomTrack.gui.parser.ParserEditor[source]

Bases: object

GUI for parsing directories and files for editor.

close_window()[source]

Confirm abrupt exit.

invoke_confirm(event)[source]

Invoke the Ok button with Return to progress.

parse()[source]

Parse and check inputs and close window if no error.

reset_inputs()[source]

Reset all input fields.

select_saving()[source]

Select directory for saving.

select_track()[source]

Select track data.

select_track_video()[source]

Select track video file.

select_video()[source]

Select video file.

window_exception()[source]

Exit immediately.

class DiatomTrack.gui.parser.ParserSkip[source]

Bases: object

GUI for parsing directories for processing from tracking.

close_window()[source]

Confirm abrupt exit.

invoke_confirm(event)[source]

Invoke the Ok button with Return to progress.

parse()[source]

Parse and check inputs and close window if no error.

reset_inputs()[source]

Reset all input fields.

select_saving()[source]

Select directory for saving.

select_segmentation()[source]

Select segmentation data.

select_states()[source]

Select model states.

select_video()[source]

Select video file.

skip_window()[source]

Skip this window and go to the next step.

window_exception()[source]

Exit immediately.

class DiatomTrack.gui.parser.ParserTrack[source]

Bases: object

GUI for parsing tracking parameters.

close_window()[source]

Confirm abrupt exit.

invoke_confirm(event)[source]

Invoke the Ok button with Return to progress.

parse()[source]

Parse and check inputs and close window if no error.

reset_inputs()[source]

Reset all input fields.

window_exception()[source]

Exit immediately.

DiatomTrack.gui.parser.parse_editor()[source]

Get the file and saving information for the editor.

Returns:

Paths to video, track data or combined as track video file, and save directory, and save name.

Return type:

tuple

DiatomTrack.gui.parser.parse_segmentation()[source]

Get the paths and directories for segmentation and additional information, None if parsing / step is skipped.

Returns:

Parsed directories, paths and parameters, or None.

Return type:

tuple or None

DiatomTrack.gui.parser.parse_tracker()[source]

Get the tracking parameters.

Returns:

  • age (int) – Maximum frames an object may be undetected.

  • offset (int) – The maximum distance in Euclidean tracking.

  • split (int) – The maximum distance to consider splitting.

  • gap (int) – The maximum distance for matching after detection gap.

DiatomTrack.gui.save module

class DiatomTrack.gui.save.SaveData(destination_directory, name, video_file, dataframe, original_dataframe, start_time, counts)[source]

Bases: object

The class containing the window for final saving of data.

close_window()[source]

Confirm abrupt exit.

parse()[source]

Parse and check input parameters.

save()[source]

Core function of the window activated upon button press. Activate the saving process.

save_df()[source]

Save dataframe as csv and loop to next step.

save_metadata_video()[source]

Save video and dataframe as metadata in custom track video file.

save_odf()[source]

Save original dataframe as csv and loop to next step.

save_statistics()[source]

Save process statistics and loop to next step.

save_tvf()[source]

Save track video file and close window (and program).

select_saving()[source]

Select directory to save in.

window_exception()[source]

Exit immediately.

Module contents