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

David Gobbi david.gobbi at gmail.com
Tue May 10 10:15:13 EDT 2016


On Tue, May 10, 2016 at 7:37 AM, Flaviu2 <flaviu2 at yahoo.com> wrote:
>
> Very useful your comments ! I have learned something here.
>
> The line
>
> > table->SetRange(0, 2047)

Try something like the code below, it is simple but it often works fine.
If it doesn't work for your image, there are more sophisticated methods
that can be used, but they involve computing some statistics on the
image and using the metadata to convert pixels to Hounsfield units.

m_pDICOMReader->Update();
double range[2];
m_pDICOMReader->GetOutput()->GetScalarRange(range);
table->SetRange(range);

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


More information about the vtkusers mailing list