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
Hide whitespace changes
Inline
Side-by-side
core/datastructures/abstractdata.h
View file @
38db04f8
...
...
@@ -27,7 +27,7 @@
#include <memory>
#include <tbb/atomic.h>
#include "
t
gt/bounds.h"
#include "
c
gt/bounds.h"
#include "core/coreapi.h"
#include "core/datastructures/scopedtypeddata.h" // not directly needed here but by many classes including AbstractData
...
...
@@ -48,7 +48,7 @@ namespace campvis {
* Returns 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
...
...
@@ -32,7 +32,7 @@ namespace campvis {
:
AutoEvaluationPipeline
(
dc
)
{
addProcessor
(
&
_igtlClient
);
addProcessor
(
&
_matrixProcessor
);
addProcessor
(
&
_matrixProcessor
);
//addEventListenerToBack(&_ve);
}
...
...
@@ -44,12 +44,12 @@ namespace campvis {
AutoEvaluationPipeline
::
init
();
_igtlClient
.
s_validated
.
connect
(
this
,
&
StreamingOIGTLDemo
::
onProcessorValidated
);
_matrixProcessor
.
s_validated
.
connect
(
this
,
&
StreamingOIGTLDemo
::
onProcessorValidated
);
_matrixProcessor
.
s_validated
.
connect
(
this
,
&
StreamingOIGTLDemo
::
onProcessorValidated
);
_renderTargetID
.
setValue
(
"IGTL.image.ImagerClient"
);
_matrixProcessor
.
p_matrixAID
.
setValue
(
"IGTL.transform.ProbeToTracker"
);
_matrixProcessor
.
p_matrixAID
.
setValue
(
"IGTL.transform.ProbeToTracker"
);
_matrixProcessor
.
p_matrixAType
.
selectByOption
(
"data"
);
_matrixProcessor
.
p_matrixBID
.
setValue
(
"IGTL.transform.ReferenceToTracker"
);
_matrixProcessor
.
p_matrixBID
.
setValue
(
"IGTL.transform.ReferenceToTracker"
);
_matrixProcessor
.
p_matrixBType
.
selectByOption
(
"data"
);
_igtlClient
.
p_address
.
setValue
(
"127.0.0.1"
);
...
...
modules/openigtlink/pipelines/streamingoigtldemo.h
View file @
38db04f8
...
...
@@ -64,7 +64,7 @@ namespace campvis {
virtual
void
onProcessorValidated
(
AbstractProcessor
*
processor
);
OpenIGTLinkClient
_igtlClient
;
MatrixProcessor
_matrixProcessor
;
MatrixProcessor
_matrixProcessor
;
};
}
...
...
modules/openigtlink/processors/openigtlinkclient.cpp
View file @
38db04f8
...
...
@@ -48,8 +48,8 @@ namespace campvis {
,
p_targetImagePrefix
(
"targetImageName"
,
"Target Image Prefix"
,
"IGTL.image."
)
,
p_receiveTransforms
(
"ReceiveTransforms"
,
"Receive TRANSFORM Messages"
,
true
)
,
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_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_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"
,
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_targetPositionPrefix
(
"targetPositionsPrefix"
,
"Target Position Prefix"
,
"IGTL.position."
)
,
_stopExecution
()
...
...
@@ -75,7 +75,7 @@ namespace campvis {
addProperty
(
p_receivePositions
,
INVALID_PROPERTIES
);
addProperty
(
p_targetPositionPrefix
,
VALID
);
invalidate
(
INVALID_PROPERTIES
);
invalidate
(
INVALID_PROPERTIES
);
}
...
...
@@ -151,13 +151,13 @@ namespace campvis {
return
;
}
t
gt
::
vec3
imageOffset
(
0.
f
);
t
gt
::
vec3
voxelSize
(
1.
f
);
t
gt
::
ivec3
size_i
(
1
);
c
gt
::
vec3
imageOffset
(
0.
f
);
c
gt
::
vec3
voxelSize
(
1.
f
);
c
gt
::
ivec3
size_i
(
1
);
imageMessage
->
GetSpacing
(
voxelSize
.
elem
);
imageMessage
->
GetDimensions
(
size_i
.
elem
);
t
gt
::
svec3
size
(
size_i
);
c
gt
::
svec3
size
(
size_i
);
imageMessage
->
GetOrigin
(
imageOffset
.
elem
);
size_t
dimensionality
=
(
size_i
[
2
]
==
1
)
?
((
size_i
[
1
]
==
1
)
?
1
:
2
)
:
3
;
...
...
@@ -192,7 +192,7 @@ namespace campvis {
p_imageOffset
.
setVisible
(
p_receiveImages
.
getValue
());
p_voxelSize
.
setVisible
(
p_receiveImages
.
getValue
());
p_targetTransformPrefix
.
setVisible
(
p_receiveImages
.
getValue
()
||
p_receiveTransforms
.
getValue
());
p_targetPositionPrefix
.
setVisible
(
p_receivePositions
.
getValue
());
p_targetPositionPrefix
.
setVisible
(
p_receivePositions
.
getValue
());
validate
(
INVALID_PROPERTIES
);
}
...
...
@@ -246,7 +246,7 @@ namespace campvis {
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)
transMsg
->
GetMatrix
(
*
reinterpret_cast
<
igtl
::
Matrix4x4
*>
(
mtx
.
elem
));
#ifdef IGTL_CLIENT_DEBUGGING
...
...
@@ -346,7 +346,7 @@ namespace campvis {
imgMsg
->
GetSpacing
(
spacing
);
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)
imgMsg
->
GetMatrix
(
*
reinterpret_cast
<
igtl
::
Matrix4x4
*>
(
mtx
.
elem
));
...
...
modules/openigtlink/processors/openigtlinkclient.h
View file @
38db04f8
...
...
@@ -35,7 +35,7 @@
#include <igtlMessageHeader.h>
#include <igtlImageMessage.h>
#include <
t
gt/matrix.h>
#include <
c
gt/matrix.h>
#include <ext/threading.h>
#include <tbb/atomic.h>
...
...
@@ -118,8 +118,8 @@ namespace campvis {
protected:
/// Stores received data from a POSITION Message
struct
PositionMessageData
{
t
gt
::
vec3
_position
;
t
gt
::
vec4
_quaternion
;
c
gt
::
vec3
_position
;
c
gt
::
vec4
_quaternion
;
};
/// Main method for the receiver thread. The new thread will
...
...
@@ -139,7 +139,7 @@ namespace campvis {
igtl
::
ClientSocket
::
Pointer
_socket
;
//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
,
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