-// $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:
// time...
// //////////////////////////////////////////////////////////////
-#include <stdio.h>
+#include "gdcmFile.h"
+#include "gdcmHeaderHelper.h"
+#include "vtkGdcmReader.h"
+
+//#include <stdio.h>
#include <vtkObjectFactory.h>
#include <vtkImageData.h>
#include <vtkPointData.h>
#include <vtkLookupTable.h>
-#include "vtkGdcmReader.h"
-#include "gdcm.h"
-#include "gdcmHeaderHelper.h"
+
vtkGdcmReader::vtkGdcmReader()
{
// Constructor
- this->LookupTable = vtkLookupTable::New();
+ this->LookupTable = NULL;
}
//----------------------------------------------------------------------------
{
this->RemoveAllFileName();
this->InternalFileNameList.clear();
- this->LookupTable->Delete();
+ if(this->LookupTable) this->LookupTable->Delete();
}
//----------------------------------------------------------------------------
{
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++)
{