MITK是业界开源的医学图像处理平台,具有很高的参考价值,编译过程相关问题简要整理如下。
(一)基础环境:
Windows 10 x64
Visual Studio Professional 2019 16.7.4
Windows 10 SDK 10.0.19041.0
QT 5.14.1
CMake 3.14.0
(二)源码下载
通过Github 下载MITV。
(三)配置VS工程
运行CMake-GUI,配置VS工程
选择MITK源码目录和VS工程目录(MITK子目录cbuild);
Advanced复选框选中;
选中复选框MITK_USE_ACVD、MITK_USE_OPENCV;
具体参考官方说明,如下图
选择configure,无错误之后,选择generate.无错误之后,选择open project。
(四)问题
1.提示问题"You should manually point CMake variable OpenCV_DIR to your build of OpenCV library."在网上查找了一些资料,如下:
或者如下:
但是测试之后均解决不了问题,后来发现我的目录是这样的
将External_OpenCV_Dir指向此目录,问题得解。
2.出现”mitkSlicedGeometry3D.cpp(1,1): error C2220: the following warning is treated as an error [C:MITK-v2018.04.2-srccbuildMITK-buildModulesCoreMitkCore.vcxproj]“
”mitkSlicedGeometry3D.cpp(1,1): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss [C:MITK-v2018.04.2-srccbuildMITK-buildModulesCoreMitkCore.vcxproj]
用notepad++打开文件,另存为UTF-BOM格式,网上也有说法,通过notepad打开,存成UNICODE的说法,重新编译。
3.mitkAnnotationUtils.h文件提示”error C2039: 'string': is not a member of 'std'“,添加#include 语句,重新编译。