[vtkusers] show celldata on vtkImagePlaneWidget

Putte, T.B. (Tom) van der tom.vanderputte at tno.nl
Mon May 9 08:12:22 EDT 2011


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