当前位置:网站首页>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;
}
边栏推荐
- 淘寶商品詳情頁API接口、淘寶商品列錶API接口,淘寶商品銷量API接口,淘寶APP詳情API接口,淘寶詳情API接口
- JVM (XX) -- performance monitoring and tuning (I) -- Overview
- 1.AVL树:左右旋-bite
- 微信小程序蓝牙连接硬件设备并进行通讯,小程序蓝牙因距离异常断开自动重连,js实现crc校验位
- In memory, I moved from CSDN to blog park!
- Web Authentication API兼容版本信息
- Modes of optical fiber - single mode and multimode
- Message queue: how to deal with message backlog?
- Leakage relay llj-100fs
- Flinksql 读写pgsql
猜你喜欢
《2022中国低/无代码市场研究及选型评估报告》发布
The navigation bar changes colors according to the route
数据中心为什么需要一套基础设施可视化管理系统
[论文阅读] A Multi-branch Hybrid Transformer Network for Corneal Endothelial Cell Segmentation
Unity keeps the camera behind and above the player
《HarmonyOS实战—入门到开发,浅析原子化服务》
C nullable type
Egr-20uscm ground fault relay
Zero sequence aperture of leakage relay jolx-gs62 Φ one hundred
Common skills and understanding of SQL optimization
随机推荐
纪念下,我从CSDN搬家到博客园啦!
Message queuing: how to ensure that messages are not lost
Mybaits之多表查询(联合查询、嵌套查询)
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
Common skills and understanding of SQL optimization
Leakage relay jelr-250fg
Digital innovation driven guide
数据中心为什么需要一套基础设施可视化管理系统
nVisual网络可视化
SQLSTATE[HY000][1130] Host ‘host. docker. internal‘ is not allowed to connect to this MySQL server
毕业之后才知道的——知网查重原理以及降重举例
Reading the paper [sensor enlarged egocentric video captioning with dynamic modal attention]
Web architecture design process
I didn't know it until I graduated -- the principle of HowNet duplication check and examples of weight reduction
【Shell】清理nohup.out文件
WEB架构设计过程
Message queue: how to deal with message backlog?
4. Object mapping Mapster
High voltage leakage relay bld-20
make makefile cmake qmake都是什么,有什么区别?