[vtkusers] please help on ploting surfaces vith VTK

Cory Quammen cquammen at cs.unc.edu
Sun Sep 2 13:15:07 EDT 2007


Yadin,

Take a look at one of the examples that uses vtkWarpScalar:
http://public.kitware.com/cgi-bin/viewcvs.cgi/*checkout*/Examples/VisualizationAlgorithms/Python/imageWarp.py?root=VTK&content-type=text/plain

It should do what you want. Basically, it reads in an image, converts
the image to a polygon mesh, and distorts that mesh along the z-axis
according to the scalar data value at each image pixel, giving you a
surface.

Cory

On 9/2/07, yadin Bocuma Rivas <conra2004 at yahoo.com> wrote:
> hi rafael;
> thank you very much for helping me...the thing is that i still have my data
> in the form lets say something like this...
> x = arange(0,20)
> y = arange(0,20)
> z = arange(0,1,0.05)
> this are variables that i got in a python enthoght edition(on windows) file
> and then i want to plot this points and generate a surface through them...
>
> if i have to create a file and read them from there how do i do that...
> sorry if my question are....i am used to matlab and i am new at this besides
> i just
> wanna generate only surfaces and no more..
> thanks a lot for you help..thank you
>
> rafael possani <gentefinabr at hotmail.com> escribió:
>
>    Hi Yadin,  I suggest y to use vtkGaussianSplatter, thats a fragment code:
>
>     vtkUnstructuredGrid grid= new vtkUnstructuredGrid();
>     inferno.SetPoints(points);
>     inferno.SetCells(1,polys);
>     inferno.GetPointData().SetScalars(scalars);
>
>     vtkGaussianSplatter popSplatter = new vtkGaussianSplatter();
>     popSplatter.SetInput(grid);
>     popSplatter.SetSampleDimensions(50, 50, 50);
>     popSplatter.SetRadius(0.05);
>     popSplatter.ScalarWarpingOff();
>     popSplatter.Update();
>
>     vtkContourFilter popSurface = new vtkContourFilter();
>     popSurface.SetInputConnection(popSplatter.GetOutputPort());
>     popSurface.SetValue(0, 0.01);
>
>
>     vtkPolyDataMapper popMapper = new vtkPolyDataMapper();
>     popMapper.SetInputConnection(popSurface.GetOutputPort());
>     popMapper.ScalarVisibilityOn();
>     popMapper.SetScalarRange(grid.GetScalarRange());
>     popMapper.ImmediateModeRenderingOn();
>
>     vtkActor popActor = new vtkActor();
>     popActor.SetMapper(popMapper);
>
>
>     cya.
>
>
> ________________________________
> Date: Fri, 31 Aug 2007 10:24:26 -0500
> From: conra2004 at yahoo.com
> To: vtkusers at vtk.org
> Subject: [vtkusers] please help on ploting surfaces vith VTK
>
> hi!
> how do you plot surfaces in VTK?
> I know how to do it with matlab using surf or meshgrid....
> what is the command to plot surcaes in VTK?
> I just one to use it for ploting some points(x,y,z) ...generate a surface
> through jhe points and no more
> thanks __________________________________________________
> Correo Yahoo!
> Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
> Regístrate ya - http://correo.espanol.yahoo.com/
>
> ________________________________
> Receba GRÁTIS as mensagens do Messenger no seu celular quando você estiver
> offline. Conheça o MSN Mobile! Cadastre-se
> já!_______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
>
>  __________________________________________________
> Correo Yahoo!
> Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
> Regístrate ya - http://correo.espanol.yahoo.com/
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>


-- 
Cory Quammen
Department of Computer Science
University of North Carolina at Chapel Hill
http://www.cs.unc.edu/~cquammen



More information about the vtkusers mailing list