ota.gui package¶
Submodules¶
ota.gui.coord_click module¶
-
ota.gui.coord_click.click_coordinates(img, window_title='', block=False)[source]¶ Returns the coordinates of the first click on an image. Warning: Makes use of a global variable: global_click_coord
INPUTS img - cv2 image (Numpy array of intensities) window_title - string that becomes the title of the window, typically displays
instructions of what to click on in the window.- block - Boolean parameter which instructs the function whether or not the image
- should block code progression. Should be set to True for use outside of GUI development.
OUTPUTS click_coord - dictionary object containing row and column indicies of click
coordinates
click_coord = {‘c’: column index, ‘r’: row index}
ota.gui.frame_scroll module¶
-
class
ota.gui.frame_scroll.FrameTracker(ax, video)[source]¶ Bases:
objectObject that displays a video frame. Class used by frame_scroll method.
- ax : object containing elements of a figure
- Used to set window title and axis labels
- video : array_like
- series of video frames
-
class
ota.gui.frame_scroll.PupilTracker(ax, video, pupil_list)[source]¶ Bases:
ota.gui.frame_scroll.FrameTrackerObject that displays a video frame with the located pupil overlayed. Class used by pupil_scroll method.
- ax : object containing elements of a figure
- Used to set window title and axis labels
- video : array_like
- series of video frames
- pupil_list : dictionary
- dictionary of pupils where the key is the frame index and the value is the pupil. Does not need to include all video frames.
-
class
ota.gui.frame_scroll.TorsionTracker(ax, video, pupil_list, offset_first_frame)[source]¶ Bases:
ota.gui.frame_scroll.FrameTrackerTorsion tracking object. Window updates x y axis to visualize torsion. Class used by torsion_scroll method.
- ax : object containing elements of a figure
- Used to set window title and axis labels
- video : array_like
- video to scroll through
- pupil_list : dictionary
- dictionary of pupils where the key is the frame index and the value is the pupil. Does not need to include all video frames.
- offset_first_frame : dictionary
- dictionary of rotation angles. key is the frame index and the value is the rotation. Does not need to include all video frames
-
class
ota.gui.frame_scroll.WindowTracker(ax, video, pupil_list, offset_first_frame, theta_window, WINDOW_RADIUS)[source]¶ Bases:
ota.gui.frame_scroll.FrameTrackerWindow tracking object. Window updates window location while frames are scrolling. Class used by window_scroll method.
- ax : object containing elements of a figure
- Used to set window title and axis labels
- video : array_like
- video to scroll through
- pupil_list : dictionary
- dictionary of pupils where the key is the frame index and the value is the pupil. Does not need to include all video frames.
- offset_first_frame : dictionary
- dictionary of rotation angles. key is the frame index and the value is the rotation. Does not need to include all video frames
- theta_window : tuple of angles
- theta[0] is the lower bound of the window theta[1] is the upper bound of the window
- WINDOW_RADIUS: integer
- Pixel width of the window radius
-
ota.gui.frame_scroll.frame_scroll(video)[source]¶ Allows user to scroll through video frames using the keyboard.
- video : array_like
- video to scroll through
-
ota.gui.frame_scroll.pupil_scroll(video, pupil_list)[source]¶ Overlays pupil during frame scroll
- video : array_like
- video to scroll through
- pupil_list : dictionary
- dictionary of pupils where the key is the frame index and the value is the pupil. Does not need to include all video frames.
-
ota.gui.frame_scroll.torsion_scroll(video, pupil_list, offset_first_frame)[source]¶ Tracks torsion using rotating 2D axis during frame scroll.
- video : array_like
- video to scroll through
- pupil_list : dictionary
- dictionary of pupils where the key is the frame index and the value is the pupil. Does not need to include all video frames.
- offset_first_frame : dictionary
- dictionary of rotation angles. key is the frame index and the value is the rotation. Does not need to include all video frames
-
ota.gui.frame_scroll.window_scroll(video, pupil_list, offset_first_frame, theta_window, WINDOW_RADIUS)[source]¶ Tracks window location during frame scroll.
- video : array_like
- video to scroll through
- pupil_list : dictionary
- dictionary of pupils where the key is the frame index and the value is the pupil. Does not need to include all video frames.
- offset_first_frame : dictionary
- dictionary of rotation angles. key is the frame index and the value is the rotation. Does not need to include all video frames
- theta_window : tuple of angles
- theta[0] is the lower bound of the window theta[1] is the upper bound of the window
- WINDOW_RADIUS: integer
- Pixel width of the window radius
ota.gui.torsion_application module¶
-
class
ota.gui.torsion_application.MeasureTorsion(parent, controller)[source]¶ Bases:
tkinter.FrameMeasurement page of the torsion application.
- Attributes:
- Interpolation:
- Integer A value of 1 indicates interpolation will be used. A value of 0 indicates interpolation will not be used.
- Upsampling:
- Integer A value of 1 indicates upsampling will be used. A value of 0 indicates upsampling will not be used.
- Fulliris:
- Integer A value of 1 indicates that correlation will be performed on the whole iris. A value of 0 indicates that correlation will be performed on a subset of the iris.
- Subset:
- Integer A value of 1 indicates that correlation will be performed on a subset of the iris. A value of 0 indicates that correlation will be performed on the whole iris.
- NoiseReplacement:
- Integer A value of 1 indicates that portions of the iris will be replaced with noise. A value of 0 indicates that no replacement on the iris will be performed
- radial_thickness:
- Integer Radial thickenss of the iris
- upper_iris_occ:
- dictionary, {‘c’: column index, ‘r’: row index} Holds the [row,column] coordinates of the upper boundary of the iris that is not occluded by eyelids or eyelashes.
- lower_iris_occ:
- dictionary, {‘c’: column index, ‘r’: row index} Holds the [row,column] coordinates of the lower boundary of the iris that is not occluded by eyelids or eyelashes.
- resolution:
- Double If upsampling is used, resolution gives the degree of upsampling used during the iris transform. If interpolation is used, iris transform is performed using a transform resolution of 1deg/pixel and interpolated at increments given by resolution.
- feature_coordinates:
- List of dictionaries, {‘c’: column index, ‘r’: row index} Holds the dictionaries of feature coordinates tracked during subset correlation.
- num_features:
- Integer size of the feature_coordinates list.
- window_theta:
- Integer Angle bounds above/below the feature that define the portion of the iris that is to be included in the reference iris window. This window should be smaller than the segment.
- segment_theta:
- Integer Angle bounds above/below the feature that define the portion of the iris that is to be included in each segment, for which the window is to be located in.
-
clear_coordinates()[source]¶ Clear the list of features if multiple have been clicked on and recorded.
-
get_feature_coordinates(controller)[source]¶ Opens the starting video frame in a separate window so that the user can click on a prominent feature. Requires the user to separately ‘record feature coordinates’
-
get_occlusion_coordinates(controller)[source]¶ Opens the starting video frame in a separate window so that the user can click on the upper region of the iris not occluded by upper eyelid or upper eyelashes. Requires the user to separately ‘record upper occlusion coordinates’
-
record_feature_coordinates()[source]¶ Stores feature coordinates clicked on to be used in the torsion quantification method.
-
record_lower_occ()[source]¶ Stores lower occlustion coordinates clicked on to be used in the torsion quantification method.
-
class
ota.gui.torsion_application.OcularTorsionApplication(*args, **kwargs)[source]¶ Bases:
tkinter.TkObject that allows the user to interface with multiple torsion quantification methods.
- Attributes:
video: video object start_frame: integer end_frame: integer save_path: string, local directory location to save results to pupil_list: dictionary of pupil objects
key: (int) video frame value: pupil objecttorsion: a list that holds iris rotations results frame: dictionary that holds the pages of the GUI
key: (str) name of the frame value: GUI page
-
plot_torsion()[source]¶ plots all series within the torsion list in a plotly window. The legend shows all the legend entry relating to each series.
-
run(measure_state)[source]¶ Runs 2D correlation algorithm based on GUI state and common values
- Input:
- measure_state: current state of measurement page of the GUI
-
save_results()[source]¶ Save the output of the torsion results to a CSV
- Inputs:
- data - data object storing the torsion results