DICOM V3.0 SOP類做爲SCU和SCP提供了的標準聽從性。
SOP Class Nameide
SOP Class UIDspa
Computed Radiography Image Information Object計算射線照相術圖象信息對象orm
1.2.840.10008.5.1.4.1.1.1xml
CT Image Information ObjectCT圖象信息對象對象
1.2.840.10008.5.1.4.1.1.2blog
MR Image Information ObjectMR圖象信息對象ci
1.2.840.10008.5.1.4.1.1.4get
Nuclear Medicine Image Information Object核醫學圖象信息對象string
1.2.840.10008.5.1.4.1.1.5it
Ultrasound Image Information Object超聲圖象信息對象
1.2.840.10008.5.1.4.1.1.6
Secondary Capture Image Information Object繼發捕獲圖象信息對象
1.2.840.10008.5.1.4.1.1.7
- int _tmain(int argc, _TCHAR* argv[])
- {
- typedef unsigned short PixelType;
- const unsigned int Dimension = 3;
- typedef itk::Image<PixelType,Dimension> ImageType;
- typedef itk::ImageSeriesReader<ImageType> ReaderType;
- ReaderType::Pointer reader = ReaderType::New();
- typedef itk::GDCMImageIO ImageIOType;
- ImageIOType::Pointer dicomIO = ImageIOType::New();
- reader->SetImageIO(dicomIO);
- typedef itk::GDCMSeriesFileNames NamesGeneratorType;
- NamesGeneratorType::Pointer nameGenerator = NamesGeneratorType::New();
- nameGenerator->SetInputDirectory("E:\\CT\\serial2");//讀取目錄
- //存儲文件名字
- typedef std::vector<std::string> FileNamesContainer;
- FileNamesContainer fileNames = nameGenerator->GetInputFileNames();
- int num = fileNames.size();
- std::cout<<num<<std::endl;
- reader->SetFileNames(fileNames);
- connector->SetInput(reader->GetOutput());
- try
- {
- reader->Update();
- }
- catch(itk::ExceptionObject &err)
- {
- std::cerr<<"Read Error"<<std::endl;
- std::cerr<<err<<std::endl;
- return EXIT_FAILURE;
- }
- //create MetaDataDictionary
- typedef itk::MetaDataDictionary DictionaryType;
- const DictionaryType &dictionary = dicomIO->GetMetaDataDictionary();
- typedef itk::MetaDataObject<std::string> MetaDataStringType;
- DictionaryType::ConstIterator itr = dictionary.Begin();
- DictionaryType::ConstIterator end = dictionary.End();
- while( itr != end )
- {
- itk::MetaDataObjectBase::Pointer entry = itr->second;
- MetaDataStringType::Pointer entryvalue =
- dynamic_cast<MetaDataStringType *>(entry.GetPointer());
- if(entryvalue)
- {
- std::string tagkey = itr->first;
- std::string tagvalue = entryvalue->GetMetaDataObjectValue();
- std::cout<<tagkey<<"="<<tagvalue<<std::endl;
- }/*0002|0002字段能夠標識SOP Class UID,若是是CT就是
- 1.2.840.10008.5.1.4.1.1.2,若是是MRI就是1.2.840.10008.5.1.4.1.1.4*/
- ++itr;
- }
- }
本文來源:http://buaagc.blog.163.com/blog/static/7278839420110510227639/