当前位置:网站首页>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;
}
边栏推荐
- SQL query: subtract the previous row from the next row and make corresponding calculations
- Flinksql 读写pgsql
- Codeforces Round #416 (Div. 2) D. Vladik and Favorite Game
- 1.AVL树:左右旋-bite
- High voltage leakage relay bld-20
- English grammar_ Noun possessive
- What are the common message queues?
- Paper reading [MM21 pre training for video understanding challenge:video captioning with pre training techniqu]
- JD commodity details page API interface, JD commodity sales API interface, JD commodity list API interface, JD app details API interface, JD details API interface, JD SKU information interface
- JSP setting header information export to excel
猜你喜欢
![[JS component] custom select](/img/9d/f7f15ec21763c40b9bb6a053d90ee4.jpg)
[JS component] custom select

Getting started with DES encryption

4. Object mapping Mapster

分布式事务解决方案之2PC

集群、分布式、微服务的区别和介绍

C#可空类型

Design, configuration and points for attention of network unicast (one server, multiple clients) simulation using OPNET

Leetcode: maximum number of "balloons"

bat 批示处理详解

ForkJoin最全详解(从原理设计到使用图解)
随机推荐
软件测试面试技巧
When deleting a file, the prompt "the length of the source file name is greater than the length supported by the system" cannot be deleted. Solution
Flink SQL realizes reading and writing redis and dynamically generates hset key
SAP webservice 测试出现404 Not found Service cannot be reached
微信小程序蓝牙连接硬件设备并进行通讯,小程序蓝牙因距离异常断开自动重连,js实现crc校验位
Design, configuration and points for attention of network specified source multicast (SSM) simulation using OPNET
How does mapbox switch markup languages?
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
1. AVL tree: left-right rotation -bite
Polynomial locus of order 5
CVE-2021-3156 漏洞复现笔记
Make web content editable
Paper reading [MM21 pre training for video understanding challenge:video captioning with pre training techniqu]
Tablayout modification of customized tab title does not take effect
Explication contextuelle du langage Go
Hcip seventh operation
Paper reading [open book video captioning with retrieve copy generate network]
论文阅读【Sensor-Augmented Egocentric-Video Captioning with Dynamic Modal Attention】
Jhok-zbg2 leakage relay
WEB架构设计过程