Class PositionMessage

java.lang.Object
org.medcare.igtl.messages.OpenIGTMessage
org.medcare.igtl.messages.PositionMessage

public class PositionMessage extends OpenIGTMessage
** This class create an Position object from bytes received or help to generate bytes to send from it
  • Field Details

    • IGTL_POSITION_MESSAGE_DEFAULT_SIZE

      public static int IGTL_POSITION_MESSAGE_DEFAULT_SIZE
    • IGTL_POSITION_MESSAGE_POSITON_ONLY_SIZE

      public static int IGTL_POSITION_MESSAGE_POSITON_ONLY_SIZE
    • IGTL_POSITION_MESSAGE_WITH_QUATERNION3_SIZE

      public static int IGTL_POSITION_MESSAGE_WITH_QUATERNION3_SIZE
    • POSITION_ONLY

      public static int POSITION_ONLY
    • WITH_QUATERNION3

      public static int WITH_QUATERNION3
    • ALL

      public static int ALL
    • position

      public static double[] position
    • quaternion

      public Quaternion quaternion
  • Constructor Details

    • PositionMessage

      public PositionMessage(String deviceName, double[] ds, Quaternion RotationNR)
      ** Constructor to be used to create message to send them with this constructor you must use method SetImageHeader, then CreateBody and then getBytes to send them **
      Parameters:
      deviceName - Device Name
      ds -
    • PositionMessage

      public PositionMessage(Header header, byte[] body) throws Exception
      ** Constructor to be used to create message from received data
      Parameters:
      header -
      body -
      Throws:
      Exception
  • Method Details

    • unpackBody

      public boolean unpackBody() throws Exception
      ** To create body from body array

      **

      Specified by:
      unpackBody in class OpenIGTMessage
      Returns:
      true if unpacking is ok
      Throws:
      Exception
    • packBody

      public byte[] packBody()
      ** To create body from image_header and image_data SetPositionData must have called first

      **

      Specified by:
      packBody in class OpenIGTMessage
      Returns:
      the bytes array containing the message
    • setPositionData

      public byte[] setPositionData(double[] position, Quaternion quaternion, int quaternionSize)
      ** To create position_data from image characteristics and to get the byte array to send
      Parameters:
      position -
      quaternion -
      quaternionSize - **
      Returns:
      the bytes array created from the value
    • setPositionData

      public void setPositionData(byte[] position_data) throws Exception
      ** To extract image characteristics from position_data byte array
      Parameters:
      position_data -
      Throws:
      Exception
    • getPositionData

      public byte[] getPositionData()
      ** To get position_data byte array **
      Returns:
      the position_data bytes array
    • setPosition

      public void setPosition(double[] position)
      ** To set Image position
      Parameters:
      position - **
    • setPosition

      public void setPosition(double x, double y, double z)
      ** To set Image position
      Parameters:
      x -
      y -
      z - **
    • getPosition

      public double[] getPosition()
      ** To get Image position **
      Returns:
      the position bytes array
    • getQuaternion

      public Quaternion getQuaternion()
      ** To get Image quaternion **
      Returns:
      the quaternion array
    • toString

      public String toString()
      ** To get position String **
      Specified by:
      toString in class OpenIGTMessage
      Returns:
      the position String