X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vtk%2FvtkGdcmReader.cxx;h=b9aa0732117d1438b2f337e5138c71cf2fb19a26;hb=f94f85b5578c5a8575f9cadc3702766defd9d707;hp=64750a0da01e20a3dd22a96bf08c670fc8e47c68;hpb=d176ceb6e7a8ef21890696313d0e232ae50e9ad9;p=gdcm.git diff --git a/vtk/vtkGdcmReader.cxx b/vtk/vtkGdcmReader.cxx index 64750a0d..b9aa0732 100644 --- a/vtk/vtkGdcmReader.cxx +++ b/vtk/vtkGdcmReader.cxx @@ -1,4 +1,4 @@ -// $Header: /cvs/public/gdcm/vtk/vtkGdcmReader.cxx,v 1.25 2003/11/05 18:15:41 malaterre Exp $ +// $Header: /cvs/public/gdcm/vtk/vtkGdcmReader.cxx,v 1.28 2003/11/13 10:23:41 malaterre Exp $ // ////////////////////////////////////////////////////////////// // WARNING TODO CLENAME // Actual limitations of this code: @@ -42,19 +42,21 @@ // time... // ////////////////////////////////////////////////////////////// -#include +#include "gdcmFile.h" +#include "gdcmHeaderHelper.h" +#include "vtkGdcmReader.h" + +//#include #include #include #include #include -#include "vtkGdcmReader.h" -#include "gdcm.h" -#include "gdcmHeaderHelper.h" + vtkGdcmReader::vtkGdcmReader() { // Constructor - this->LookupTable = vtkLookupTable::New(); + this->LookupTable = NULL; } //---------------------------------------------------------------------------- @@ -62,7 +64,7 @@ vtkGdcmReader::~vtkGdcmReader() { this->RemoveAllFileName(); this->InternalFileNameList.clear(); - this->LookupTable->Delete(); + if(this->LookupTable) this->LookupTable->Delete(); } //---------------------------------------------------------------------------- @@ -479,8 +481,9 @@ size_t vtkGdcmReader::LoadImageInMemory( { size = GdcmFile.GetImageDataSizeRaw(); Source = (unsigned char*) GdcmFile.GetImageDataRaw(); - unsigned char *Lut = (unsigned char*) GdcmFile.GetLUTRGBA(); - + unsigned char *Lut = GdcmFile.GetLUTRGBA(); + + if(!this->LookupTable) this->LookupTable = vtkLookupTable::New(); this->LookupTable->SetNumberOfTableValues(256); for (int tmp=0; tmp<256; tmp++) {