Package org.medcare.igtl.messages
Class PositionMessage
java.lang.Object
org.medcare.igtl.messages.OpenIGTMessage
org.medcare.igtl.messages.PositionMessage
** This class create an Position object from bytes received or help to generate
bytes to send from it
-
Field Summary
Modifier and TypeFieldDescriptionstatic int
static int
static int
static int
static double[]
static int
static int
Fields inherited from class org.medcare.igtl.messages.OpenIGTMessage
bytesArray, deviceName, VERSION
-
Constructor Summary
ConstructorDescriptionPositionMessage
(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 **PositionMessage
(Header header, byte[] body) ** Constructor to be used to create message from received data -
Method Summary
Modifier and TypeMethodDescriptiondouble[]
** To get Image position **byte[]
** To get position_data byte array **** To get Image quaternion **byte[]
packBody()
** To create body from image_header and image_data SetPositionData must have called firstvoid
setPosition
(double[] position) ** To set Image positionvoid
setPosition
(double x, double y, double z) ** To set Image positionvoid
setPositionData
(byte[] position_data) ** To extract image characteristics from position_data byte arraybyte[]
setPositionData
(double[] position, Quaternion quaternion, int quaternionSize) ** To create position_data from image characteristics and to get the byte array to sendtoString()
** To get position String **boolean
** To create body from body arrayMethods inherited from class org.medcare.igtl.messages.OpenIGTMessage
getBody, getBytes, getDeviceName, getHeader, setBody, setHeader, Unpack
-
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
-
-
Constructor Details
-
PositionMessage
** 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 Nameds
-
-
PositionMessage
** Constructor to be used to create message from received data- Parameters:
header
-body
-- Throws:
Exception
-
-
Method Details
-
unpackBody
** To create body from body array**
- Specified by:
unpackBody
in classOpenIGTMessage
- 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 classOpenIGTMessage
- Returns:
- the bytes array containing the message
-
setPositionData
** 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
** 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
** To get Image quaternion **- Returns:
- the quaternion array
-
toString
** To get position String **- Specified by:
toString
in classOpenIGTMessage
- Returns:
- the position String
-