[vtkusers] vtkProbeFilter and Output

Frederic Huguet fxh39668 at gsk.com
Tue May 14 06:20:27 EDT 2002


Hi,

I uses a vtkProbeFilter to get color gray levels over a plane through a
marching cubes volume. I try to get the probe output as a structured
grid  with the following code :


vtkCutter* cutSurface = vtkCutter :: New();
  cutSurface->SetInput(lp_Input);
  cutSurface->SetCutFunction(lp_Plane);
  cutSurface->GenerateCutScalarsOff();
  //Set the contour value
  cutSurface->SetValue(0, value);

  vtkStripper* cutStrips = vtkStripper :: New();
  cutStrips->SetInput(cutSurface->GetOutput());
  cutStrips->Update();

  vtkPolyData* cutPoly = vtkPolyData :: New();
  cutPoly->SetPoints(cutStrips->GetOutput()->GetPoints());
  cutPoly->SetPolys(cutStrips->GetOutput()->GetLines());


vtkProbeFilter* probe = vtkProbeFilter::New();
  probe->SetInput(cutPoly);
  probe->SetSource(lp_Input);

  vtkPolyDataMapper* contourMapper = vtkPolyDataMapper::New();
  contourMapper->SetInput(probe->GetPolyDataOutput());
  contourMapper->SetScalarRange(lp_Input->GetScalarRange());

  //Set the filter output
  lp_ProbeFilterOutput = probe->GetStructuredGridOutput();

lp_Input is the result of marching cubes and lp_Plane is a vtkPlane
object.
But lp_ProbeFilterOutput is always NULL and I can't understand why.

Thanks.

Frederic Huguet.





More information about the vtkusers mailing list