vtkGdcmReader::vtkGdcmReader()
{
this->LookupTable = NULL;
+ this->AllowLookupTable = 0;
}
vtkGdcmReader::~vtkGdcmReader()
this->ImageType = type;
this->PixelSize = GdcmHeader.GetPixelSize();
- if( GdcmHeader.HasLUT() && false )
+ if( GdcmHeader.HasLUT() && this->AllowLookupTable )
{
+ // I could raise an error is AllowLookupTable is on and HasLUT() off
this->NumComponents = GdcmHeader.GetNumberOfScalarComponentsRaw();
}
else
unsigned char * Source;
- if( GdcmFile.GetHeader()->HasLUT() && false )
+ if( GdcmFile.GetHeader()->HasLUT() && this->AllowLookupTable )
{
size = GdcmFile.GetImageDataSizeRaw();
Source = (unsigned char*) GdcmFile.GetImageDataRaw();
virtual void RemoveAllFileName(void);
virtual void AddFileName(const char* name);
virtual void SetFileName(const char *name);
+
+ // Description:
+ // If this flag is set and the DICOM reader encounters a dicom file with
+ // lookup table the data will be kept as unsigned chars and a lookuptable
+ // will be exported and accessible through GetLookupTable()
+ vtkSetMacro(AllowLookupTable,int);
+ vtkGetMacro(AllowLookupTable,int);
+ vtkBooleanMacro(AllowLookupTable,int);
+
vtkGetObjectMacro(LookupTable,vtkLookupTable);
protected:
// Variables
vtkLookupTable *LookupTable;
vtkTimeStamp fileTime;
+ int AllowLookupTable;
//BTX
// Number of columns of the image/volume to be loaded
return 0;
vtkGdcmReader *reader = vtkGdcmReader::New();
+ reader->AllowLookupTableOff();
if( argc == 2 )
reader->SetFileName( argv[1] );
vtkImageViewer2 *viewer = vtkImageViewer2::New();
-/* if( reader->GetLookupTable() )
+ if( reader->GetLookupTable() )
{
//convert to color:
vtkImageMapToColors *map = vtkImageMapToColors::New ();
viewer->SetInput ( map->GetOutput() );
map->Delete();
}
- else*/
-
+ else
{
viewer->SetInput ( reader->GetOutput() );
}