[vtkusers] show celldata on vtkImagePlaneWidget

Dean Inglis dean.inglis at camris.ca
Wed May 11 08:36:49 EDT 2011


Hi Tom,

you are doing the right thing by converting cell data to point data in this 
case.  You could try
setting the interpolation to nearest neighbor and turning interpolation off:

iPlaneWidgetX.SetResliceInterpolateToNearestNeighbour();
iPlaneWidgetX.TextureInterpolateOff();

Dean

Hi,

Using Activiz, I'm trying to display imagedata (CELLDATA, not pointdata) on 
a vtkImagePlaneWidget, just as simple gridcells like this: 
(https://picasaweb.google.com/lh/photo/SYdgbXrXm-4SRfVHCufBLfK3gj7O8KOK36SDLJLIWK8?feat=directlink) 
but it doesn't show anything. What I try is this:

  vtkXMLImageDataReader reader = vtkXMLImageDataReader.New();
  reader.SetFileName(imgFileNameTotal);
  reader.SetCellArrayStatus("CellData", 1); //only celldata
  reader.SetPointArrayStatus("Scalars_", 0); //no pointdata
  reader.Update();

  //Create ImagePlaneWidget
  vtkImagePlaneWidget iPlaneWidgetX = new vtkImagePlaneWidget();
  iPlaneWidgetX.SetInput(reader.GetOutput());
  iPlaneWidgetX.SetPlaneOrientationToXAxes();
  iPlaneWidgetX.SetSliceIndex(10);

  //Rendering, Camera & interactors
  vtkRenderer ren1 = 
renderWindowControl1.RenderWindow.GetRenderers().GetFirstRenderer();
  vtkRenderWindow renWin = renderWindowControl1.RenderWindow;
  vtkRenderWindowInteractor interActor = renWin.GetInteractor();

  vtkInteractorStyleTrackballCamera style = new
  vtkInteractorStyleTrackballCamera();

  interActor.SetInteractorStyle(style);
  iPlaneWidgetX.SetInteractor(interActor);
  iPlaneWidgetX.On();

  renWin.SetSize(500, 500);
  renWin.Render();

However, when I add this

  vtkCellDataToPointData pointData = new vtkCellDataToPointData();
  pointData.SetInput( reader.GetOutput());

and change the iPlaneWidget's input:
  iPlaneWidgetX.SetInput(pointData.GetOutput());

It does show the data, but as interpolated pointdata, which is not what I 
want.

Is the imagePlaneWidget unable to display celldata, and should I tackle this 
a different way?

Cheers,
Tom
This e-mail and its contents are subject to the DISCLAIMER at 
http://www.tno.nl/emaildisclaimer





More information about the vtkusers mailing list