DICOM V3.0 SOP类作为SCU和SCP提供了的标准遵从性。
SOP Class Name
SOP Class UID
Computed Radiography Image Information Object计算射线照相术图象信息对象
1.2.840.10008.5.1.4.1.1.1
CT Image Information ObjectCT图象信息对象
1.2.840.10008.5.1.4.1.1.2
MR Image Information ObjectMR图象信息对象
1.2.840.10008.5.1.4.1.1.4
Nuclear Medicine Image Information Object核医学图象信息对象
1.2.840.10008.5.1.4.1.1.5
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/
转载于:https://blog.51cto.com/2845385/1085042