[vtkusers] intensity plot;

rafael possani gentefinabr at hotmail.com
Thu Sep 6 17:33:31 EDT 2007


Hi, Yadin, this fragment code should be useful for you:

    vtkPoints points= new vtkPoints();
  
    vtkDoubleArray scalars = new vtkDoubleArray();    

    // Here you put your data points

            pontos.InsertPoint(0, x, y, z);
           scalars.InsertNextValue(scalarvalue); // scalarvalue is the intensity like y said ok ;) 
           idConter++;

    points.SetNumberOfPoints(30);
           
    vtkCellArray polys = new vtkCellArray();
    polys.InsertNextCell(points.GetNumberOfPoints());
    
    for (int i=0; i <pontos.GetNumberOfPoints(); i++)
      polys.InsertCellPoint(i);
    
    vtkPolyData polyData = new vtkPolyData();
    polyData.SetPoints(points);
    polyData.SetVerts(polys);
    polyData.GetPointData().SetScalars(scalars);
    
     vtkPolyDataMapper mapper = new vtkPolyDataMapper();
    mapper.SetInput(polyData);
    mapper.SetScalarRange(polyData.GetScalarRange());
  
     vtkActor Actor = new vtkActor();
     Actor.SetMapper(mapper);

    vtkRenderer ren1 = new vtkRenderer();
    vtkRenderWindow renWin = new vtkRenderWindow();
    renWin.AddRenderer(ren1);
    ren1.AddActor(Actor);
    
      
    vtkRenderWindowInteractor iren = new vtkRenderWindowInteractor();
    iren.SetRenderWindow(renWin);
    renWin.Render();
    iren.Start();    

   Thats in java and its not complete, but y can have a idea, I wish y a good luck.
   bye bye
   Rafael
Date: Thu, 6 Sep 2007 13:37:59 -0700
From: conra2004 at yahoo.com
To: vtkusers at vtk.org
Subject: [vtkusers] intensity plot;



hi!
i am planning to plot a contour map with vtk
i have 30 points as an array 
x = [1,1.0,1.003......]
y = [0.03,1,3,4.5,.....]
z =[11.2,2.3,2.0,1.9,.....]
I ntensity= [0.2,34,5,,]
how can i do a plot of this points and then lets say use different colors at every point to represent
 different intensities
thank you very much for helping me
__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
Regístrate ya - http://correo.espanol.yahoo.com/ 
_________________________________________________________________
Encontre o que procura com mais eficiência! Instale já a Barra de Ferramentas com Windows Desktop Search GRÁTIS!
http://desktop.msn.com.br/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070906/01658b30/attachment.htm>


More information about the vtkusers mailing list