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

Flaviu2 flaviu2 at yahoo.com
Wed May 11 08:19:34 EDT 2016


I have tried this:<raw> // Create a greyscale lookup m_pLUTAxialm_pLUTAxial->SetValueRange(0.0, 1.0); // from black to whitem_pLUTAxial->SetSaturationRange(0.0, 0.0); // no color saturationdouble dRange[2];m_pDICOMReader->Update();m_pDICOMReader->GetOutput()->GetScalarRange(dRange);m_pLUTAxial->SetRange(dRange); // image intensity rangem_pLUTAxial->SetRampToLinear();m_pLUTAxial->Build();m_pColorAxial->SetLookupTable(m_pLUTAxial);</raw>The trouble is that image m_pColorAxial which is vtkMapImageToColors, is still whiter ... I noticed that dRange is between 0 and 3913 ...
I guess that is more than that ... I will try to dig into converting pixels to Hounsfield units ... aIs nybody done this before ?
Flaviu.

 

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

 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 methodsthat can be used, but they involve computing some statistics on theimage 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/20160511/ec1da0a2/attachment.html>


More information about the vtkusers mailing list