当前位置:网站首页>判断文件是否为DICOM文件
判断文件是否为DICOM文件
2022-07-06 23:54:00 【甩你十万八千里】
判断依据:根据DICOM前缀,长度为4个字节的字符串是否等于“DICM”来判断该文件是否属于DICOM文件
/判断目标文件是否为DICOM文件/
bool IsDicomFile(QString path)
{
// 判断是否为dicom文件
char buffer[0x85];
std::string s = path.toStdString();
std::ifstream in(path.toStdString().c_str());
in.getline(buffer, 0x85);
if (!((buffer[0x80] == 0x44) && (buffer[0x81] == 0x49) &&
(buffer[0x82] == 0x43) && (buffer[0x83] == 0x4D)))
{
std::cout << path.toStdString() << std::endl;
std::cout << “It’s not a DICOM File!” << std::endl;
return false;
}
return true;
}
边栏推荐
- Life experience of an update statement
- How digitalization affects workflow automation
- [PM products] what is cognitive load? How to adjust cognitive load reasonably?
- What is dependency injection (DI)
- 分布式事务介绍
- [paper reading] semi supervised left atrium segmentation with mutual consistency training
- Reading the paper [sensor enlarged egocentric video captioning with dynamic modal attention]
- JHOK-ZBG2漏电继电器
- 删除文件时提示‘源文件名长度大于系统支持的长度’无法删除解决办法
- JSP setting header information export to excel
猜你喜欢
Leetcode 1189 maximum number of "balloons" [map] the leetcode road of heroding
4. Object mapping Mapster
论文阅读【MM21 Pre-training for Video Understanding Challenge:Video Captioning with Pretraining Techniqu】
不同网段之间实现GDB远程调试功能
bat 批示处理详解
Leakage relay jelr-250fg
Record a pressure measurement experience summary
阿里云的神龙架构是怎么工作的 | 科普图解
Getting started with DES encryption
论文阅读【Sensor-Augmented Egocentric-Video Captioning with Dynamic Modal Attention】
随机推荐
不同网段之间实现GDB远程调试功能
删除文件时提示‘源文件名长度大于系统支持的长度’无法删除解决办法
Zhang Ping'an: accelerate cloud digital innovation and jointly build an industrial smart ecosystem
[论文阅读] A Multi-branch Hybrid Transformer Network for Corneal Endothelial Cell Segmentation
消息队列:消息积压如何处理?
Codeforces Round #416 (Div. 2) D. Vladik and Favorite Game
Initial experience of annotation
How Alibaba cloud's DPCA architecture works | popular science diagram
Most commonly used high number formula
Mapbox Chinese map address
Record a pressure measurement experience summary
Flinksql 读写pgsql
Paper reading [semantic tag enlarged xlnv model for video captioning]
消息队列:如何确保消息不会丢失
5. Data access - entityframework integration
App clear data source code tracking
Tablayout modification of customized tab title does not take effect
京东商品详情页API接口、京东商品销量API接口、京东商品列表API接口、京东APP详情API接口、京东详情API接口,京东SKU信息接口
淘宝商品详情页API接口、淘宝商品列表API接口,淘宝商品销量API接口,淘宝APP详情API接口,淘宝详情API接口
分布式全局ID生成方案