Package org.medcare.igtl.messages
Class NDArrayMessage
java.lang.Object
org.medcare.igtl.messages.OpenIGTMessage
org.medcare.igtl.messages.NDArrayMessage
** This class create an NDArray object from bytes received or help to generate
bytes to send from it
-
Field Summary
Fields inherited from class org.medcare.igtl.messages.OpenIGTMessage
bytesArray, deviceName, VERSION
-
Constructor Summary
ConstructorDescriptionNDArrayMessage
(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 **NDArrayMessage
(String deviceName, byte type, byte dim, short[] size, float[] data) NDArrayMessage
(String deviceName, float[] data) NDArrayMessage
(Header header, byte[] body) ** Constructor to be used to create message from received data -
Method Summary
Modifier and TypeMethodDescriptionfloat[]
byte[]
packBody()
** To create body from image_header and image_data SetImageHeader and SetImageData must have called firstvoid
void
set1D_FloatData
(float[] data) toString()
** To get message String **boolean
** To create body from body arrayMethods inherited from class org.medcare.igtl.messages.OpenIGTMessage
getBody, getBytes, getDeviceName, getHeader, setBody, setHeader, Unpack
-
Constructor Details
-
NDArrayMessage
** 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
** Constructor to be used to create message from received data- Parameters:
header
-body
-- Throws:
Exception
-
NDArrayMessage
-
NDArrayMessage
-
-
Method Details
-
set1D_FloatData
public void set1D_FloatData(float[] data) -
set1D_FloatData
public void set1D_FloatData() -
get1DFloatData
public float[] get1DFloatData() -
unpackBody
** To create body from body array**
- Specified by:
unpackBody
in classOpenIGTMessage
- 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 classOpenIGTMessage
- Returns:
- the bytes array containing the message
-
toString
Description copied from class:OpenIGTMessage
** To get message String **- Specified by:
toString
in classOpenIGTMessage
- Returns:
- the message String
-