当前位置:网站首页>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删除,竟然没有报错,不知道是什么原因。
边栏推荐
- Go language study notes - grpc serverclient protobuf Go language from scratch
- Linux CentOS8安装Redis6
- How much does a test environment cost? Start with cost and efficiency
- JUC(一)- JUC学习概览 - 对JUC有一个整体的认识
- 利用浏览器本地存储 实现记住用户名的功能
- classSR论文阅读笔记
- 家用 NAS 服务器(4)| MergerFS和SnapRaid数据定时备份
- About the directory structure of the web application
- Redis database
- Mysql common commands
猜你喜欢
随机推荐
The company does not pay attention to software testing, and the new Ali P8 has written a test case writing specification for us
TikTok平台的两种账户有什么区别?
6W+字记录实验全过程 | 探索Alluxio经济化数据存储策略
nacos registry
区块元素、内联元素(<div>元素、span元素)
字节面试题:如何保证缓存和数据库的一致性
5款经典代码阅读器的使用方案对比
腾讯大咖分享 | 腾讯Alluxio(DOP)在金融场景的落地与优化实践
golang泛型
Cyber Security Learning - Intranet Penetration 4
C语言入门实战(13):十进制数转二进制
金山云团队分享 | 5000字读懂Presto如何与Alluxio搭配
Redis-----非关系数据库
为什么4个字节的float要比8个字节的long大呢?
Redis集群模式
提高软件测试能力的方法有哪些?看完这篇文章让你提升一个档次
网安学习-内网渗透4
【漫画】2021满分程序员行为对照表(最新版)
[PSQL] 窗口函数、GROUPING运算符
51单片机外设篇:ADC








