当前位置:网站首页>VMTK环境配置记录
VMTK环境配置记录
2022-08-02 05:12:00 【Amelie_11】
1.安装VMTK
下载链接:添加链接描述
按照提示输入指令,即可。
可以看到目录下:
2. VS2019配置环境
参考文章:vmtk c++ vs2019安装过程
按照文章步骤配置包含目录,库目录,附加依赖项
配置lib文件时,快速读取文件名的代码:
#include <iostream>
#include "windows.h"
#include <string>
#include <vector>
#include <assert.h>
#include <io.h>
#include <fstream>
using namespace std;
//读取全部路径
void GetAllFormatFiles(string path, vector<string>& files, string format)
{
//文件句柄
long long hFile = 0;
//文件信息
struct _finddata_t fileinfo;
string p;
if ((hFile = _findfirst(p.assign(path).append("\\*" + format).c_str(), &fileinfo)) != -1)
{
do
{
if ((fileinfo.attrib & _A_SUBDIR))
{
if (strcmp(fileinfo.name, ".") != 0 && strcmp(fileinfo.name, "..") != 0)
{
//files.push_back(p.assign(path).append("\\").append(fileinfo.name) );
GetAllFormatFiles(p.assign(path).append("\\").append(fileinfo.name), files, format);
}
}
else
{
files.push_back(p.assign(path).append("\\").append(fileinfo.name));
}
} while (_findnext(hFile, &fileinfo) == 0);
_findclose(hFile);
}
}
//只读取文件名
void getFiles(string path, vector <string>& files)
{
long long hFile = 0;
struct _finddata_t fileinfo;
string pathp;
if ((hFile = _findfirst(pathp.assign(path).append("\\*").c_str(), &fileinfo)) != -1)
{
do
{
if ((fileinfo.attrib & _A_SUBDIR))
{
if (strcmp(fileinfo.name, ".") != 0 && strcmp(fileinfo.name, "..") != 0)
{
getFiles(pathp.assign(path).append("/").append(fileinfo.name), files);
}
}
else
{
string filestr = fileinfo.name;
files.push_back(filestr);
}
} while (_findnext(hFile, &fileinfo) == 0);
_findclose(hFile);
}
}
int main()
{
string filePath = "F:\\miniconda3\\envs\\foo\\Library\\lib";
vector<string> files;
const char* distAll = "AllFiles.txt";
//读取所有格式为txt的文件
string format = ".lib";
getFiles(filePath, files);
ofstream ofn(distAll);
int size = files.size();
ofn << size << endl;
for (int i = 0; i < size; i++)
{
ofn << files[i] << endl;
cout << files[i] << endl;
}
ofn.close();
return 0;
}
3. 测试
运行代码,
文章作者:机器人学渣
VTK(四)—VMTK血管中心线提取
报错,找不到vmtk的相关dll文件
百度如何配置dll路径,VS引用dll的目录配置
最终将F:\miniconda3\envs\foo\Library\bin目录下的所有文件复制到project下。
运行成功。
4. 问题记录:
头文件
F:\miniconda3\envs\foo\Library\include\vmtk\vtkvmtkPolyDataCenterlines.h
和
F:\miniconda3\envs\foo\Library\include\vmtk\vtkvmtkCapPolyData.h
报错“VTK_OVERRIDE”: 未知重写说明符
查看源代码,没有改动。
不知道如何解决,索性将VTK_OVERRIDE删除,竟然没有报错,不知道是什么原因。
边栏推荐
- Redis-cluster mode (master-slave replication mode, sentinel mode, clustering mode)
- MYSQL unique constraint
- goroutine (coroutine) in go language
- Use the browser's local storage to realize the function of remembering the user name
- Google 安装印象笔记剪藏插件
- Differences between i++ and ++i in loops in C language
- kubernetes 亲和、反亲和、污点、容忍
- [PSQL] 窗口函数、GROUPING运算符
- Detailed installation and configuration of golang environment
- Timing task library in the language use Cron, rounding
猜你喜欢
随机推荐
Navicat new database
OAuth 授权协议 | 都云原生时代了,我们应该多懂一点OAuth ?
165.比较版本号
golang generics
H5 access payment process - WeChat payment & Alipay payment
25K test old bird's 6-year experience in interviews, four types of companies, four types of questions...
How much does a test environment cost? Start with cost and efficiency
浏览器的onload事件
Differences between i++ and ++i in loops in C language
51单片机外设篇:点阵式LCD
Cyber Security Learning - Intranet Penetration 4
【合集- 行业解决方案】如何搭建高性能的数据加速与数据编排平台
Meta公司新探索 | 利用Alluxio数据缓存降低Presto延迟
100 latest software testing interview questions in 2022, summary of common interview questions and answers
golang环境详细安装、配置
Browser onload event
leetcode每天5题-Day04
卸载redis
ATM系统
LeetCode brush topic series - 787 K station transfer within the cheapest flight