Skip to content

Commit

Permalink
The issue was that CoilVisualizer was initialized before Navigation. …
Browse files Browse the repository at this point in the history
…Targeting now works with single coil mode by just getting the single coil without ambiguity (multicoil mode will have a different targeting GUI soon)
  • Loading branch information
Tolonen Luka committed Oct 5, 2024
1 parent eb26de0 commit 4bf9d32
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions invesalius/data/visualization/coil_visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class CoilVisualizer:
def __init__(self, renderer, actor_factory, vector_field_visualizer):
self.renderer = renderer
self.tracker = Tracker()
self.navigation = Navigation(None, None) # Navigation is singleton so args dont matter

# Keeps track of whether tracker fiducials have been set.
self.tracker_fiducials_set = self.tracker.AreTrackerFiducialsSet()

Expand Down Expand Up @@ -109,9 +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.coils[self.navigation.main_coil]["center_actor"].GetProperty().SetDiffuseColor(
target_coil_color
)

# 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 Down

0 comments on commit 4bf9d32

Please sign in to comment.