資源簡介
支持DCM格式圖像打開,窗寬窗位調(diào)節(jié),同時支持JPEG格式圖像打開。

代碼片段和文件信息
//?DIB.cpp:?implementation?of?the?CDIB?class.
//
//////////////////////////////////////////////////////////////////////
#include?“stdafx.h“
#include?“EXE.h“
#include?“DIB.h“
#include?“math.h“
#ifdef?_DEBUG
#undef?THIS_FILE
static?char?THIS_FILE[]=__FILE__;
#define?new?DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
//?Construction/Destruction
//////////////////////////////////////////////////////////////////////
CDIB::CDIB()
{
m_pDib=NULL;
pdate?=NULL;
m_pDibBits=NULL;
name?=NULL;
m_Palette=NULL;
hospital=NULL;
add?=NULL;
id?=NULL;
}
CDIB::~CDIB()
{
if?(m_pDib!=NULL)
{ delete?[]m_pDib;
}
if?(pdate!=?NULL)
{
delete?[]pdate;
}
if?(m_pDibBits!=NULL)?{
delete?[]m_pDibBits;
}
if?(name!=NULL)?delete?[]name;
if?(hospital!=NULL)?delete?[]hospital;
if?(add!=NULL)?delete?[]add;
if(id!=NULL)??delete?[]id;
? if?(m_Palette!=NULL)?delete?[]m_Palette;
}
bool?CDIB::LoadFile(?const?char?*FileName?)
{
CFile?File;
File.Open(FileNameCFile::modeRead|CFile::shareDenyRead);
DWORD?dwsize=?File.GetLength();
pdate=?new?unsigned?char[dwsize];
File.Read(pdatedwsize);
if?(pdate[128]!=‘D‘||pdate[129]!=‘I‘||pdate[130]!=‘C‘||pdate[131]!=‘M‘)
{
AfxMessageBox(“這不是一個的DICOM文件“);
delete?[]pdate;
return?FALSE;
}
//姓名
int?ij;
long?int?datesize?=0;
for?(i=128;i {
if?(pdate[i]==0x10&&pdate[i+1]==0x00&&pdate[i+2]==0x10&&pdate[i+3]==0x00)
{
datesize=?long?int(pdate[i+4]+pdate[i+5]*pow(2561)+pdate[i+6]*pow(2562)+pdate[i+7]*pow(2563));
break;
}
}
name?=new??char?[datesize?+1];
for?(j=0;j {
name[j]=pdate[i+8+j];
}
name[j]=‘\0‘;
//出生日期
datesize?=0;
for?(i=128;i {
if?(pdate[i]==0x10&&pdate[i+1]==0x00&&pdate[i+2]==0x30&&pdate[i+3]==0x00)
{
datesize=?long?int(pdate[i+4]+pdate[i+5]*pow(2561)+pdate[i+6]*pow(2562)+pdate[i+7]*pow(2563));
break;
}
}
birthday?=new??char?[datesize?+1];
for?(j=0;j {
birthday[j]=pdate[i+8+j];
}
birthday[j]=‘\0‘;
//病人編號
datesize?=0;
for?(i=128;i {
if?(pdate[i]==0x10&&pdate[i+1]==0x00&&pdate[i+2]==0x20&&pdate[i+3]==0x00)
{
datesize=?long?int(pdate[i+4]+pdate[i+5]*pow(2561)+pdate[i+6]*pow(2562)+pdate[i+7]*pow(2563));
break;
}
}
id?=new??char?[datesize?+1];
for?(j=0;j {
id[j]=pdate[i+8+j];
}
id[j]=‘\0‘;
//醫(yī)院
datesize?=0;
for?(i=128;i {
if?(pdate[i]==0x08&&pdate[i+1]==0x00&&pdate[i+2]==0x80&&pdate[i+3]==0x00)
{
datesize=?long?int(pdate[i+4]+pdate[i+5]*pow(2561)+pdate[i+6]*pow(2562)+pdate[i+7]*pow(2563));
break;
}
}
hospital?=new??char?[datesize?+1];
for?(j=0;j {
hospital[j]=pdate[i+8+j];
}
hospital[j]=‘\0‘;
//醫(yī)院地址
datesize?=0;
for?(i=128;i {
if?(pdate
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????26524??2012-08-15?13:21??DCM.exe\Debug\DIB.obj
?????文件?????131132??2012-08-15?13:21??DCM.exe\Debug\EXE.exe
?????文件?????328108??2012-08-15?13:21??DCM.exe\Debug\EXE.ilk
?????文件??????22888??2012-08-15?13:21??DCM.exe\Debug\EXE.obj
?????文件????5492384??2012-08-15?13:21??DCM.exe\Debug\EXE.pch
?????文件?????345088??2012-08-15?13:21??DCM.exe\Debug\EXE.pdb
?????文件???????7336??2012-08-15?13:21??DCM.exe\Debug\EXE.res
?????文件??????17599??2012-08-15?13:21??DCM.exe\Debug\EXEDoc.obj
?????文件??????21854??2012-08-15?13:21??DCM.exe\Debug\EXEView.obj
?????文件??????20006??2012-08-15?13:21??DCM.exe\Debug\MainFrm.obj
?????文件?????105725??2012-08-15?13:21??DCM.exe\Debug\StdAfx.obj
?????文件?????205824??2012-08-15?13:32??DCM.exe\Debug\vc60.idb
?????文件?????364544??2012-08-15?13:21??DCM.exe\Debug\vc60.pdb
?????文件???????9741??2010-06-06?18:30??DCM.exe\DIB.cpp
?????文件???????1059??2010-06-06?18:28??DCM.exe\DIB.h
?????文件??????44080??2010-06-06?18:24??DCM.exe\EXE.APS
?????文件???????2367??2010-06-06?18:30??DCM.exe\EXE.clw
?????文件???????4155??2010-03-23?15:54??DCM.exe\EXE.cpp
?????文件???????4610??2010-03-23?16:54??DCM.exe\EXE.dsp
?????文件????????529??2010-03-23?15:54??DCM.exe\EXE.dsw
?????文件???????1323??2010-03-23?15:54??DCM.exe\EXE.h
?????文件??????91136??2010-06-06?18:30??DCM.exe\EXE.ncb
?????文件??????49664??2010-06-06?18:30??DCM.exe\EXE.opt
?????文件???????1133??2010-06-06?18:30??DCM.exe\EXE.plg
?????文件??????11919??2010-06-06?18:24??DCM.exe\EXE.rc
?????文件???????2056??2010-03-23?16:35??DCM.exe\EXEDoc.cpp
?????文件???????1564??2010-06-06?01:32??DCM.exe\EXEDoc.h
?????文件???????3129??2010-06-06?18:17??DCM.exe\EXEView.cpp
?????文件???????1784??2010-05-23?11:03??DCM.exe\EXEView.h
?????文件???????2504??2010-03-23?15:54??DCM.exe\MainFrm.cpp
............此處省略15個文件信息
- 上一篇:北京郵電大學(xué)大一C++期末考題.zip
- 下一篇:MFC中點圓的生成算法
評論
共有 條評論