I am trying to use Generic Scene to display a 2D image. I noticed that
there is a service ::visuVTKAdaptor::NegatoMPR already existing that
accepts single slice in 2D mode. So I defined it use this in my config
as:
<service uid="myImageGenericScene"
implementation="::fwRenderVTK::VtkRenderService"
type="::fwRender::IRender" autoComChannel="yes">
<scene>
<picker id="myPicker" vtkclass="fwVtkCellPicker" />
<renderer id="default" background="0.0" />
<adaptor uid="myImageRenderAdaptor" id="myImageRenderAdaptorSrv"
class="::visuVTKAdaptor::NegatoMPR" objectId="myImage">
<config renderer="default" picker="myPicker"
mode="2D" slices="1" />
</adaptor>
</scene>
</service>
My first question is, if this is the correct way of using it?
If yes, then I am getting an error on run-time, which may not be
related to this, but I have tried to backtrace with out much success.
I am getting the following error message
launcher_0-1_nux_64_gcc4-4-1_D: /home/anant/dev/BinPkgs/debug/
boost_1-38-0_nux_64_D/include/boost/shared_ptr.hpp:419: T*
boost::shared_ptr< <template-parameter-1-1> >::operator->() const
[with T = fwData::Integer]: Assertion `px != 0' failed.
I am also attaching the back trace of the code, any help will be
greatly appreciated. Thank you.
(gdb) bt
#0 0x00007ffff1e3a4b5 in raise () from /lib/libc.so.6
#1 0x00007ffff1e3df50 in abort () from /lib/libc.so.6
#2 0x00007ffff1e33481 in __assert_fail () from /lib/libc.so.6
#3 0x00007ffff0ceeaad in boost::shared_ptr<fwData::Integer>::operator-
> (this=0x7fffffffa1a0) at /home/anant/dev/BinPkgs/debug/
boost_1-38-0_nux_64_D/include/boost/shared_ptr.hpp:419
#4 0x00007fffddbff2ba in
visuVTKAdaptor::NegatoOneSlice::updateSliceIndex (this=0xa497d0,
image=...) at /home/anant/dev/Src/fw4spl/Bundles/LeafVisu/
visuVTKAdaptor/src/visuVTKAdaptor/NegatoOneSlice.cpp:308
#5 0x00007fffddbfe36f in visuVTKAdaptor::NegatoOneSlice::doUpdate
(this=0xa497d0) at /home/anant/dev/Src/fw4spl/Bundles/LeafVisu/
visuVTKAdaptor/src/visuVTKAdaptor/NegatoOneSlice.cpp:207
#6 0x00007fffddbfe24b in visuVTKAdaptor::NegatoOneSlice::doSwap
(this=0xa497d0) at /home/anant/dev/Src/fw4spl/Bundles/LeafVisu/
visuVTKAdaptor/src/visuVTKAdaptor/NegatoOneSlice.cpp:193
#7 0x00007fffdf0fa2f1 in fwRenderVTK::IVtkAdaptorService::swapping
(this=0xa497d0) at /home/anant/dev/Src/fw4spl/SrcLib/visu/fwRenderVTK/
src/fwRenderVTK/IVtkAdaptorService.cpp:86
#8 0x00007ffff067f1c8 in fwServices::IService::swap (this=0xa497d0,
_obj=...) at /home/anant/dev/Src/fw4spl/SrcLib/core/fwServices/src/
fwServices/IService.cpp:237
#9 0x00007fffddb75b10 in visuVTKAdaptor::NegatoMPR::doSwap
(this=0x89cda0) at /home/anant/dev/Src/fw4spl/Bundles/LeafVisu/
visuVTKAdaptor/src/visuVTKAdaptor/NegatoMPR.cpp:86
#10 0x00007fffdf0fa2f1 in fwRenderVTK::IVtkAdaptorService::swapping
(this=0x89cda0) at /home/anant/dev/Src/fw4spl/SrcLib/visu/fwRenderVTK/
src/fwRenderVTK/IVtkAdaptorService.cpp:86
#11 0x00007ffff067f1c8 in fwServices::IService::swap (this=0x89cda0,
_obj=...) at /home/anant/dev/Src/fw4spl/SrcLib/core/fwServices/src/
fwServices/IService.cpp:237
#12 0x00007fffdf11087f in
fwRenderVTK::VtkRenderService::configureObject (this=0x89ba50,
conf=...) at /home/anant/dev/Src/fw4spl/SrcLib/visu/fwRenderVTK/src/
fwRenderVTK/VtkRenderService.cpp:235
#13 0x00007fffdf11244d in fwRenderVTK::VtkRenderService::updating
(this=0x89ba50, message=...) at /home/anant/dev/Src/fw4spl/SrcLib/visu/
fwRenderVTK/src/fwRenderVTK/VtkRenderService.cpp:390
#14 0x00007ffff067de0f in fwServices::IService::update (this=0x89ba50,
_msg=...) at /home/anant/dev/Src/fw4spl/SrcLib/core/fwServices/src/
fwServices/IService.cpp:155
#15 0x00007ffff0675be4 in fwServices::ComChannelService::sendMessage
(this=0x89d2b0, _msg=..., options=fwServices::ComChannelService::NONE)
at /home/anant/dev/Src/fw4spl/SrcLib/core/fwServices/src/
fwServices/ComChannelService.cpp:262
#16 0x00007ffff064a8fa in fwServices::IEditionService::notify
(this=0x89af50, eventMessage=...,
options=fwServices::ComChannelService::NONE)
at /home/anant/dev/Src/fw4spl/SrcLib/core/fwServices/src/
fwServices/IEditionService.cpp:393
#17 0x00007ffff0651185 in fwServices::GlobalEventManager::dispatch
(this=0x15c5f90) at /home/anant/dev/Src/fw4spl/SrcLib/core/fwServices/
src/fwServices/GlobalEventManager.cpp:121
#18 0x00007ffff06513d1 in fwServices::GlobalEventManager::notify
(this=0x15c5f90, _pMsg=...,
_options=fwServices::ComChannelService::NONE)
at /home/anant/dev/Src/fw4spl/SrcLib/core/fwServices/src/
fwServices/GlobalEventManager.cpp:152
#19 0x00007ffff0648c28 in fwServices::IEditionService::notify
(_pSource=..., _pSubject=..., _pMsg=...,
options=fwServices::ComChannelService::NONE)
at /home/anant/dev/Src/fw4spl/SrcLib/core/fwServices/src/
fwServices/IEditionService.cpp:134
#20 0x00007fffd953ea27 in seqPlayback::PlaybackControl::onPlay
(this=0x722700, _event=...) at /home/anant/dev/Src/rd-tw/Bundles/
LeafUI/seqPlayback/src/seqPlayback/PlaybackControl.cpp:188
#21 0x00007fffd9547114 in
wxEventFunctorMethod<wxEventTypeTag<wxCommandEvent>,
seqPlayback::PlaybackControl, wxCommandEvent,
seqPlayback::PlaybackControl>::operator() (this=0xa81470,
handler=0xa68250,
event=...) at /home/anant/dev/BinPkgs/debug/wx_2-9_nux_64_D/
include/wx-2.9/wx/event.h:422
#22 0x00007fffec43b3d3 in wxAppConsoleBase::CallEventHandler
(this=0x72ea30, handler=0xa68250, functor=..., event=...) at /home/
thorgal/Dev/CommonLibExt_posix_gcc/src/wxWidgets/src/common/
appbase.cpp:511
#23 0x00007fffec558b11 in wxEvtHandler::ProcessEventIfMatchesId
(entry=..., handler=0xa68250, event=...) at /home/thorgal/Dev/
CommonLibExt_posix_gcc/src/wxWidgets/src/common/event.cpp:1248
#24 0x00007fffec559513 in wxEvtHandler::SearchDynamicEventTable
(this=0xa68250, event=...) at /home/thorgal/Dev/CommonLibExt_posix_gcc/
src/wxWidgets/src/common/event.cpp:1504
#25 0x00007fffec55b075 in wxEvtHandler::ProcessEventHere
(this=0xa68250, event=...) at /home/thorgal/Dev/CommonLibExt_posix_gcc/
src/wxWidgets/src/common/event.cpp:1349
#26 0x00007fffec55b176 in wxEvtHandler::ProcessEvent (this=0xa68250,
event=...) at /home/thorgal/Dev/CommonLibExt_posix_gcc/src/wxWidgets/
src/common/event.cpp:1324
#27 0x00007fffec55969b in wxEvtHandler::SafelyProcessEvent
(this=0xa68250, event=...) at /home/thorgal/Dev/CommonLibExt_posix_gcc/
src/wxWidgets/src/common/event.cpp:1366
#28 0x00007fffed27e0ab in wxWindowBase::HandleWindowEvent
(this=0xa68250, event=...) at /home/thorgal/Dev/CommonLibExt_posix_gcc/
src/wxWidgets/src/common/wincmn.cpp:1230
#29 0x00007fffed1410c2 in gtk_button_clicked_callback
(button=0xa68250) at /home/thorgal/Dev/CommonLibExt_posix_gcc/src/
wxWidgets/src/gtk/button.cpp:41
#30 0x00007fffe3d2a5ae in g_closure_invoke () from /usr/lib/
libgobject-2.0.so.0
#31 0x00007fffe3d3ff70 in ?? () from /usr/lib/libgobject-2.0.so.0
#32 0x00007fffe3d40d39 in g_signal_emit_valist () from /usr/lib/
libgobject-2.0.so.0
#33 0x00007fffe3d41283 in g_signal_emit () from /usr/lib/
libgobject-2.0.so.0
#34 0x00007fffe52b2af5 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#35 0x00007fffe3d2a5ae in g_closure_invoke () from /usr/lib/
libgobject-2.0.so.0
#36 0x00007fffe3d3f29c in ?? () from /usr/lib/libgobject-2.0.so.0
#37 0x00007fffe3d40d39 in g_signal_emit_valist () from /usr/lib/
libgobject-2.0.so.0
#38 0x00007fffe3d41283 in g_signal_emit () from /usr/lib/
libgobject-2.0.so.0
#39 0x00007fffe52b17ad in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#40 0x00007fffe5360728 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#41 0x00007fffe3d2a5ae in g_closure_invoke () from /usr/lib/
libgobject-2.0.so.0
#42 0x00007fffe3d3f64d in ?? () from /usr/lib/libgobject-2.0.so.0
---Type <return> to continue, or q <return> to quit---
#43 0x00007fffe3d40bcc in g_signal_emit_valist () from /usr/lib/
libgobject-2.0.so.0
#44 0x00007fffe3d41283 in g_signal_emit () from /usr/lib/
libgobject-2.0.so.0
#45 0x00007fffe546771f in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#46 0x00007fffe5358cd3 in gtk_propagate_event () from /usr/lib/libgtk-
x11-2.0.so.0
#47 0x00007fffe5359ca3 in gtk_main_do_event () from /usr/lib/libgtk-
x11-2.0.so.0
#48 0x00007fffe4fcecec in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#49 0x00007fffe3688bce in g_main_context_dispatch () from /lib/
libglib-2.0.so.0
#50 0x00007fffe368c598 in ?? () from /lib/libglib-2.0.so.0
#51 0x00007fffe368c9f5 in g_main_loop_run () from /lib/libglib-2.0.so.
0
#52 0x00007fffe535a177 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.
0
#53 0x00007fffed0e0b14 in wxGUIEventLoop::Run (this=0x7da800) at /home/
thorgal/Dev/CommonLibExt_posix_gcc/src/wxWidgets/src/gtk/evtloop.cpp:
58
#54 0x00007fffec43bc79 in wxAppConsoleBase::MainLoop (this=0x72ea30)
at /home/thorgal/Dev/CommonLibExt_posix_gcc/src/wxWidgets/src/common/
appbase.cpp:288
#55 0x00007fffec43b0da in wxAppConsoleBase::OnRun (this=0x72ea30) at /
home/thorgal/Dev/CommonLibExt_posix_gcc/src/wxWidgets/src/common/
appbase.cpp:229
#56 0x00007fffed18f0e6 in wxAppBase::OnRun (this=0x72ea30) at /home/
thorgal/Dev/CommonLibExt_posix_gcc/src/wxWidgets/src/common/appcmn.cpp:
287
#57 0x00007fffec4b5edf in wxEntry (argc=@0x7fffeca485d0,
argv=0x72c6f0) at /home/thorgal/Dev/CommonLibExt_posix_gcc/src/
wxWidgets/src/common/init.cpp:459
#58 0x00007fffec4b6283 in wxEntry (argc=@0x7fffffffdb30,
argv=0x72c690) at /home/thorgal/Dev/CommonLibExt_posix_gcc/src/
wxWidgets/src/common/init.cpp:471
#59 0x00007fffdd7a64a5 in gui::Plugin::start (this=0x72c060) at /home/
anant/dev/Src/fw4spl/Bundles/core/gui/src/gui/Plugin.cpp:63
#60 0x00007ffff796b0f2 in fwRuntime::Bundle::startPlugin
(this=0x66ae60) at /home/anant/dev/Src/fw4spl/SrcLib/core/fwRuntime/
src/Bundle.cpp:469
#61 0x00007ffff796acff in fwRuntime::Bundle::start (this=0x66ae60) at /
home/anant/dev/Src/fw4spl/SrcLib/core/fwRuntime/src/Bundle.cpp:426
#62 0x00007ffff7995da3 in fwRuntime::profile::Starter::apply
(this=0x622880) at /home/anant/dev/Src/fw4spl/SrcLib/core/fwRuntime/
src/profile/Starter.cpp:42
#63 0x00007ffff7990872 in operator() (this=0x7fffffffdf10, e=...) at /
home/anant/dev/Src/fw4spl/SrcLib/core/fwRuntime/src/profile/
Profile.cpp:33
#64 0x00007ffff799072f in
for_each<__gnu_cxx::__normal_iterator<boost::shared_ptr<fwRuntime::profile::Starter>*,
std::vector<boost::shared_ptr<fwRuntime::profile::Starter>,
std::allocator<boost::shared_ptr<fwRuntime::profile::Starter> > > >,
fwRuntime::profile::<unnamed>::Apply<boost::shared_ptr<fwRuntime::profile::Starter>
> > (__first=..., __last=..., __f=...) at /usr/include/c++/4.4/bits/
stl_algo.h:4200
#65 0x00007ffff79903b9 in fwRuntime::profile::Profile::start
(this=0x679f20) at /home/anant/dev/Src/fw4spl/SrcLib/core/fwRuntime/
src/profile/Profile.cpp:79
#66 0x0000000000408d4f in main (argc=2, argv=0x7fffffffe298) at /home/
anant/dev/Src/fw4spl/launcher/src/ProfileRunner.cpp:134
On Mar 1, 9:26 pm, Julien Waechter <julien.waech...@gmail.com> wrote:
> Hello,
> NegatoMPR adaptor needs a medical image.
> You have an assert because the
> fields ::fwComEd::Dictionary::m_axialSliceIndexId, m_frontalSliceIndexId
> and m_sagittalSliceIndexId are missing in your fwData::Image (needed in
> NegatoOneSlice::updateSliceIndex() ).
>
> To automatically convert a simple Image in medical image, you have a
> service ::ctrlSelection::MedicalImageSrv
> I've updated the tuto "Tuto08GenericScene" with this new service (it's a
> good example for your application).
>
> Cheers,
> Julien
>
> 2010/3/1 Anant Vemuri <anantvem...@gmail.com>
> > #56 0x00007fffed18f0e6 in wxAppBase::OnRun (this=0x72ea30) at /home/...
>
> read more »
> > > #53 0x00007fffed0e0b14 in wxGUIEventLoop::Run...
>
> read more »
In my previous post I mentioned using ::visuVTKAdaptor::NegatoMPR for
displaying images. With the modification Julien proposed, I have the
thing working. There is just one problem. I am displaying a sequence
of images, and it does not, show the image on the screen unless I
click or refresh the window by pressing 'r'. Else it reaches the last
image and renders. Is there a way I can force a refresh at every step.
Thank you for the help.
Best regards,
Anant.