Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CAMP
campvis-public
Commits
38db04f8
Commit
38db04f8
authored
Oct 23, 2014
by
Christian Schulte zu Berge
Browse files
Updated OpenIGTLink module.
refs #386
parent
9ccba1cb
Changes
5
Show whitespace changes
Inline
Side-by-side
core/datastructures/abstractdata.h
View file @
38db04f8
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
#include <memory>
#include <memory>
#include <tbb/atomic.h>
#include <tbb/atomic.h>
#include "
t
gt/bounds.h"
#include "
c
gt/bounds.h"
#include "core/coreapi.h"
#include "core/coreapi.h"
#include "core/datastructures/scopedtypeddata.h" // not directly needed here but by many classes including AbstractData
#include "core/datastructures/scopedtypeddata.h" // not directly needed here but by many classes including AbstractData
...
@@ -48,7 +48,7 @@ namespace campvis {
...
@@ -48,7 +48,7 @@ namespace campvis {
* Returns the data extent in world coordinates.
* Returns the data extent in world coordinates.
* \return The data extent in world coordinates.
* \return The data extent in world coordinates.
*/
*/
virtual
t
gt
::
Bounds
getWorldBounds
()
const
=
0
;
virtual
c
gt
::
Bounds
getWorldBounds
()
const
=
0
;
};
};
// ================================================================================================
// ================================================================================================
...
...
modules/openigtlink/pipelines/streamingoigtldemo.cpp
View file @
38db04f8
modules/openigtlink/pipelines/streamingoigtldemo.h
View file @
38db04f8
modules/openigtlink/processors/openigtlinkclient.cpp
View file @
38db04f8
...
@@ -48,8 +48,8 @@ namespace campvis {
...
@@ -48,8 +48,8 @@ namespace campvis {
,
p_targetImagePrefix
(
"targetImageName"
,
"Target Image Prefix"
,
"IGTL.image."
)
,
p_targetImagePrefix
(
"targetImageName"
,
"Target Image Prefix"
,
"IGTL.image."
)
,
p_receiveTransforms
(
"ReceiveTransforms"
,
"Receive TRANSFORM Messages"
,
true
)
,
p_receiveTransforms
(
"ReceiveTransforms"
,
"Receive TRANSFORM Messages"
,
true
)
,
p_targetTransformPrefix
(
"targetTransformPrefix"
,
"Target Transform Prefix"
,
"IGTL.transform."
)
,
p_targetTransformPrefix
(
"targetTransformPrefix"
,
"Target Transform Prefix"
,
"IGTL.transform."
)
,
p_imageOffset
(
"ImageOffset"
,
"Image Offset in mm"
,
t
gt
::
vec3
(
0.
f
),
t
gt
::
vec3
(
-
10000.
f
),
t
gt
::
vec3
(
10000.
f
),
t
gt
::
vec3
(
0.1
f
))
,
p_imageOffset
(
"ImageOffset"
,
"Image Offset in mm"
,
c
gt
::
vec3
(
0.
f
),
c
gt
::
vec3
(
-
10000.
f
),
c
gt
::
vec3
(
10000.
f
),
c
gt
::
vec3
(
0.1
f
))
,
p_voxelSize
(
"VoxelSize"
,
"Voxel Size in mm"
,
t
gt
::
vec3
(
1.
f
),
t
gt
::
vec3
(
-
100.
f
),
t
gt
::
vec3
(
100.
f
),
t
gt
::
vec3
(
0.1
f
))
,
p_voxelSize
(
"VoxelSize"
,
"Voxel Size in mm"
,
c
gt
::
vec3
(
1.
f
),
c
gt
::
vec3
(
-
100.
f
),
c
gt
::
vec3
(
100.
f
),
c
gt
::
vec3
(
0.1
f
))
,
p_receivePositions
(
"ReceivePositions"
,
"Receive POSITION Messages"
,
true
)
,
p_receivePositions
(
"ReceivePositions"
,
"Receive POSITION Messages"
,
true
)
,
p_targetPositionPrefix
(
"targetPositionsPrefix"
,
"Target Position Prefix"
,
"IGTL.position."
)
,
p_targetPositionPrefix
(
"targetPositionsPrefix"
,
"Target Position Prefix"
,
"IGTL.position."
)
,
_stopExecution
()
,
_stopExecution
()
...
@@ -151,13 +151,13 @@ namespace campvis {
...
@@ -151,13 +151,13 @@ namespace campvis {
return
;
return
;
}
}
t
gt
::
vec3
imageOffset
(
0.
f
);
c
gt
::
vec3
imageOffset
(
0.
f
);
t
gt
::
vec3
voxelSize
(
1.
f
);
c
gt
::
vec3
voxelSize
(
1.
f
);
t
gt
::
ivec3
size_i
(
1
);
c
gt
::
ivec3
size_i
(
1
);
imageMessage
->
GetSpacing
(
voxelSize
.
elem
);
imageMessage
->
GetSpacing
(
voxelSize
.
elem
);
imageMessage
->
GetDimensions
(
size_i
.
elem
);
imageMessage
->
GetDimensions
(
size_i
.
elem
);
t
gt
::
svec3
size
(
size_i
);
c
gt
::
svec3
size
(
size_i
);
imageMessage
->
GetOrigin
(
imageOffset
.
elem
);
imageMessage
->
GetOrigin
(
imageOffset
.
elem
);
size_t
dimensionality
=
(
size_i
[
2
]
==
1
)
?
((
size_i
[
1
]
==
1
)
?
1
:
2
)
:
3
;
size_t
dimensionality
=
(
size_i
[
2
]
==
1
)
?
((
size_i
[
1
]
==
1
)
?
1
:
2
)
:
3
;
...
@@ -246,7 +246,7 @@ namespace campvis {
...
@@ -246,7 +246,7 @@ namespace campvis {
if
(
c
&
igtl
::
MessageHeader
::
UNPACK_BODY
)
// if CRC check is OK
if
(
c
&
igtl
::
MessageHeader
::
UNPACK_BODY
)
// if CRC check is OK
{
{
t
gt
::
mat4
mtx
;
c
gt
::
mat4
mtx
;
// Retrieve the transform data (this cast is a bit dubious but should be ok judging from the respective class internals)
// Retrieve the transform data (this cast is a bit dubious but should be ok judging from the respective class internals)
transMsg
->
GetMatrix
(
*
reinterpret_cast
<
igtl
::
Matrix4x4
*>
(
mtx
.
elem
));
transMsg
->
GetMatrix
(
*
reinterpret_cast
<
igtl
::
Matrix4x4
*>
(
mtx
.
elem
));
#ifdef IGTL_CLIENT_DEBUGGING
#ifdef IGTL_CLIENT_DEBUGGING
...
@@ -346,7 +346,7 @@ namespace campvis {
...
@@ -346,7 +346,7 @@ namespace campvis {
imgMsg
->
GetSpacing
(
spacing
);
imgMsg
->
GetSpacing
(
spacing
);
imgMsg
->
GetSubVolume
(
svsize
,
svoffset
);
imgMsg
->
GetSubVolume
(
svsize
,
svoffset
);
t
gt
::
mat4
mtx
;
c
gt
::
mat4
mtx
;
// Retrieve the transform data (this cast is a bit dubious but should be ok judging from the class internals)
// Retrieve the transform data (this cast is a bit dubious but should be ok judging from the class internals)
imgMsg
->
GetMatrix
(
*
reinterpret_cast
<
igtl
::
Matrix4x4
*>
(
mtx
.
elem
));
imgMsg
->
GetMatrix
(
*
reinterpret_cast
<
igtl
::
Matrix4x4
*>
(
mtx
.
elem
));
...
...
modules/openigtlink/processors/openigtlinkclient.h
View file @
38db04f8
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
#include <igtlMessageHeader.h>
#include <igtlMessageHeader.h>
#include <igtlImageMessage.h>
#include <igtlImageMessage.h>
#include <
t
gt/matrix.h>
#include <
c
gt/matrix.h>
#include <ext/threading.h>
#include <ext/threading.h>
#include <tbb/atomic.h>
#include <tbb/atomic.h>
...
@@ -118,8 +118,8 @@ namespace campvis {
...
@@ -118,8 +118,8 @@ namespace campvis {
protected:
protected:
/// Stores received data from a POSITION Message
/// Stores received data from a POSITION Message
struct
PositionMessageData
{
struct
PositionMessageData
{
t
gt
::
vec3
_position
;
c
gt
::
vec3
_position
;
t
gt
::
vec4
_quaternion
;
c
gt
::
vec4
_quaternion
;
};
};
/// Main method for the receiver thread. The new thread will
/// Main method for the receiver thread. The new thread will
...
@@ -139,7 +139,7 @@ namespace campvis {
...
@@ -139,7 +139,7 @@ namespace campvis {
igtl
::
ClientSocket
::
Pointer
_socket
;
igtl
::
ClientSocket
::
Pointer
_socket
;
//data
//data
std
::
map
<
std
::
string
,
t
gt
::
mat4
>
_receivedTransforms
;
///< the transforms that has been received by the igtl worker thread, mapped by device name
std
::
map
<
std
::
string
,
c
gt
::
mat4
>
_receivedTransforms
;
///< the transforms that has been received by the igtl worker thread, mapped by device name
std
::
map
<
std
::
string
,
igtl
::
ImageMessage
::
Pointer
>
_receivedImages
;
///< the image messages received by the igtl worker thread, mapped by device name
std
::
map
<
std
::
string
,
igtl
::
ImageMessage
::
Pointer
>
_receivedImages
;
///< the image messages received by the igtl worker thread, mapped by device name
std
::
map
<
std
::
string
,
PositionMessageData
>
_receivedPositions
;
///< position message data received by the igtl worker thread, mapped by device name
std
::
map
<
std
::
string
,
PositionMessageData
>
_receivedPositions
;
///< position message data received by the igtl worker thread, mapped by device name
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment