当前位置:网站首页>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;
}
边栏推荐
- High voltage leakage relay bld-20
- 5. Data access - entityframework integration
- Hcip seventh operation
- pytorch_ 01 automatic derivation mechanism
- 毕业之后才知道的——知网查重原理以及降重举例
- Message queue: how to deal with message backlog?
- How digitalization affects workflow automation
- JSP setting header information export to excel
- 导航栏根据路由变换颜色
- sql查询:将下一行减去上一行,并做相应的计算
猜你喜欢
Differences and introduction of cluster, distributed and microservice
[JS component] date display.
4. 对象映射 - Mapping.Mapster
三级菜单数据实现,实现嵌套三级菜单数据
得物客服一站式工作台卡顿优化之路
Unity keeps the camera behind and above the player
JSP setting header information export to excel
5. Data access - entityframework integration
《2022中国低/无代码市场研究及选型评估报告》发布
Senior programmers must know and master. This article explains in detail the principle of MySQL master-slave synchronization, and recommends collecting
随机推荐
纪念下,我从CSDN搬家到博客园啦!
上海字节面试问题及薪资福利
Common skills and understanding of SQL optimization
4. 对象映射 - Mapping.Mapster
Web Authentication API兼容版本信息
《2022中国低/无代码市场研究及选型评估报告》发布
[PM products] what is cognitive load? How to adjust cognitive load reasonably?
The 2022 China low / no code Market Research and model selection evaluation report was released
Message queue: how to deal with message backlog?
Différenciation et introduction des services groupés, distribués et microservices
Jhok-zbg2 leakage relay
Tablayout modification of customized tab title does not take effect
Five core elements of architecture design
2pc of distributed transaction solution
Batch size setting skills
Photo selector collectionview
Make web content editable
Lombok插件
Paper reading [MM21 pre training for video understanding challenge:video captioning with pre training techniqu]
什么是消息队列?