To correctly orient the stylus in VTK relative to the head, a manual calibration must be done.
(This is because the head-reference-marker-tool can be placed on the physical head at an arbitrary orientation. Even though the stylus is already calibrated with the camera, it is not calibrated with the physical head, hence the manual step.)
The calibration is defined by 3x3 rotation matrix r_stylus, which rotates the stylus to the correct orientation relative to head. The manual step can be skipped if precise stylus orientation is not important. If the plane of the head-marker-tool is aligned with the physical head's face, the stylus may even look right without calibration.
Additions to code:
Class ProbeVisualizer to show stylus in VTK (simplified copy of CoilVisualizer)
StylusPage in gui/task_navigator + SetStylusOrientation in navigation.py to do the manual calibration
Stylus coordinates are coregistered to VTK with def corregistrate_probe. This replaces corregistrate_dynamic
The stylus can be hidden during navigation with a button in ControlPanel.
Refactors to code (last commit):
Removed CorregistrateCoordinateNoObject thread and made CorregistrateCoordinate able to track both coil and probe, depending on which is visible and if 'Track coil' button is pressed.
Note on aligning passive tracker tools (eg. with Polaris ROM files)
Stylus:
Stylus tip should be aligned in x-axis (pointing in + direction)
Normal of the passive markers should be in positive z-direction
To correctly orient the stylus in VTK relative to the head, a manual calibration must be done. (This is because the head-reference-marker-tool can be placed on the physical head at an arbitrary orientation. Even though the stylus is already calibrated with the camera, it is not calibrated with the physical head, hence the manual step.)
The calibration is defined by 3x3 rotation matrix r_stylus, which rotates the stylus to the correct orientation relative to head. The manual step can be skipped if precise stylus orientation is not important. If the plane of the head-marker-tool is aligned with the physical head's face, the stylus may even look right without calibration.
Additions to code:
Refactors to code (last commit):
Note on aligning passive tracker tools (eg. with Polaris ROM files) Stylus: