Class NDArrayMessage

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

public class NDArrayMessage extends OpenIGTMessage
** This class create an NDArray object from bytes received or help to generate bytes to send from it
  • Constructor Details

    • NDArrayMessage

      public NDArrayMessage(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
    • NDArrayMessage

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

      public NDArrayMessage(String deviceName, float[] data)
    • NDArrayMessage

      public NDArrayMessage(String deviceName, byte type, byte dim, short[] size, float[] data)
  • Method Details

    • set1D_FloatData

      public void set1D_FloatData(float[] data)
    • set1D_FloatData

      public void set1D_FloatData()
    • get1DFloatData

      public float[] get1DFloatData()
    • 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()
      Description copied from class: OpenIGTMessage
      ** To create body from image_header and image_data SetImageHeader and SetImageData must have called first

      **

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

      public String toString()
      Description copied from class: OpenIGTMessage
      ** To get message String **
      Specified by:
      toString in class OpenIGTMessage
      Returns:
      the message String