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/