From 208af9d6c03679fd7eb2045badc0f5ee8e263aff Mon Sep 17 00:00:00 2001 From: regrain Date: Mon, 2 Jun 2003 07:42:17 +0000 Subject: [PATCH] * vtk/vtkGdcmReader[cxx|h] : makes correct code to remove conflicts between standard library (std) and vtk library (problems are found under Windows... thanks Windows !) -- BeNours --- ChangeLog | 5 +++++ vtk/vtkGdcmReader.cxx | 30 +++++++++++++++--------------- vtk/vtkGdcmReader.h | 4 ++-- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index a1ba8651..50ed98af 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-06-02 Benoit Regrain + * vtk/vtkGdcmReader[cxx|h] : makes correct code to remove conflicts + between standard library (std) and vtk library (problems are found + under Windows... thanks Windows !) + 2003-05-30 Eric Boix * vtk/vtkGdcmReader[cxx|h] should now be volume aware (read ready for debug stage). diff --git a/vtk/vtkGdcmReader.cxx b/vtk/vtkGdcmReader.cxx index 7c1d8c03..9f260a69 100644 --- a/vtk/vtkGdcmReader.cxx +++ b/vtk/vtkGdcmReader.cxx @@ -1,4 +1,4 @@ -// $Header: /cvs/public/gdcm/vtk/vtkGdcmReader.cxx,v 1.7 2003/05/30 18:48:36 frog Exp $ +// $Header: /cvs/public/gdcm/vtk/vtkGdcmReader.cxx,v 1.8 2003/06/02 07:42:17 regrain Exp $ //CLEANME#include #include #include @@ -108,8 +108,8 @@ bool vtkGdcmReader::CheckFileCoherence() fp = fopen(FileName->c_str(),"rb"); if (!fp) { - vtkErrorMacro("Unable to open file " << *FileName); - vtkErrorMacro("Removing this file from readed files " << *FileName); + vtkErrorMacro("Unable to open file " << *FileName->c_str()); + vtkErrorMacro("Removing this file from readed files " << *FileName->c_str()); FileNameList.remove(*FileName); continue; } @@ -119,8 +119,8 @@ bool vtkGdcmReader::CheckFileCoherence() gdcmHeader GdcmHeader(FileName->c_str()); if (!GdcmHeader.IsReadable()) { - vtkErrorMacro("Gdcm cannot parse file " << *FileName); - vtkErrorMacro("Removing this file from readed files " << *FileName); + vtkErrorMacro("Gdcm cannot parse file " << *FileName->c_str()); + vtkErrorMacro("Removing this file from readed files " << *FileName->c_str()); FileNameList.remove(*FileName); continue; } @@ -138,12 +138,12 @@ bool vtkGdcmReader::CheckFileCoherence() || ( type != ReferenceType ) ) { vtkErrorMacro("This file is not coherent with previous ones" - << *FileName); - vtkErrorMacro("Removing this file from readed files " << *FileName); + << *FileName->c_str()); + vtkErrorMacro("Removing this file from readed files " << *FileName->c_str()); FileNameList.remove(*FileName); continue; } else { - vtkDebugMacro("File is coherent with previous ones" << *FileName); + vtkDebugMacro("File is coherent with previous ones" << *FileName->c_str()); } } else { // This file shall be the reference: @@ -152,7 +152,7 @@ bool vtkGdcmReader::CheckFileCoherence() ReferenceNY = NY; ReferenceNZ = NZ; ReferenceType = type; - vtkDebugMacro("This file taken as coherence reference:" << *FileName); + vtkDebugMacro("This file taken as coherence reference:" << *FileName->c_str()); } } // End of loop on FileName @@ -188,7 +188,7 @@ void vtkGdcmReader::ExecuteInformation() vtkErrorMacro("File set is not coherent. Exiting..."); return; } - string ReferenceFile = this->FileNameList.front(); + std::string ReferenceFile = this->FileNameList.front(); gdcmHeader GdcmHeader(ReferenceFile.c_str()); int NX = GdcmHeader.GetXSize(); @@ -212,7 +212,7 @@ void vtkGdcmReader::ExecuteInformation() (this->DataVOI[5] >= NZ)) { vtkWarningMacro("The requested VOI is larger than the file's (" - << ReferenceFile << ") extent "); + << ReferenceFile.c_str() << ") extent "); this->DataVOI[0] = 0; this->DataVOI[1] = NX - 1; this->DataVOI[2] = 0; @@ -272,7 +272,7 @@ void vtkGdcmReader::ExecuteInformation() } else { - vtkErrorMacro("Bad File Type " << ReferenceFile + vtkErrorMacro("Bad File Type " << ReferenceFile.c_str() << "Type " << type.c_str()); return; } @@ -281,7 +281,7 @@ void vtkGdcmReader::ExecuteInformation() } //---------------------------------------------------------------------------- -void vtkGdcmReader::LoadImageInMemory(string FileName, +void vtkGdcmReader::LoadImageInMemory(std::string FileName, unsigned char * Dest, size_t size) { @@ -341,7 +341,7 @@ void vtkGdcmReader::ExecuteData(vtkDataObject *output) // First check the coherence between the DataExtent and the // size of the pixel data as annouced by gdcm (looks a bit paranoid) // for the reference file (i.e. the first one in the list): - string ReferenceFile = this->FileNameList.front(); + std::string ReferenceFile = this->FileNameList.front(); gdcmFile GdcmFile(ReferenceFile.c_str()); int NumColumns = this->DataExtent[1] - this->DataExtent[0] + 1; int NumLines = this->DataExtent[3] - this->DataExtent[2] + 1; @@ -388,6 +388,6 @@ void vtkGdcmReader::PrintSelf(ostream& os, vtkIndent indent) FileName != FileNameList.end(); ++FileName) { - os << nextIndent << *FileName << endl ; + os << nextIndent << *FileName->c_str() << endl ; } } diff --git a/vtk/vtkGdcmReader.h b/vtk/vtkGdcmReader.h index 418e69b9..27651a94 100644 --- a/vtk/vtkGdcmReader.h +++ b/vtk/vtkGdcmReader.h @@ -1,4 +1,4 @@ -// $Header: /cvs/public/gdcm/vtk/vtkGdcmReader.h,v 1.3 2003/05/30 18:48:36 frog Exp $ +// $Header: /cvs/public/gdcm/vtk/vtkGdcmReader.h,v 1.4 2003/06/02 07:42:17 regrain Exp $ #ifndef __vtkGdcmReader_h #define __vtkGdcmReader_h @@ -27,7 +27,7 @@ private: // or volume. The order in the list shall be the order of the images. //BTX std::list FileNameList; - void LoadImageInMemory(string FileName, unsigned char * Dest, size_t size); + void LoadImageInMemory(std::string FileName, unsigned char * Dest, size_t size); //ETX }; #endif -- 2.45.1