[vtkusers] ImagePlaneWidget - Wrong Colors!

Istvan Matis i_matis at yahoo.de
Sun Jul 4 06:01:45 EDT 2004


Hello everybody!

I am using the Test of ImagePlaneWidget (from VTK\Hybrid\Testing\Cxx\ImagePlaneWidget.cxx) and in the test works fine. 
I am using the same code in my app, but there I obtain only 2 colors, black where is 0 in the image, white where is not 0 in the image.
I tried several lookup tables and the results were the same.

Can somebody help me? What did I wrong?

Here is the code:

 for (int i=0;i<3;i++){ //3=nrPlanes
  if (!m_bViewReslice) {
   vImagePlaneWidget[i]->Off(); 
   continue;
  }
  vImagePlaneWidget[i]->SetInteractor( aWin32RenderWindowInteractor);
  vImagePlaneWidget[i]->SetPicker(aCellPicker);
  //vImagePlaneWidget[i]->RestrictPlaneToVolumeOn();
  vImagePlaneWidget[i]->GetPlaneProperty()->SetColor(1,1,0);
  vImagePlaneWidget[i]->SetTexturePlaneProperty(aProperty);
  vImagePlaneWidget[i]->TextureInterpolateOn();
  vImagePlaneWidget[i]->SetResliceInterpolateToLinear();
  vImagePlaneWidget[i]->SetInput((vtkDataSet *)v16->GetOutput());   //in the test works without cating! why?
  vImagePlaneWidget[i]->SetLookupTable(vLookupTable[i]); //same if I comment it out

  vImagePlaneWidget[i]->DisplayTextOn();
  vImagePlaneWidget[i]->UpdatePlacement();
  vImagePlaneWidget[i]->On(); 
  //vImagePlaneWidget[i]->InteractionOff();
  vImagePlaneWidget[i]->InteractionOn();
 }
 vImagePlaneWidget[0]->SetPlaneOrientationToXAxes();
 vImagePlaneWidget[1]->SetPlaneOrientationToYAxes();
 vImagePlaneWidget[2]->SetPlaneOrientationToZAxes();
 for (i=0;i<3;i++)
  vImagePlaneWidget[i]->SetSlicePosition(orig[i]);      //orig[3] is the center of the volume
 

Thanks in advance.
Istvan Matis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040704/0bf0c41e/attachment.htm>


More information about the vtkusers mailing list