Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #856 #857

Merged
merged 3 commits into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions invesalius/data/viewer_volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -1348,6 +1348,10 @@ def UpdatePointer(self, position):
# Update the pointer sphere.
if self.pointer_actor is None:
self.CreatePointer()

# Hide the pointer during targeting, as it would cover the coil center donut
self.pointer_actor.SetVisibility(not self.target_mode)

self.pointer_actor.SetPosition(position)
# Update the render window manually, as it is not updated automatically when not navigating.
if not self.nav_status:
Expand Down
12 changes: 9 additions & 3 deletions invesalius/data/visualization/coil_visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import invesalius.data.polydata_utils as pu
import invesalius.data.vtk_utils as vtku
import invesalius.session as ses
from invesalius.navigation.navigation import Navigation
from invesalius.navigation.tracker import Tracker
from invesalius.pubsub import pub as Publisher

Expand Down Expand Up @@ -108,7 +109,11 @@ def SetCoilAtTarget(self, state):

# Set the color of both target coil (representing the target) and the coil center (representing the actual coil).
self.target_coil_actor.GetProperty().SetDiffuseColor(target_coil_color)
# self.coil_center_actor.GetProperty().SetDiffuseColor(target_coil_color) # LUKATODO: use main_coil from navigation?

# Multicoil mode will have a different GUI for targeting, so this is irrelevant for multicoil
# In single coil mode, just get the single coil
coil = next(iter(self.coils.values()), None)
coil["center_actor"].GetProperty().SetDiffuseColor(target_coil_color)

def OnNavigationStatus(self, nav_status, vis_status):
self.is_navigating = nav_status
Expand All @@ -118,8 +123,7 @@ def ShowCoil(self, state, coil_name=None):
for coil in self.coils.values():
coil["actor"].SetVisibility(state)
coil["center_actor"].SetVisibility(True) # Always show the center donut actor
if self.target_coil_actor is not None: # LUKATODO: target mode...
self.target_coil_actor.SetVisibility(True) # Keep target visible for now

elif (coil := self.coils.get(coil_name, None)) is not None:
# Just toggle the visibility when dealing with specific coils
new_state = not coil["actor"].GetVisibility()
Expand All @@ -133,6 +137,8 @@ def ShowCoil(self, state, coil_name=None):
elif all(coils_visible): # all coils are shown
Publisher.sendMessage("Press show-coil button", pressed=True)

if self.target_coil_actor is not None:
self.target_coil_actor.SetVisibility(state)
# self.vector_field_assembly.SetVisibility(state) # LUKATODO: Keep this hidden for now

if not self.is_navigating:
Expand Down
2 changes: 1 addition & 1 deletion invesalius/gui/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -1703,7 +1703,7 @@ def OnChooseTracker(self, evt, ctrl):
self.ShowParent()

def OnChooseReferenceMode(self, evt, ctrl):
Navigation().SetReferenceMode(evt.GetSelection())
Navigation(None, None).SetReferenceMode(evt.GetSelection())

def HideParent(self): # hide preferences dialog box
self.GetGrandParent().Hide()
Expand Down
Loading