[vtkusers] show celldata on vtkImagePlaneWidget

Putte, T.B. (Tom) van der tom.vanderputte at tno.nl
Wed May 11 09:05:52 EDT 2011


Hi Dean,

Thanks, I tried this, but the problem is that I'm trying to display discrete scalar data. So converting cell data to points will actually change values (throught the vtkCellDataToPointData interpolation), as well as shift the image 0.5 x spacing distance in all directions.

Suppose I would really want to display the celldata as accurately as possible on an intersection plane (perhaps even with the (intersection of the) mesh displayed to make the boundaries between cells more clear), is it even possible to use the ImagePlaneWidget? Or should I use the implicit plane widget? Or make something entirely from scratch?

Thanks again,
Tom


-----Original Message-----
From: Dean Inglis [mailto:dean.inglis at camris.ca] 
Sent: woensdag 11 mei 2011 14:37
To: vtkusers at vtk.org
Cc: Putte, T.B. (Tom) van der
Subject: Re: [vtkusers] show celldata on vtkImagePlaneWidget

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


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




More information about the vtkusers mailing list