简体   繁体   English

如何使用itkvtkglue将ITK与VTK一起使用?

[英]How to use itkvtkglue to use ITK with VTK?

I wanted to make the example which combines ITK with VTK called IO/ImageFileReader from wiki examples. 我想制作一个将ITK与VTK相结合的示例,该示例来自Wiki示例,称为IO / ImageFileReader。

I downloaded itkvtkglue, extracted to a folder, configured with cmake and built with visual studio 2010. 我下载了itkvtkglue,解压缩到一个文件夹,使用cmake配置并使用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. 即使cmake自己找到了ItkVtkGlue_DIR,它仍然给出一个错误,即他无法包含必要的文件。 Fails to include(${ItkVtkGlue_USE_FILE}) 未能包含($ {ItkVtkGlue_USE_FILE})

Should I somehow change the folders CMake looks for my ItkVtkGlue header files? 我应该以某种方式更改CMake查找ItkVtkGlue头文件的文件夹吗? Is there other way to use ITK & VTK together? 还有其他方法可以同时使用ITK和VTK吗?

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: 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}) 

Thank you all for your help. 谢谢大家的帮助。

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 "". 如果工具的路径中包含[space]字符,则必须通过将文件路径括在引号中以防止文件路径被分开。

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 http://www.vtk.org/Wiki/ITK/Examples#ItkVtkGlue

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM