OpenIGTLink & PLUS Surgical Navigation (.igtl, .plus.xml)
@modelscript/igtl (languages/igtl) provides native WebAssembly parsing, DAEBuilder lowering, and ROS 2 URDF / Modelica projections for OpenIGTLink and PLUS Toolkit image-guided surgical navigation systems.
Supported Extensions & Standards
| Extension | Format | Description |
|---|---|---|
.plus.xml, .xml | PLUS Toolkit Config | PlusConfiguration XML defining optical/EM trackers (DataCollection), <CoordinateDefinitions> <PlusOpenIGTLinkServer> streams |
.igtl | OpenIGTLink Stream | Surgical navigation TRANSFORM, POSITION, TRACKING_DATA, IMAGE, and STATUS message definitions |
Key Capabilities
1. Coordinate Frame Graph & Matrix Orthogonality
- Parses
homogeneous transformations across surgical coordinate frames ( Tracker,Patient,Reference,Stylus,StylusTip,Probe,UltrasoundImage,RAS) and computes composite chains via breadth-first graph traversal with automatic matrix inversion.
2. Stylus Pivot Calibration & Fitzpatrick Target Registration Error ( )
- Solves least-squares spherical pivot calibration (
solveTransformChainAndPivot) to determine stylus tip offset, pivot point , and RMS calibration residual ( ). - Evaluates expected surgical Target Registration Error at target
from fiducial markers with Fiducial Localization Error ( ) using Fitzpatrick's formula:
3. ROS 2 URDF & Modelica Projections
- Projects surgical tracker coordinate trees into ROS 2 URDF (
igtlToUrdf) and Modelica 3.x (igtlToModelica).
Pre-Flight Diagnostics
10 rules9 error1 warning
| Code | Rule | Severity | Message |
|---|---|---|---|
M9801 | igtl-non-orthogonal-rotation | error | Transform '<from> -> <to>' has non-orthogonal or reflection 3x3 rotation block (||R^T R - I||_F = <frobErr>, det(R) = <det>). |
M9802 | igtl-invalid-homogeneous-bottom-row | error | Transform '<from> -> <to>' has invalid 4x4 homogeneous bottom row '[<rowStr>]' (expected '[0, 0, 0, 1]'). |
M9803 | igtl-disconnected-coordinate-frame | error | Coordinate frame graph is disconnected: <detail>. |
M9804 | igtl-cyclic-transform-chain | error | Directed cycle detected in coordinate transform definitions: '<cycleStr>'. |
M9805 | igtl-excessive-registration-error | warning | Registration or calibration RMS error '<errorMm> mm' on '<contextName>' exceeds clinical safety threshold '<thresholdMm> mm'. |
M9806 | igtl-invalid-acquisition-rate | error | Device '<deviceId>' has invalid AcquisitionRate '<rateHz> Hz' (must be > 0 Hz). |
M9807 | igtl-unresolved-device-or-channel | error | '<contextName>' references undeclared <refKind> '<refId>'. |
M9808 | igtl-self-transform-identity-mismatch | error | Self-transform '<frameName> -> <frameName>' must be the 4x4 identity matrix. |
M9809 | igtl-invalid-server-port | error | OpenIGTLink server '<serverId>' ListeningPort '<port>' is outside valid TCP port range [1024, 65535]. |
M9810 | igtl-duplicate-transform-edge | error | Duplicate '<Transform>' defined for coordinate frame pair '(<from>, <to>)'. |
Generated from languages/igtl/src/lints/rules.ts. All languages →
CLI Usage
bash
# Inspect tracking devices, SE(3) transforms, and OpenIGTLink servers
msx igtl inspect LaparoscopicTracker.plus.xml
# Validate SE(3) rotation orthogonality, frame connectivity, and TRE limits
msx igtl validate LaparoscopicTracker.plus.xml
# Solve coordinate frame chains, stylus pivot calibration, and Fitzpatrick TRE
msx igtl calibrate LaparoscopicTracker.plus.xml
# Project surgical navigation frame tree to ROS 2 URDF or Modelica
msx igtl to-urdf LaparoscopicTracker.plus.xml > SurgicalTracker.urdf
msx igtl to-modelica LaparoscopicTracker.plus.xml > SurgicalTracker.mo
