Skip to content

Commit

Permalink
Merge pull request #863 from invesalius/fix-mtms-vector-field
Browse files Browse the repository at this point in the history
Fix mtms vector field
  • Loading branch information
rmatsuda authored Oct 25, 2024
2 parents 79d27bc + f246d33 commit c6eb69a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions invesalius/net/neuronavigation_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,15 @@ def stimulation_pulse_received(self):
wx.CallAfter(Publisher.sendMessage, "Create marker", marker_type=MarkerType.COIL_POSE)

def set_vector_field(self, vector_field):
# Modify vector_field to swap x and y coordinates and adjust z orientation to match mTMS
for vector in vector_field:
# Swap x and y in the position
vector["position"][0], vector["position"][1] = (
vector["position"][1],
-vector["position"][0],
)
# Reverse the z orientation
vector["orientation"][2] = -vector["orientation"][2]
wx.CallAfter(Publisher.sendMessage, "Set vector field", vector_field=vector_field)

def update_robot_status(self, status):
Expand Down

0 comments on commit c6eb69a

Please sign in to comment.