[vtkusers] No LookupTable was set but input data is not VTK_UNSIGNED_CHAR

Flaviu2 flaviu2 at yahoo.com
Tue May 10 09:37:06 EDT 2016


Very useful your comments ! I have learned something here.
The line 
> table->SetRange(0, 2047)
is whole thing: I have removed lookup table from vtkMapImageToColors because I didn't found the proper value to setup lookup range, for CT images ... 
Without lookup table I have the original window/level on my renderer, but, I get those warnings ... with lookup table, and with [0, 2047] range, I have whiter images (and believe me, I had tried a lot of values).
How can I get out of this trouble ?
Flaviu. 

    On Tuesday, May 10, 2016 3:20 PM, David Gobbi <david.gobbi at gmail.com> wrote:
 

 On Tue, May 10, 2016 at 5:53 AM, Flaviu2 via vtkusers <vtkusers at vtk.org> wrote:

> My question is, it is OK to give up of lookup table ?
If the input is 16-bit data (like most DICOM) then it needs a lookup table.
> And how to setup VTK_UNSIGNED_CHAR at my input image data ?
Don't!  If the DICOM file is 16-bit data, then use 16-bit data in VTK.
> I have tried this:
>
> m_pDICOMReader->GetOutput()->AllocateScalars(VTK_UNSIGNED_CHAR, 3);
This will not work.  The reader cannot read a 16-bit file into an 8-bit output.
> Not working .... can you help me, please ?

Create a vtkLookupTable for vtkImageMapToColors.
table->SetValueRange(0.0, 1.0);table->SetSaturationRange(0.0, 0.0);table->SetRampToLinear();table->Build();
Also, use table->SetRange(min, max) to tell the lookup table the min and maxvalues in the image, e.g. something like table->SetRange(0, 2047).
Cheers, - David


  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160510/2e99ca6d/attachment.html>


More information about the vtkusers mailing list