From: tbaudier Date: Thu, 18 May 2017 15:19:54 +0000 (+0200) Subject: Toward write sequence dicom tags X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=97d71a8a59a34261e4c0cf1c62dbefc37ccfd355;p=clitk.git Toward write sequence dicom tags --- 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