Common Overlay Apps [Temp Change]

Common use cases for vtk_overlay_window

class sksurgeryutils.common_overlay_apps.OverlayBaseWidget(video_source, dims=None, init_vtk_widget=True)[source]

Bases: PySide6.QtWidgets.QWidget

add_vtk_models_from_dir(directory)[source]

Add VTK models to the foreground. :param: directory, location of models

start()[source]

Starts the timer, which repeatedly triggers the update_view() method.

staticMetaObject = PySide6.QtCore.QMetaObject("OverlayBaseWidget" inherits "QWidget": )
stop()[source]

Stops the timer.

terminate()[source]

Make sure that the VTK Interactor terminates nicely, otherwise it can throw some error messages, depending on the usage.

update_view()[source]

Update the scene background and/or foreground. Should be implemented by sub class

class sksurgeryutils.common_overlay_apps.OverlayOnVideoFeed(video_source, dims=None, init_vtk_widget=True)[source]

Bases: sksurgeryutils.common_overlay_apps.OverlayBaseWidget

staticMetaObject = PySide6.QtCore.QMetaObject("OverlayOnVideoFeed" inherits "OverlayBaseWidget": )
update_view()[source]

Get the next frame of input and display it.

class sksurgeryutils.common_overlay_apps.OverlayOnVideoFeedCropRecord(video_source, output_filename=None, dims=None)[source]

Bases: sksurgeryutils.common_overlay_apps.OverlayBaseWidget

get_output_frame()[source]

Get the output frame to write in numpy format.

on_record_start()[source]

Start recording data on each frame update. It is expected that this will be triggered using a Qt signal e.g. from a button click. (see sksurgerydavinci.ui.Viewers for examples)

on_record_stop()[source]

Stop recording data.

set_roi()[source]

Crop the incoming video stream using ImageCropper. Function is depreciated due to moving to opencv-headless in sksurgeryvtk. I’ve left it in for the minute in case any one is using it without my knowlegde

staticMetaObject = PySide6.QtCore.QMetaObject("OverlayOnVideoFeedCropRecord" inherits "OverlayBaseWidget": )
update_view()[source]

Get the next frame of input, crop and/or write to file (if either enabled).

Misc Utilities

Various image utilities that might be useful in this package.

sksurgeryutils.utils.image_utils.image_to_pixmap(rgb_image)[source]

Converts an OpenCV image to a Qt pixmap.

Parameters:rgb_image – OpenCV image, 3 channel, RGB.
Returns:QPixmap

Any useful utilities relating to displays/screens.

class sksurgeryutils.utils.screen_utils.ScreenController[source]

Bases: object

This class detects the connected screens/monitors, and returns the primary screen and a list of any secondary screens.

list_of_screens()[source]

Return the primary screen and list of other available screens