From 97d71a8a59a34261e4c0cf1c62dbefc37ccfd355 Mon Sep 17 00:00:00 2001 From: tbaudier Date: Thu, 18 May 2017 17:19:54 +0200 Subject: [PATCH] Toward write sequence dicom tags --- ...clitkGateSimulation2DicomGenericFilter.txx | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/tools/clitkGateSimulation2DicomGenericFilter.txx b/tools/clitkGateSimulation2DicomGenericFilter.txx index 39279dd..f7678c1 100644 --- a/tools/clitkGateSimulation2DicomGenericFilter.txx +++ b/tools/clitkGateSimulation2DicomGenericFilter.txx @@ -282,18 +282,26 @@ rotationNumber = 6; // update output dicom keys/tags + // string for distinguishing items inside sequence: + const std::string ITEM_ENCAPSULATE_STRING("DICOM_ITEM_ENCAPSULATE"); + std::string tempString = ITEM_ENCAPSULATE_STRING + "01"; typename ReaderSeriesType::DictionaryRawPointer inputDict = (*(readerSeries->GetMetaDataDictionaryArray()))[0]; typename ReaderSeriesType::DictionaryArrayType outputArray; typename ReaderSeriesType::DictionaryRawPointer outputDict = new typename ReaderSeriesType::DictionaryType; + typename ReaderSeriesType::DictionaryRawPointer sequenceDict = new typename ReaderSeriesType::DictionaryType; + // Dictionary for encapsulating the sequences. + itk::GDCMImageIO::Pointer gdcmIOStructureSetRoi = itk::GDCMImageIO::New(); + typename ReaderSeriesType::DictionaryType &structureSetRoiSeq = gdcmIOStructureSetRoi->GetMetaDataDictionary(); CopyDictionary (*inputDict, *outputDict); + //CopyDictionary (*inputDict, *sequenceDict); - std::string entryId, value; - entryId = "0054|0011"; - value = NumberToString(energyNumber); - itk::EncapsulateMetaData(*outputDict, "0054|0011", value ); - entryId = "0054|0021"; - value = NumberToString(headNumber); - itk::EncapsulateMetaData(*outputDict, "0054|0021", value ); + itk::EncapsulateMetaData(*outputDict, "0054|0011", NumberToString(energyNumber)); + itk::EncapsulateMetaData(*outputDict, "0054|0021", NumberToString(headNumber)); + + itk::EncapsulateMetaData(*sequenceDict, "0054|0053", NumberToString(rotationNumber)); + //itk::EncapsulateMetaData(*outputDict, "0054|0053", NumberToString(rotationNumber)); + itk::EncapsulateMetaData(structureSetRoiSeq, tempString, *sequenceDict); + itk::EncapsulateMetaData(*outputDict, "0054|0052",structureSetRoiSeq); outputArray.push_back(outputDict); // Output directory and filenames -- 2.47.1