[vtkusers] Problem with VtkScalars
xiong fei
xfpku at yahoo.com.sg
Wed Jun 13 23:27:23 EDT 2001
Hello, all
I am really confused about the following problem.
Is there a convenient way to map scalar into color for
an isosurface extraction? Thanks for any advice.
BTW: what's the scalar value going to be after
Gaussian splatting? Is there any way to get the new
scalar?
Best regards
Xiong Fei, Peter
--- xiong fei <xfpku at yahoo.com.sg> wrote: > 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 point 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 problem 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/
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - Send dad a Father's Day Card!
http://greetings.yahoo.com.sg/
More information about the vtkusers
mailing list