1.dicom格式文件下載
網絡資源:http://pubp_w_picpath.hcuge.ch:8080/,此網站包含各種機器產生的各種部位的dcm圖像資源,另外還有單幀或多幀的,非常好用,
2.dicom標準
- 權威官方網站: http://medical.nema.org/ 可下載DICOM的標準文檔, 但是貌似只有doc和pdf格式的標準文件,不好查詢跳轉,
- 另一個html式的dicom標準文檔 http://dabsoft.ch/dicom/3 期待離線chm版的dicom標準文檔
3.DICOM文件格式校驗工具 DVT(DICOM Validateor Tools) 及相關工具 dicom editor(dicom信息編輯,修改工具),dicom Anonymazier (dicom匿名工具)
DVT(DICOM Validateor Tools)安裝使用方法:
- 此工具需要同時下載DVT_2_6_6.0.msi安裝包和 Definitions 1.1.10.0.msi 安裝包,
- 把2者都安裝上後,注意Definitions.msi的文件安裝路徑無法更改,會默認安裝到 C:\Program Files\Common Files\DVTk 下面,(在此我要強烈那個bs開發者居然不提示路徑,害我找半天).
- 安裝好2個包後,啓動DVT,新建一個工程,再在工程下新建一個sseion,建sseion時如果校驗文件,請選擇session type 爲Media.其他可不填,選擇下一步
- 這時會提示definitions的路徑,此時選擇指定definitions的安裝目錄,並指定results file directory ,這個最好選擇一個無用的文件夾,因爲校驗文件過程中會產生很多中間文件,不想目錄混亂不堪的請注意這個項目.
- 下一步會讓你選擇一個或多個definition files,這個根據自己需要進行選擇,一般需要選擇一個File Meta.def 和其他.def文件.
- 設置好之後,在左側樹列表右鍵->validate media files 選擇一個.dcm 文件進行校驗,馬上就會看到校驗結果.
4.dicom 文件查看器網上有很多,建議最好找大的,專業些的dicom 查看器,一是權威,二是好用,推薦如下:
1)DicomLite.exe
2) MedExplorer.exe
3) Acculite.exe
5.另外提供一個C++代碼寫的生成dicom文件的代碼.使用到dcmtk庫,
- #include "stdafx.h"
- #include "dcmtk\dcmdata\dctk.h"
- #include "DCMTK\dcmimgle\dcmp_w_picpath.h"
- using namespace std;
- #pragma comment(linker,"/NOD:LIBCMT")
- #pragma comment(lib, "oflog.lib")
- #pragma comment(lib, "ofstd.lib")
- #pragma comment(lib, "dcmp_w_picpath.lib")
- #pragma comment(lib, "dcmdata.lib")
- #pragma comment(lib, "oflog.lib")
- #pragma comment(lib, "netapi32.lib")
- #pragma comment(lib, "wsock32.lib")
- int _tmain(int argc, _TCHAR* argv[])
- {
- char uid[100];
- DcmFileFormat fileformat;
- DcmMetaInfo *metainfo = fileformat.getMetaInfo();
- DcmDataset *dataset = fileformat.getDataset();
- //***meta group******/
- metainfo->putAndInsertString(DCM_FileMetaInformationVersion, "us test dcm file");
- metainfo->putAndInsertString(DCM_MediaStorageSOPClassUID, UID_RETIRED_UltrasoundImageStorage);
- metainfo->putAndInsertString(DCM_MediaStorageSOPInstanceUID, dcmGenerateUniqueIdentifier(uid,SITE_INSTANCE_UID_ROOT));
- metainfo->putAndInsertString(DCM_TransferSyntaxUID, UID_LittleEndianExplicitTransferSyntax);
- metainfo->putAndInsertString(DCM_ImplementationClassUID,"999.999");
- //***identifying group****/
- dataset->putAndInsertString(DCM_ImageType,"ORIGINAL\\PRIMARY\\TEE\\0011");
- dataset->putAndInsertString(DCM_SOPClassUID, UID_RETIRED_UltrasoundImageStorage);//UID_SecondaryCaptureImageStorage);
- dataset->putAndInsertString(DCM_SOPInstanceUID, dcmGenerateUniqueIdentifier(uid, SITE_INSTANCE_UID_ROOT));
- dataset->putAndInsertString(DCM_StudyID,"398474");
- dataset->putAndInsertString(DCM_StudyDate,"20100823");
- dataset->putAndInsertString(DCM_StudyTime,"080322");
- dataset->putAndInsertString(DCM_Modality,"US");//OT
- dataset->putAndInsertString(DCM_Manufacturer,"ACME product");
- dataset->putAndInsertString(DCM_ReferringPhysicianName,"ANONY");
- dataset->putAndInsertString(DCM_StudyDescription,"STUDY description");
- dataset->putAndInsertString(DCM_SeriesDescription,"SERIES DESCRIPTION");
- dataset->putAndInsertString(DCM_StageNumber,"1");
- dataset->putAndInsertString(DCM_NumberOfStages,"1");
- dataset->putAndInsertString(DCM_ViewNumber,"1");
- dataset->putAndInsertString(DCM_NumberOfViewsInStage,"1");
- /***patient group*****/
- dataset->putAndInsertString(DCM_PatientID, "PatientID");
- dataset->putAndInsertString(DCM_PatientName, "PatientName");
- dataset->putAndInsertString(DCM_PatientSex, "M");
- dataset->putAndInsertString(DCM_PatientBirthDate,"20000302");
- /************************************************************************/
- /* acquisiton group */
- /************************************************************************/
- //DCM_ProtocolName
- /************************************************************************/
- /* relation group */
- /************************************************************************/
- dataset->putAndInsertString(DCM_StudyInstanceUID,"999.999.2.19941105.112000");
- dataset->putAndInsertString(DCM_SeriesInstanceUID,"999.999.2.19941105.112000.2");
- dataset->putAndInsertString(DCM_SeriesNumber,"2");
- dataset->putAndInsertString(DCM_AccessionNumber,"1");
- //dataset->putAndInsertString(DCM_InstanceNumber,);
- //調窗
- //dataset->putAndInsertString(DCM_WindowCenter, "256");
- //dataset->putAndInsertString(DCM_WindowWidth, "128");
- const int width = 256;
- const int height = 256;
- dataset->putAndInsertString(DCM_InstanceNumber,"1");
- //dataset->putAndInsertString(DCM_PatientOrientation,"HFL");
- dataset->putAndInsertString(DCM_PhotometricInterpretation,"RGB");
- dataset->putAndInsertUint16(DCM_SamplesPerPixel,3);
- dataset->putAndInsertUint16(DCM_BitsAllocated,8);
- dataset->putAndInsertUint16(DCM_BitsStored,8);
- dataset->putAndInsertUint16(DCM_HighBit,7);
- dataset->putAndInsertUint16(DCM_PixelRepresentation,0);
- dataset->putAndInsertUint16(DCM_PlanarConfiguration,0);
- dataset->putAndInsertString(DCM_PixelAspectRatio,"4\\3");
- dataset->putAndInsertUint16(DCM_Rows,width);
- dataset->putAndInsertUint16(DCM_Columns,height);
- BYTE* pData=new BYTE[width*height*3];
- memset(pData, 0, width*height*3);
- for(int y=0; y < height; y++){
- //memset(pData+ y*width*3, y & 0xff0000,width*3);
- for(int x=0; x<width*3; x++)
- {
- if(x%3==0)
- pData[y*width*3+x] = 0xff;
- else
- pData[y*width*3+x] = rand()%256;
- }
- }
- dataset->putAndInsertUint8Array(DCM_PixelData,pData, width*height*3);
- delete[] pData;
- OFCondition status = fileformat.saveFile("d:\\pic\\test.dcm",
- EXS_LittleEndianImplicit,EET_UndefinedLength,EGL_withoutGL);
- if (status.bad())
- {
- printf("\n cannot write dicom file");
- return false;
- }
- return true;
- }