当前位置:网站首页>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;
}
边栏推荐
- Photo selector collectionview
- 论文阅读【MM21 Pre-training for Video Understanding Challenge:Video Captioning with Pretraining Techniqu】
- High voltage leakage relay bld-20
- Taobao store release API interface (New), Taobao oauth2.0 store commodity API interface, Taobao commodity release API interface, Taobao commodity launch API interface, a complete set of launch store i
- Polynomial locus of order 5
- 往图片添加椒盐噪声或高斯噪声
- How digitalization affects workflow automation
- TCC of distributed transaction solutions
- Realize GDB remote debugging function between different network segments
- 淘宝店铺发布API接口(新),淘宝oAuth2.0店铺商品API接口,淘宝商品发布API接口,淘宝商品上架API接口,一整套发布上架店铺接口对接分享
猜你喜欢
随机推荐
消息队列:如何确保消息不会丢失
5. Data access - entityframework integration
The 2022 China low / no code Market Research and model selection evaluation report was released
论文阅读【MM21 Pre-training for Video Understanding Challenge:Video Captioning with Pretraining Techniqu】
make makefile cmake qmake都是什么,有什么区别?
How does mapbox switch markup languages?
Leakage relay llj-100fs
Modes of optical fiber - single mode and multimode
论文阅读【Open-book Video Captioning with Retrieve-Copy-Generate Network】
"Multimodal" concept
4. 对象映射 - Mapping.Mapster
Five core elements of architecture design
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
SQLSTATE[HY000][1130] Host ‘host. docker. internal‘ is not allowed to connect to this MySQL server
Mybaits multi table query (joint query, nested query)
Web architecture design process
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
English grammar_ Noun possessive
Differences and introduction of cluster, distributed and microservice
Distributed global ID generation scheme








