当前位置:网站首页>Determine whether the file is a DICOM file
Determine whether the file is a DICOM file
2022-07-07 05:44:00 【Dump you for thousands of miles】
The basis of judgment : according to DICOM Prefix , The length is 4 Whether a string of bytes is equal to “DICM” To determine whether the file belongs to DICOM file
/ Determine whether the target file is DICOM file /
bool IsDicomFile(QString path)
{
// Judge whether it is dicom file
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;
}
边栏推荐
- Flink SQL realizes reading and writing redis and dynamically generates hset key
- sql优化常用技巧及理解
- 《HarmonyOS实战—入门到开发,浅析原子化服务》
- Message queue: how to handle repeated messages?
- The 2022 China low / no code Market Research and model selection evaluation report was released
- 随机生成session_id
- Use, configuration and points for attention of network layer protocol (taking QoS as an example) when using OPNET for network simulation
- Leakage relay llj-100fs
- Go language context explanation
- "Multimodal" concept
猜你喜欢
How does mapbox switch markup languages?
爬虫练习题(三)
1.AVL树:左右旋-bite
Initial experience of annotation
Différenciation et introduction des services groupés, distribués et microservices
往图片添加椒盐噪声或高斯噪声
How Alibaba cloud's DPCA architecture works | popular science diagram
The year of the tiger is coming. Come and make a wish. I heard that the wish will come true
分布式事务解决方案之2PC
论文阅读【Open-book Video Captioning with Retrieve-Copy-Generate Network】
随机推荐
What is dependency injection (DI)
Mysql database learning (7) -- a brief introduction to pymysql
JVM (XX) -- performance monitoring and tuning (I) -- Overview
微信小程序蓝牙连接硬件设备并进行通讯,小程序蓝牙因距离异常断开自动重连,js实现crc校验位
Zhang Ping'an: accelerate cloud digital innovation and jointly build an industrial smart ecosystem
Taobao commodity details page API interface, Taobao commodity list API interface, Taobao commodity sales API interface, Taobao app details API interface, Taobao details API interface
Leakage relay llj-100fs
nVisual网络可视化
[JS component] custom select
Distributed global ID generation scheme
关于服装ERP,你知道多少?
[论文阅读] A Multi-branch Hybrid Transformer Network for Corneal Endothelial Cell Segmentation
CVE-2021-3156 漏洞复现笔记
Message queue: how to deal with message backlog?
SQL query: subtract the previous row from the next row and make corresponding calculations
Web Authentication API兼容版本信息
论文阅读【Sensor-Augmented Egocentric-Video Captioning with Dynamic Modal Attention】
Jhok-zbg2 leakage relay
Lombok插件
1.AVL树:左右旋-bite