[vtkusers] Re: trouble setting vtkLookupTable at run time...

Luca Pamparana deluded.soul at gmail.com
Mon Sep 4 13:38:00 EDT 2006


Never mind... It was the range that needed to be fixed...
Thanks,
Luca

On 9/4/06, Luca Pamparana <deluded.soul at gmail.com> wrote:
>
> Hi everyone,
>
> Today is the day to bang my head against a LUT...
>
> I have a problem when I try to set a look up table at run time...
>
> So, my application is initialized with the following pipeline:
>
> // Slicer------------>ImageMapper
>
> this->m_slicer->SetInput(in);
> this->m_imageMapper->SetInput(this->m_slicer->GetOutput());
>
> double * range = in->GetScalarRange();
> if (range)
> {
>        m_colorWindowLowerBound = range[0];
>        m_colorWindowUpperBound = range[1];
>        this->SetColorWindow(range[1] - range[0]);
>        this->SetColorLevel(0.5 * (range[1] + range[0]));
> }
>
> Now, I receive an event to change the color map, so I do the following:
>
> // The table has been built correctly and everything... I set the range
> double * range = in->GetScalarRange();
>  if (range)
>  {
>         table->SetTableRange(range[0], range[1]);
>         m_imapToColors->SetLookupTable(table);
>         m_imapToColors->Update();
>  }
>
>
> Now, I rewire my pipeline
>
>
> this->m_imapToColors->SetInput(0);
> this->m_imageMapper->SetInput(0);
>
> // Slicer----------> vtkImageMapToColors------------------>Image mapper
>
> this->m_imapToColors->SetInput(this->m_slicer->GetOutput());
> this->m_imapToColors->Update();
> this->m_imageMapper->SetInput(this->m_imapToColors->GetOutput());
> Render();
>
>
> All I see here is a black screen........
>
> Any help would get me out of work. Almost 7 pm here...
>
> Thanks,
> Luca
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060904/e8648f7c/attachment.htm>


More information about the vtkusers mailing list