How to use itkvtkglue to use ITK with VTK?

两盒软妹~` 提交于 2019-12-24 12:23:12

问题


I wanted to make the example which combines ITK with VTK called IO/ImageFileReader from wiki examples.

I downloaded itkvtkglue, extracted to a folder, configured with cmake and built with visual studio 2010.

but i can't use it when i try to configure the example given. Even though cmake finds the ItkVtkGlue_DIR by itself, it gives the error that he couldn't include the necessary files. Fails to include(${ItkVtkGlue_USE_FILE})

Should I somehow change the folders CMake looks for my ItkVtkGlue header files? Is there other way to use ITK & VTK together?

the error and file content are given below.

CMake Error at CMakeLists.txt:6 (include):
  include could not find load file:

    C:/Users/Emre

CMakeLists.txt looks like this:

cmake_minimum_required(VERSION 2.6)

project(ImageFileReader)

find_package(ItkVtkGlue REQUIRED)
include(${ItkVtkGlue_USE_FILE})

add_executable(ImageFileReader ImageFileReader.cxx)
target_link_libraries(ImageFileReader
  ItkVtkGlue  ${VTK_LIBRARIES} ${ITK_LIBRARIES}) 

Thank you all for your help.


回答1:


This is almost certainly one of the very common problems:

If the path to your tools contains a [space] character in it, then you must protect the file path from being split apart by encapsulating it in quotations "".

To be safe, you should always place file paths in quotations just incase one of your future collaborators tries to build on a path that has spaces in it.

You may also want to review:

http://www.vtk.org/Wiki/ITK/Examples#ItkVtkGlue



来源:https://stackoverflow.com/questions/6894600/how-to-use-itkvtkglue-to-use-itk-with-vtk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!