如何使用itkvtkglue将ITK与VTK结合使用?
我想制作一个将 ITK 与 VTK 结合起来的示例,称为 wiki 示例中的 IO/ImageFileReader。
我下载了 itkvtkglue,提取到一个文件夹,使用 cmake 配置并使用 Visual Studio 2010 构建。
但是当我尝试配置给定的示例时,我无法使用它。即使cmake自己找到ItkVtkGlue_DIR,它也会给出错误,指出他无法包含必要的文件。无法包含(${ItkVtkGlue_USE_FILE})
我是否应该以某种方式更改 CMake 查找 ItkVtkGlue 头文件的文件夹?还有其他方法可以使用ITK & VTK一起?
下面给出了错误和文件内容。
CMake Error at CMakeLists.txt:6 (include):
include could not find load file:
C:/Users/Emre
CMakeLists.txt 看起来像这样:
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})
谢谢大家的帮助。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这几乎肯定是非常常见的问题之一:
如果工具的路径中包含[空格]字符,那么您必须通过将文件路径封装在引号“”中来防止文件路径被分割。
为了安全起见,您应该始终将文件路径放在引号中,以防您未来的合作者之一尝试在包含空格的路径上进行构建。
您可能还想查看:
http://www.vtk.org/Wiki/ITK/示例#ItkVtkGlue
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