Module point

Module point 

Source
Expand description

POINT message type implementation

The POINT message type is used to transfer information about fiducials, which are often used in surgical planning and navigation.

§Use Cases

  • Surgical Navigation - Fiducial markers for patient-to-image registration
  • Biopsy Planning - Target points for needle insertion
  • Tumor Localization - Marking tumor boundaries in pre-operative images
  • Anatomical Landmarks - Identifying critical structures (nerves, vessels)
  • Treatment Verification - Comparing planned vs. actual positions

§Point Attributes

Each point contains:

  • 3D Position (x, y, z) - Coordinates in mm
  • Name - Identifier (e.g., “Fiducial_1”, “TumorCenter”)
  • Group - Logical grouping (e.g., “Fiducials”, “Targets”)
  • Color (RGBA) - Visualization color
  • Diameter - Size for rendering (mm)
  • Owner - Associated image/coordinate frame

§Examples

§Registering Fiducial Points for Navigation

use openigtlink_rust::protocol::types::{PointMessage, PointElement};
use openigtlink_rust::protocol::message::IgtlMessage;
use openigtlink_rust::io::ClientBuilder;

let mut client = ClientBuilder::new()
    .tcp("127.0.0.1:18944")
    .sync()
    .build()?;

// Fiducial 1: Nasion (nose bridge)
let fid1 = PointElement::with_details(
    "Nasion",
    "Fiducials",
    [255, 0, 0, 255],        // Red
    [0.0, 85.0, -30.0],      // x, y, z in mm
    5.0,                      // 5mm sphere
    "CTImage"
);

// Fiducial 2: Left ear
let fid2 = PointElement::with_details(
    "LeftEar",
    "Fiducials",
    [0, 255, 0, 255],        // Green
    [-75.0, 0.0, -20.0],
    5.0,
    "CTImage"
);

// Fiducial 3: Right ear
let fid3 = PointElement::with_details(
    "RightEar",
    "Fiducials",
    [0, 0, 255, 255],        // Blue
    [75.0, 0.0, -20.0],
    5.0,
    "CTImage"
);

let point_msg = PointMessage::new(vec![fid1, fid2, fid3]);
let msg = IgtlMessage::new(point_msg, "NavigationSystem")?;
client.send(&msg)?;

§Receiving Biopsy Target Points

use openigtlink_rust::io::IgtlServer;
use openigtlink_rust::protocol::types::PointMessage;

let server = IgtlServer::bind("0.0.0.0:18944")?;
let mut client_conn = server.accept()?;

let message = client_conn.receive::<PointMessage>()?;

println!("Received {} points", message.content.points.len());

for (i, point) in message.content.points.iter().enumerate() {
    println!("\nPoint {}: {}", i + 1, point.name);
    println!("  Group: {}", point.group);
    println!("  Position: ({:.2}, {:.2}, {:.2}) mm",
             point.position[0], point.position[1], point.position[2]);
    println!("  Color: RGB({}, {}, {})",
             point.rgba[0], point.rgba[1], point.rgba[2]);
    println!("  Diameter: {:.2} mm", point.diameter);
}

Structs§

PointElement
Point/fiducial data element
PointMessage
POINT message containing multiple fiducial points