[vtkusers] Cannot make unstructured points isosurface

Chris Scharver scharver at evl.uic.edu
Tue Nov 5 23:36:30 EST 2002


At 6:26 PM +0530 11/02/2002, Prabhu Ramachandran wrote:
>From what I understand you are simply assigning a bunch of points as
>vertices into an Unstructured grid.  This will not result in a volume.
>All your data will contain is a bunch of points.  Hence contouring the
>data will not produce anything.  If you need to contour the data you
>need to specify volumes which means you need to know the topology.  If
>that is hard to get in your case try investigating these classes:
>
> vtkShepardMethod
> vtkGaussianSplatter
> vtkProbeFilter

The vtkShepardMethod did the trick! It did exactly what I needed by determining the topology based on the points read from the dataset. It resampled onto a grid with different bounds than the original dataset, but that should be okay. Thanks tremendously!

Now that I have the surface, I still have to determine why resulting contours are always red... I only have two contours, but their colors should be based on the scalar values used to make the surfaces. I tried setting a color lookup table, but I always end up with the same color for both surfaces.

  vtkContourFilter* iso = vtkContourFilter::New();
  iso->SetInput(shepard->GetOutput());
  iso->SetValue(0, -0.006f);
  iso->SetValue(1, 0.002f);
  iso->ComputeScalarsOn();
  iso->UseScalarTree();
  vtkLookupTable* lut = vtkLookupTable::New();
  lut->SetNumberOfColors(256);
  lut->SetTableRange(shepard->GetOutput()->GetScalarRange());
  lut->Build();
  vtkPolyDataMapper* isoMapper = vtkPolyDataMapper::New();
  isoMapper->SetInput(iso->GetOutput());
  isoMapper->SetLookupTable(lut);
  isoMapper->SetColorModeToMapScalars();
  isoMapper->SetScalarRange(shepard->GetOutput()->GetScalarRange());
  isoMapper->ScalarVisibilityOn();
  vtkActor* isoActor = vtkActor::New();
  isoActor->SetMapper(isoMapper);
  isoActor->GetProperty()->SetOpacity(0.5f);

The scalar data is obviously there since the contours are built correctly. The scalars are 'small', but shouldn't the SetTableRange() and SetScalarRange() methods account for that?

Chris
--
Chris Scharver
Electronic Visualization Laboratory
The University of Illinois at Chicago
Ph: 312-996-3002   FAX: 312-413-7585
<http://www.evl.uic.edu/scharver/>



More information about the vtkusers mailing list