Skip to content

Commit

Permalink
Updates for code style #37
Browse files Browse the repository at this point in the history
  • Loading branch information
thompson318 committed Jul 25, 2024
1 parent dfc1a5a commit 92c9b9f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
11 changes: 6 additions & 5 deletions sksurgerytutorial01/vtk_aruco_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ def update_view(self):
#see what happens.
self.vtk_overlay_window.set_camera_state({"ClippingRange": [10, 800]})
self.vtk_overlay_window.set_video_image(image)
self.vtk_overlay_window.Initialize() # Allows the interactor to initialize itself.
# Allows the interactor to initialize itself.
self.vtk_overlay_window.Initialize()
self.vtk_overlay_window.Start() # Start the event loop.
self.vtk_overlay_window.Render()

Expand Down Expand Up @@ -100,11 +101,11 @@ def _move_camera(self, tag2camera):
if __name__ == '__main__':
app = QApplication([])

video_source = 0
viewer = OverlayApp(video_source)
VIDEO_SOURCE = 0
viewer = OverlayApp(VIDEO_SOURCE)

model_dir = '../models'
viewer.add_vtk_models_from_dir(model_dir)
MODEL_DIR = '../models'
viewer.add_vtk_models_from_dir(MODEL_DIR)

viewer.show()
viewer.start()
Expand Down
11 changes: 6 additions & 5 deletions sksurgerytutorial01/vtkoverlay_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ def update_view(self):
and render"""
_, image = self.video_source.read()
self.vtk_overlay_window.set_video_image(image)
self.vtk_overlay_window.Initialize() # Allows the interactor to initialize itself.
# Allows the interactor to initialize itself.
self.vtk_overlay_window.Initialize()
self.vtk_overlay_window.Start() # Start the event loop.
self.vtk_overlay_window.Render()

Expand All @@ -34,14 +35,14 @@ def update_view(self):
#is set when we create the instance. This is an index
#starting at 0. If you have more than one webcam, you can
#try using different numbered sources
video_source = 0
viewer = OverlayApp(video_source)
VIDEO_SOURCE = 0
viewer = OverlayApp(VIDEO_SOURCE)

#Set a model directory containing the models you wish
#to render and optionally a colours.txt defining the
#colours to render in.
model_dir = '../models'
viewer.add_vtk_models_from_dir(model_dir)
MODEL_DIR = '../models'
viewer.add_vtk_models_from_dir(MODEL_DIR)

#start the viewer
viewer.show()
Expand Down
11 changes: 6 additions & 5 deletions sksurgerytutorial01/vtkoverlay_with_movement_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ def update_view(self):
self._move_model()

self.vtk_overlay_window.set_video_image(image)
self.vtk_overlay_window.Initialize() # Allows the interactor to initialize itself.
# Allows the interactor to initialize itself.
self.vtk_overlay_window.Initialize()
self.vtk_overlay_window.Start() # Start the event loop.
self.vtk_overlay_window.Render()

Expand All @@ -44,11 +45,11 @@ def _move_model(self):
if __name__ == '__main__':
app = QApplication([])

video_source = 0
viewer = OverlayApp(video_source)
VIDEO_SOURCE = 0
viewer = OverlayApp(VIDEO_SOURCE)

model_dir = '../models'
viewer.add_vtk_models_from_dir(model_dir)
MODEL_DIR = '../models'
viewer.add_vtk_models_from_dir(MODEL_DIR)

viewer.show()
viewer.start()
Expand Down
3 changes: 2 additions & 1 deletion tests/pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ unsafe-load-any-extension=no
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code
extension-pkg-whitelist=numpy
extension-pkg-whitelist=numpy, PySide6
extension-pkg-allow-list=PySide6

[MESSAGES CONTROL]

Expand Down

0 comments on commit 92c9b9f

Please sign in to comment.