Package org.medcare.igtl.messages
Class TransformMessage
java.lang.Object
org.medcare.igtl.messages.OpenIGTMessage
org.medcare.igtl.messages.TransformMessage
** This class create an Transform 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
ConstructorDescriptionTransformMessage
(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 **TransformMessage
(String deviceName, double[] positionAray, double[][] rotationMatrix) TransformMessage
(Header header, byte[] body) ** Constructor to be used to create message from received data -
Method Summary
Modifier and TypeMethodDescriptiondouble[][]
** To get Image matrix **double[]
** To get Image origin **double[][]
** To get Image normals **byte[]
** To get transform_data byte array **byte[]
packBody()
** To create body from image_header and image_data SetTransformData must have called firstvoid
printDoubleDataArray
(double[][] matrixArray) void
setMatrix
(double[][] matrix) ** To set Image matrixvoid
setMatrix
(double[] origin, double[][] normals) ** To set Image matrixvoid
setMatrix
(double[] origin, double[] t, double[] s, double[] n) ** To set Image matrixvoid
setPosition
(double[] o) ** To set Image originvoid
setPosition
(double a, double b, double c) ** To set Image originvoid
setTransformData
(byte[] transform_data) ** To extract image characteristics from transform_data byte arraybyte[]
setTransformData
(double[] origin, double[][] normals) ** To create transform_data from image characteristics and to get the byte array to sendtoString()
** To get transform 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_TRANSFORM_SIZE
public static int IGTL_TRANSFORM_SIZE
-
-
Constructor Details
-
TransformMessage
** 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
** Constructor to be used to create message from received data- Parameters:
header
-body
-- Throws:
Exception
-
TransformMessage
-
-
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 SetTransformData must have called first**
- Specified by:
packBody
in classOpenIGTMessage
- 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
- arrayt
- arrays
- arrayn
- array **
-
setMatrix
public void setMatrix(double[] origin, double[][] normals) ** To set Image matrix- Parameters:
origin
- arraynormals
- 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
** To get transform String **- Specified by:
toString
in classOpenIGTMessage
- Returns:
- the transform String
-
printDoubleDataArray
public void printDoubleDataArray(double[][] matrixArray)
-