将ITK(Insight Toolkit)集成到自己的项目中
我在将 ITK - Insight Toolkit 集成到另一个图像处理管道中时遇到问题。 ITK本身是一个医学图像处理工具包,使用cmake作为构建系统。 我的图像管道项目也使用 cmake。 根据 ITK 的用户手册,最好使用 ITK 的构建(源代码外)目录中的“UseITK.cmake”文件。 您可以通过将以下几行添加到您自己项目的 CMakeList.txt 中来完成此操作。
# 'SET(ITK_DIR ...)' if 'FIND_PACKAGE(ITK REQUIRED)' fails
FIND_PACKAGE(ITK REQUIRED)
INCLUDE(${ITK_USE_FILE})
我的问题是,这种方法指向 ITK 的当前安装,但我必须将 itk 完全集成到我的项目中,而不依赖于我的项目之外。 itk 的 cmake 构建系统中是否有一个构建选项,它将所有头文件和 lib 文件转储/传递到构建目录中,以便我可以将它们自己放入我的项目中。 我有一个库和标头包含结构,我不想破坏。 我已经尝试手动将库和头文件复制到我的项目中,但没有成功。
我是 itk 和 cmake 的新手,所以这个问题可能听起来很模糊。 我希望你们无论如何都能帮助我。
提前致谢!
最好的问候,
正通
i am having problems integrating ITK - Insight Toolkit into another image processing pipeline. ITK itself is a medical image processing toolkit and uses cmake as build system. My image pipeline project uses cmake as well. According to the user manual of ITK it is favorable to use the "UseITK.cmake" file in the build (out of source) directory of ITK. You can do that by adding the following lines the CMakeList.txt of your own project.
# 'SET(ITK_DIR ...)' if 'FIND_PACKAGE(ITK REQUIRED)' fails
FIND_PACKAGE(ITK REQUIRED)
INCLUDE(${ITK_USE_FILE})
My problem is, this approach points to the current installtion of ITK, but i have to integrate itk completly into my project, without dependencies outside my project.
Is there a build option in the cmake build system of itk, which dumps/delivers all the header and lib files into a build directory, so i can place them into my project on my own.
I have a lib and header include structure i do not want to break. I already tried to to manually copy the lib and header files into my project but it didn't work out.
I am new to itk and cmake so this question might sound vague. I hope you guys can help me anyway.
Thanks in advance!
Best regards,
zhengtonic
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不知道你是否仍然遇到这个问题,但这里有一个简单的方法:
构建 ITK 项目,然后“make install”(或在 VS 中构建 INSTALL.vcproj 项目),它将写入一个目录您在配置项目时作为 CMAKE_INSTALL_PREFIX 传递。 该目录将包含/bin、/lib 和/include。 您可以将它们直接导入到您的项目中。
I don't know if you're still having the problem, but here's an easy way:
Build the ITK project, and then "make install" (or build the INSTALL.vcproj project in VS), and it will write to a directory you pass as CMAKE_INSTALL_PREFIX while configuring your project. This directory will contain /bin, /lib and /include. You can import those into your project directly.
使用 CMAKE_INSTALL_PREFIX 指向您的基目录是最好的解决方案。
当您发出“make install”时,所有标头/配置文件/库都将被复制。
Using CMAKE_INSTALL_PREFIX to point to you base directory is the best solution.
When you issue "make install" all the headers/configurationfiles/libraries will be copied over.
C:/Program Files (x86)/ITK 是 ITK 的 CMAKE_INSTALL_PREFIX 值并自动设置。
C:/Program Files (x86)/ITK is value of CMAKE_INSTALL_PREFIX for ITK and set automatically.