]> Creatis software - clitk.git/commitdiff
Toward write sequence dicom tags
authortbaudier <thomas.baudier@creatis.insa-lyon.fr>
Thu, 18 May 2017 15:19:54 +0000 (17:19 +0200)
committertbaudier <thomas.baudier@creatis.insa-lyon.fr>
Thu, 18 May 2017 15:19:54 +0000 (17:19 +0200)
tools/clitkGateSimulation2DicomGenericFilter.txx

index 39279ddc7c4e195cbb8a04692faec33eecc41754..f7678c152636ea4416158b58ce5d3aa774c10042 100644 (file)
@@ -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<std::string>(*outputDict, "0054|0011", value );
-  entryId = "0054|0021";
-  value = NumberToString(headNumber);
-  itk::EncapsulateMetaData<std::string>(*outputDict, "0054|0021", value );
+  itk::EncapsulateMetaData<std::string>(*outputDict, "0054|0011", NumberToString(energyNumber));
+  itk::EncapsulateMetaData<std::string>(*outputDict, "0054|0021", NumberToString(headNumber));
+
+  itk::EncapsulateMetaData<std::string>(*sequenceDict, "0054|0053", NumberToString(rotationNumber));
+  //itk::EncapsulateMetaData<std::string>(*outputDict, "0054|0053", NumberToString(rotationNumber));
+  itk::EncapsulateMetaData<typename ReaderSeriesType::DictionaryType>(structureSetRoiSeq, tempString, *sequenceDict);
+  itk::EncapsulateMetaData<typename ReaderSeriesType::DictionaryType>(*outputDict, "0054|0052",structureSetRoiSeq);
 
 outputArray.push_back(outputDict);
   // Output directory and filenames