+ //Read sequence dicom tag with gdcm
+ gdcm::Reader readerTemplateGDCM;
+ readerTemplateGDCM.SetFileName( fileNames[0].c_str() );
+ readerTemplateGDCM.Read();
+ gdcm::File &fileTemplate = readerTemplateGDCM.GetFile();
+ gdcm::DataSet &dsTemplate = fileTemplate.GetDataSet();
+ const unsigned int ptr_len = 42;
+ char *ptrTemplate = new char[ptr_len];
+ memset(ptrTemplate,0,ptr_len);
+
+ const gdcm::DataElement &referenceRTPlanSq = dsTemplate.GetDataElement(gdcm::Tag(0x300c, 0x02));
+
+ //Create the Dose Grid Scaling data element (ITK 4.13 do not take into account - it works well with ITK 4.5.1)
+ gdcm::DataElement deDoseGridScaling( gdcm::Tag(0x3004,0x0e) );
+ deDoseGridScaling.SetVR( gdcm::VR::DS );
+ deDoseGridScaling.SetByteValue(NumberToString(doseScaling).c_str(), (uint32_t)strlen(NumberToString(doseScaling).c_str()));
+
+ //Copy/Write sequence dicom tag with gdcm
+ gdcm::Reader readerOutputGDCM;
+ readerOutputGDCM.SetFileName( fileNamesOutput[0].c_str() );
+ readerOutputGDCM.Read();
+ gdcm::File &file = readerOutputGDCM.GetFile();
+ gdcm::DataSet &dsOutput = file.GetDataSet();
+
+ dsOutput.Insert(referenceRTPlanSq);
+ dsOutput.Replace(deDoseGridScaling);
+ gdcm::Writer w;
+ w.SetFile( file );
+ w.SetFileName( fileNamesOutput[0].c_str() );
+ w.Write();