如何使用itkvtkglue将ITK与VTK一起使用? [英] How to use itkvtkglue to use ITK with VTK?

查看:429
本文介绍了如何使用itkvtkglue将ITK与VTK一起使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个示例,该示例将Wiki示例中的ITK与VTK结合在一起,称为IO / ImageFileReader。

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

我下载了itkvtkglue,解压缩到一个文件夹,并配置了cmake和

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

,但是当我尝试配置给定的示例时,我无法使用它。即使cmake自己找到了ItkVtkGlue_DIR,它也会出现一个错误,即他无法包含必要的文件。无法包含($ {ItkVtkGlue_USE_FILE})

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

我应该以某种方式更改CMake查找ItkVtkGlue头文件的文件夹吗?还有其他使用ITK&的方法吗? VTK在一起吗?

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看起来像这样:

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

谢谢大家的帮助。

推荐答案

几乎可以肯定这是很常见的问题之一:

This is almost certainly one of the very common problems:

如果工具的路径中包含[space]字符,则必须通过将文件路径括在引号中来防止文件路径被分开。

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

这篇关于如何使用itkvtkglue将ITK与VTK一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆