From 8efd908ab5df098bb1a2dc8937dd3f92ad6d5154 Mon Sep 17 00:00:00 2001 From: malaterre Date: Fri, 25 Feb 2005 19:54:06 +0000 Subject: [PATCH] ENH: I believe we have to enter floating point values with fixed number instead of using default stryule of ostringstream --- vtk/vtkGdcmWriter.cxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/vtk/vtkGdcmWriter.cxx b/vtk/vtkGdcmWriter.cxx index 4d016878..478db385 100644 --- a/vtk/vtkGdcmWriter.cxx +++ b/vtk/vtkGdcmWriter.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: vtkGdcmWriter.cxx,v $ Language: C++ - Date: $Date: 2005/01/28 10:07:35 $ - Version: $Revision: 1.16 $ + Date: $Date: 2005/02/25 19:54:06 $ + Version: $Revision: 1.17 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -27,7 +27,7 @@ #include #include -vtkCxxRevisionMacro(vtkGdcmWriter, "$Revision: 1.16 $"); +vtkCxxRevisionMacro(vtkGdcmWriter, "$Revision: 1.17 $"); vtkStandardNewMacro(vtkGdcmWriter); //----------------------------------------------------------------------------- @@ -213,6 +213,9 @@ void SetImageInformation(gdcm::FileHelper *file,vtkImageData *image) double *sp = image->GetSpacing(); str.str(""); + // We are about to enter floating point value. By default ostringstream are smart and don't do fixed point + // thus forcing to fixed point value + str.setf( std::ios::fixed ); str << sp[0] << "\\" << sp[1]; file->InsertValEntry(str.str(),0x0028,0x0030); // Pixel Spacing str.str(""); @@ -225,6 +228,7 @@ void SetImageInformation(gdcm::FileHelper *file,vtkImageData *image) str.str(""); str << org[0] << "\\" << org[1] << "\\" << org[2]; file->InsertValEntry(str.str(),0x0020,0x0032); // Image Position Patient + str.unsetf( std::ios::fixed ); //done with floating point values // Window / Level double *rng=image->GetScalarRange(); -- 2.45.1