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
9b6ef3ed
Commit
9b6ef3ed
authored
Jul 08, 2014
by
Cristina Precup
Browse files
ItkSegmentation is now used as a VolumeExplorer derivative
parent
de679f72
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/vis/pipelines/segmentationdemo.cpp
View file @
9b6ef3ed
...
...
@@ -41,17 +41,15 @@ namespace campvis {
:
AutoEvaluationPipeline
(
dc
)
,
_lsp
()
,
_imageReader
()
,
_ve
(
&
_canvasSize
)
,
_itkFilter
()
,
_itkSegmentation
()
,
_itkSegmentation
(
&
_canvasSize
)
{
addProcessor
(
&
_lsp
);
addProcessor
(
&
_imageReader
);
addProcessor
(
&
_ve
);
addProcessor
(
&
_itkFilter
);
addProcessor
(
&
_itkSegmentation
);
addEventListenerToBack
(
&
_
ve
);
addEventListenerToBack
(
&
_
itkSegmentation
);
}
SegmentationDemo
::~
SegmentationDemo
()
{
...
...
@@ -60,14 +58,13 @@ namespace campvis {
void
SegmentationDemo
::
init
()
{
AutoEvaluationPipeline
::
init
();
_
ve
.
p_outputImage
.
setValue
(
"result"
);
_
itkSegmentation
.
p_outputImage
.
setValue
(
"result"
);
_renderTargetID
.
setValue
(
"result"
);
//_imageReader.setURL(CAMPVIS_SOURCE_DIR "/modules/vis/sampledata/smallHeart.mhd");
//_imageReader.setURL(CAMPVIS_SOURCE_DIR "/../misc/mha_loader_CAMPVis_volumes/prostate_phantom_US/prostate_phantom_fcal_volume_uncompressed.mhd");
_imageReader
.
setURL
(
CAMPVIS_SOURCE_DIR
"/../misc/mha_loader_CAMPVis_volumes/prostate_phantom_US/prostate_phantom_fcal_volume_uncompressed.mha"
);
_imageReader
.
setTargetImageId
(
"reader.output"
);
_imageReader
.
setTargetImageIdSharedProperty
(
&
_
ve
.
p_inputVolume
);
_imageReader
.
setTargetImageIdSharedProperty
(
&
_
itkSegmentation
.
p_inputVolume
);
Geometry1DTransferFunction
*
dvrTF
=
new
Geometry1DTransferFunction
(
128
,
tgt
::
vec2
(
0.
f
,
.05
f
));
...
...
@@ -75,14 +72,13 @@ namespace campvis {
dvrTF
->
addGeometry
(
TFGeometry1D
::
createQuad
(
tgt
::
vec2
(
.12
f
,
.15
f
),
tgt
::
col4
(
85
,
0
,
0
,
128
),
tgt
::
col4
(
255
,
0
,
0
,
128
)));
dvrTF
->
addGeometry
(
TFGeometry1D
::
createQuad
(
tgt
::
vec2
(
.19
f
,
.28
f
),
tgt
::
col4
(
89
,
89
,
89
,
155
),
tgt
::
col4
(
89
,
89
,
89
,
155
)));
dvrTF
->
addGeometry
(
TFGeometry1D
::
createQuad
(
tgt
::
vec2
(
.41
f
,
.51
f
),
tgt
::
col4
(
170
,
170
,
128
,
64
),
tgt
::
col4
(
192
,
192
,
128
,
64
)));
static_cast
<
TransferFunctionProperty
*>
(
_ve
.
getNestedProperty
(
"VolumeRendererProperties::RaycasterProps::TransferFunction"
))
->
replaceTF
(
dvrTF
);
static_cast
<
FloatProperty
*>
(
_ve
.
getNestedProperty
(
"VolumeRendererProperties::RaycasterProps::SamplingRate"
))
->
setValue
(
4.
f
);
static_cast
<
TransferFunctionProperty
*>
(
_itkSegmentation
.
getNestedProperty
(
"VolumeRendererProperties::RaycasterProps::TransferFunction"
))
->
replaceTF
(
dvrTF
);
static_cast
<
FloatProperty
*>
(
_itkSegmentation
.
getNestedProperty
(
"VolumeRendererProperties::RaycasterProps::SamplingRate"
))
->
setValue
(
4.
f
);
}
void
SegmentationDemo
::
deinit
()
{
_canvasSize
.
s_changed
.
disconnect
(
this
);
AutoEvaluationPipeline
::
deinit
();
}
}
\ No newline at end of file
modules/vis/pipelines/segmentationdemo.h
View file @
9b6ef3ed
...
...
@@ -28,7 +28,6 @@
#include "core/pipeline/autoevaluationpipeline.h"
#include "modules/base/processors/lightsourceprovider.h"
#include "modules/io/processors/genericimagereader.h"
#include "modules/vis/processors/volumeexplorer.h"
#include "modules/itk/processors/itkimagefilter.h"
#include "modules/itk/processors/itksegmentation.h"
...
...
@@ -59,7 +58,6 @@ namespace campvis {
protected:
LightSourceProvider
_lsp
;
GenericImageReader
_imageReader
;
VolumeExplorer
_ve
;
ItkImageFilter
_itkFilter
;
ItkSegmentation
_itkSegmentation
;
};
...
...
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