[vtkusers] pb with recent changes to vtkOpenGLImageActor

Dean Inglis dean.inglis at camris.ca
Mon Sep 15 17:27:44 EDT 2003


Hi,

in my app I use the 3D Euclidiean distance transform (3DDT) filter
on 2D images of a bone cross-section.  The app
allows switching between the basic black and white
segmented and the 3DDT data that is mapped through a
vtkImageMapToColors filter.  The resulting 3DDT image is colored via a
vtkLookupTable.  With the latest VTK cvs checkout I no longer
have colored images: they appear as though the lut has
been set to a truncated gray scale range, and switching inputs to the
image actor results in a shear distorted image of the
bone cross section.  Checkouts of vtkOpenGLImageActor.* prior to
David Gobbi's changes resolve the pbs.  There is also a
vtkScalarBarWidget in the renderer that shows its color
distribution correctly. Here is the code snippet where the
inputs to the image actor are switched...

void __fastcall TForm1::OutputRadioGrpClick(TObject *Sender)
{
  if(!m_dataLoaded || !m_processed) { return; }

  m_sba->Off();  // scalar bar widget
  m_imageActor2->VisibilityOff();
  bool showImage = true;

  switch (OutputRadioGrp->ItemIndex)
    {
    case 0: m_imageActor2->SetInput(m_segment); break; // set the input as
basic binary image data
    case 1: this->InitThicknessMapColorTable(m_esqrt1); // set the lut of
vtkImageMapToColors
                                                        // based on scalar
range of 3DDT data
            m_imageActor2->SetInput(m_esqrtMap->GetOutput()); // pass
vtkImageMapToColors output
                                                        // to the image
actor
            m_sba->On(); // turn on the widget
            break;
    case 2: this->InitThicknessMapColorTable(m_esqrt2);
            m_imageActor2->SetInput(m_esqrtMap->GetOutput());
            m_sba->On();
            break;
    case 3: showImage = false;
            break;
    default:m_imageActor2->SetInput(m_segment); break;
    }

  if(showImage)
    {

m_imageActor2->SetDisplayExtent(m_imageActor2->GetInput()->GetUpdateExtent()
); // in case a new
                                                       // different sized
image was loaded
    m_imageActor2->VisibilityOn();
    }

  RenderWindow2->Invalidate(); // refresh
}

Am I missing something here?  This occurs on a Win2K system:
 1.9 GHz Mobile Intel P4, 1Gb RAM, NVIDIA Quadro4 500 GoGL

Dean





More information about the vtkusers mailing list