From c8b7a0550e22bf11fd40320d3dddc56f11ea7a8c Mon Sep 17 00:00:00 2001 From: tbaudier <thomas.baudier@creatis.insa-lyon.fr> Date: Thu, 25 Jan 2018 13:03:53 +0100 Subject: [PATCH] Debug verbosity in clitkImage2DicomDose --- tools/clitkImage2DicomDoseGenericFilter.txx | 67 ++++++++++++--------- 1 file changed, 37 insertions(+), 30 deletions(-) diff --git a/tools/clitkImage2DicomDoseGenericFilter.txx b/tools/clitkImage2DicomDoseGenericFilter.txx index 4b865f6..a53b541 100644 --- a/tools/clitkImage2DicomDoseGenericFilter.txx +++ b/tools/clitkImage2DicomDoseGenericFilter.txx @@ -292,78 +292,85 @@ std::cout<<"\nECRITURE DU FICHIER DICOM !"<<std::endl; //gdcm::ValEntry *b; std::string Value(""); +std::stringstream strs; gdcm::DataElement DE; DE = gdcm::Tag(0x20, 0x32); -Value = origin[0]; -Value += "\\"; -Value += origin[1]; -Value += "\\"; -Value += origin[2]; +strs << origin[0]; +strs << "\\"; +strs << origin[1]; +strs << "\\"; +strs << origin[2]; +Value = strs.str(); DE.SetVR( gdcm::VR::US ); DE.SetByteValue(Value.c_str(), 1); ds.Insert(DE); -DD(Value); -Value = ""; +DD(Value.c_str()); +strs.str(""); DE = gdcm::Tag(0x28, 0x11); -Value = NbCols; +strs << NbCols; +Value = strs.str(); DE.SetVR( gdcm::VR::US ); DE.SetByteValue(Value.c_str(), 1); ds.Insert(DE); -DD(Value); -Value = ""; +DD(Value.c_str()); +strs.str(""); DE = gdcm::Tag(0x28, 0x10); -Value = NbRows; +strs << NbRows; +Value = strs.str(); DE.SetVR( gdcm::VR::US ); DE.SetByteValue(Value.c_str(), 1); ds.Insert(DE); -DD(Value); -Value = ""; +DD(Value.c_str()); +strs.str(""); DE = gdcm::Tag(0x28, 0x08); -Value = NbFrames; +strs << NbFrames; +Value = strs.str(); DE.SetVR( gdcm::VR::US ); DE.SetByteValue(Value.c_str(), 1); ds.Insert(DE); -DD(Value); -Value = ""; +DD(Value.c_str()); +strs.str(""); DE = gdcm::Tag(0x3004, 0x0e); -Value = doseScaling; +strs << doseScaling; +Value = strs.str(); DE.SetVR( gdcm::VR::US ); DE.SetByteValue(Value.c_str(), 1); ds.Insert(DE); -DD(Value); -Value = ""; +DD(Value.c_str()); +strs.str(""); DE = gdcm::Tag(0x28, 0x30); -Value = Spacing[0]; -Value += "\\"; -Value += Spacing[1]; +strs << Spacing[0]; +strs << "\\"; +strs << Spacing[1]; +Value = strs.str(); DE.SetVR( gdcm::VR::US ); DE.SetByteValue(Value.c_str(), 1); ds.Insert(DE); -DD(Value); -Value = ""; +DD(Value.c_str()); +strs.str(""); DE = gdcm::Tag(0x3004, 0x000c); float offset = 0.; -Value = offset; +strs << offset; for (int i=1; i<NbFrames ; i++){ offset+=Spacing[2]; - Value += "\\"; - Value += offset; + strs << "\\"; + strs << offset; } - +Value = strs.str(); DE.SetVR( gdcm::VR::US ); DE.SetByteValue(Value.c_str(), 1); ds.Insert(DE); -DD(Value); -Value = ""; +DD(Value.c_str()); +strs.str(""); /* // NbCols -- 2.49.0