[Insight-users] ITK in Paraview Plugin

Luis Ibanez luis.ibanez at kitware.com
Wed Feb 24 15:09:33 EST 2010


Hi Christian,


  Did you build ITK as a Shared library ?


---

BTW: This  VERY interesting, you should
consider writing a paper for the Insight Journal   :-)

           http://www.insight-journal.org


     Regards,


           Luis


-------------------------------------------------------
On Wed, Feb 24, 2010 at 1:38 PM, Christian Werner
<christian.werner at rwth-aachen.de> wrote:
> Hello!
>
> I wrote a nice VTK filter that incorporates ITK filters. It works fine in a
> VTK-only environment. I was able to compile it as a ParaView plugin but when
> I want to use it, I get an error messages which seems to indicate some
> missing ITK library or something:
>
> Attempting to load /home/christian/.paraview-plugins/libSampleImageFilter.so
>>
>> Failed to load the shared library.
>> /home/christian/.paraview-plugins/libSampleImageFilter.so: undefined
>> symbol:
>> _ZN3itk11LightObject6DeleteEv
>
> I attached my CMakeList.txt. There's no
>
> TARGET_LINK_LIBRARIES(
>   ITKCommon ITKIO
>   vtkCommon vtkIO
> )
>
> or such in my CMakeList, but that does not seem to be a problem anyway.
> Everthing is compiled and linked just fine.
>
> Anyway, I tried
>
> TARGET_LINK_LIBRARIES(   vtkITKImageBox   #my library
>   ITKBasicFilters
> )
>
> or similar. But that turned into a cmake error:
>
> CMake Error at CMakeLists.txt:16 (TARGET_LINK_LIBRARIES):
>  Cannot specify link libraries for target "vtkITKImageBox" which is not
>  built by this project.
>
> whereas ommitting one of the above libraries, e.g. writing:
>
> TARGET_LINK_LIBRARIES(   vtkITKImageBox
> )
>
> works just fine. On the other hand it seems to be totally unnecessary to do
> anything like that, because always everything compiles just fine, as long as
> cmake ran succesful. When I compile for VTK-only it won't compile if I do
> not add my library that I actually need for this filter...
>
> What do I have do write into my CMakeList??
>
>
> Best regards,
> Christian
>
>
> # create a paraview plugin containing server manager xml and the server
> # manager classes to build
> # this plugin can be loaded on the server side
>
> cmake_minimum_required(VERSION 2.4)
>
> PROJECT(vtkITKSampleImageFilter)
>
> INCLUDE("/home/christian/programming/pv-plugins/conf.cmake")
>
> #find and load ParaView settings
> FIND_PACKAGE(ParaView REQUIRED)
> INCLUDE(${PARAVIEW_USE_FILE})
>
> # Find ITK & VTK
> FIND_PACKAGE(ITK REQUIRED)
> INCLUDE(${ITK_USE_FILE})
>
>
> ADD_PARAVIEW_PLUGIN(SampleImageFilter "1.0"
>  SERVER_MANAGER_XML SampleImageFilter.xml
>  #GUI_RESOURCE_FILES SampleImageFilterGUI.xml
>  SERVER_MANAGER_SOURCES vtkITKSampleImageFilter.cxx
> )
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>


More information about the Insight-users mailing list