Class TransformMessage

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

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

    • IGTL_TRANSFORM_SIZE

      public static int IGTL_TRANSFORM_SIZE
  • Constructor Details

    • TransformMessage

      public TransformMessage(String deviceName)
      ** 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
    • TransformMessage

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

      public TransformMessage(String deviceName, double[] positionAray, double[][] rotationMatrix)
  • 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 SetTransformData must have called first

      **

      Specified by:
      packBody in class OpenIGTMessage
      Returns:
      the bytes array containing the body
    • setTransformData

      public byte[] setTransformData(double[] origin, double[][] normals)
      ** To create transform_data from image characteristics and to get the byte array to send
      Parameters:
      origin -
      normals - **
      Returns:
      the bytes array created from the value
    • getTransformData

      public byte[] getTransformData()
      ** To get transform_data byte array **
      Returns:
      the transform_data bytes array
    • setTransformData

      public void setTransformData(byte[] transform_data)
      ** To extract image characteristics from transform_data byte array
      Parameters:
      transform_data -
    • setPosition

      public void setPosition(double a, double b, double c)
      ** To set Image origin
    • getPosition

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

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

      public double[][] getRotationMatrixArray()
      ** To get Image normals **
      Returns:
      the normals matrix
    • setMatrix

      public void setMatrix(double[] origin, double[] t, double[] s, double[] n)
      ** To set Image matrix
      Parameters:
      origin - array
      t - array
      s - array
      n - array **
    • setMatrix

      public void setMatrix(double[] origin, double[][] normals)
      ** To set Image matrix
      Parameters:
      origin - array
      normals - matrix **
    • getMatrix

      public double[][] getMatrix()
      ** To get Image matrix **
      Returns:
      the image matrix
    • setMatrix

      public void setMatrix(double[][] matrix)
      ** To set Image matrix
      Parameters:
      matrix - **
    • toString

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

      public void printDoubleDataArray(double[][] matrixArray)