[vtkusers] Problem with VtkScalars

xiong fei xfpku at yahoo.com.sg
Tue Jun 12 23:38:50 EDT 2001


Hi, Dear vtkusers


    Sorry to bother you again. But I met a trouble in
using vtkScalars. As what was described before, my
data is a 3D points series with scalars. Now I try to
generate an isosurface by using vtkGaussianSplatter
and vtkContourFilter, the source code is blew:
---------------------------------------------------
    // construct pipeline for original population
  vtkGaussianSplatter *popSplatter =
vtkGaussianSplatter::New();
    popSplatter->SetInput(dataSet);
    popSplatter->SetSampleDimensions(50,50,50);
    popSplatter->SetRadius(0.03);
    popSplatter->SetEccentricity(2);
    popSplatter->ScalarWarpingOff();

  vtkContourFilter *popSurface =
vtkContourFilter::New();
    popSurface->SetInput(popSplatter->GetOutput());
    popSurface->SetValue(0,0.01);

  printf("ok\n");
  vtkScalars *popScalar = vtkScalars::New();
  popScalar =
popSurface->GetOutput()->GetPointData()->GetScalars();
  printf("in progress\n");

  float Scalarrange[2];

  popScalar->GetRange(Scalarrange);
  printf("scalar range \n");
  
  Minscalar = Scalarrange[0];
  Maxscalar = Scalarrange[1];
  printf("Good\n");
-----------------------------------------------------
Since the gaussian distribution has changed scalar
values, so if i will make a color mapping on the
surface, it requires "transformed" scalars. Thus I use
vtkScalars to get the scalar values and choose the
GetRange method to set a range for lookuptable. But
the program is: when I run the program, it reports an
error:  Segmentation fault (core dumped). I set
breakpoints and find that the error occurs when
popScalar->GetRange(Scalarrange); be excuted. Can
someone tell me the reason? Thank you very much


Best regards
Xiong Fei, Peter

__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - Send dad a Father's Day Card!
http://greetings.yahoo.com.sg/




More information about the vtkusers mailing list