diff --git a/Core/Code/IO/mitkDicomSeriesReader.txx b/Core/Code/IO/mitkDicomSeriesReader.txx index 7a7d3b4..7d5478a 100644 --- a/Core/Code/IO/mitkDicomSeriesReader.txx +++ b/Core/Code/IO/mitkDicomSeriesReader.txx @@ -82,6 +82,24 @@ void DicomSeriesReader::LoadDicom(const StringContainer &filenames, DataNode &no image->InitializeByItk(reader->GetOutput(), 1, volume_count); image->SetImportVolume(reader->GetOutput()->GetBufferPointer(), 0u); + MITK_DEBUG << "Copy MetaDataDictionary..."; + const itk::MetaDataDictionary& dict = io->GetMetaDataDictionary(); + + for (itk::MetaDataDictionary::ConstIterator key = dict.Begin(); key != dict.End(); ++key) + { + const itk::MetaDataObjectBase* value = key->second; + std::stringstream ss; + if (value) + { + value->Print(ss); + } + MITK_DEBUG << key->first << ":" << key->second; + + node.SetProperty( key->first.c_str() , mitk::StringProperty::New( ss.str() ) ); + + } + + MITK_DEBUG << "Volume dimension: [" << image->GetDimension(0) << ", " << image->GetDimension(1) << ", " << image->GetDimension(2) << ", " @@ -153,7 +171,12 @@ Image::Pointer DicomSeriesReader::LoadDICOMByITK( const StringContainer& filenam reader->SetFileNames(filenames); reader->Update(); - image->InitializeByItk(reader->GetOutput()); + + MITK_INFO << "Copy MetaDataDictionary..."; + const itk::MetaDataDictionary& dict = io->GetMetaDataDictionary(); + dict.Print(std::cout); + + image->InitializeByItk(reader->GetOutput()); // TODO read out here. image->SetImportVolume(reader->GetOutput()->GetBufferPointer());