Hi Giulio,
  I would apply a programmable filter to the data like this for
example ( it also passes through any data not used at the end - if you
have any):
#-----------------------------------
# Copy colour as (r, g, b) into a single unsigned char array.
pdi = self.GetPolyDataInput()
pdo = self.GetPolyDataOutput()
pdo.SetPoints(pdi.GetPoints())
np = pdo.GetNumberOfPoints()
a = vtk.vtkUnsignedCharArray()
a.SetNumberOfComponents(3)
a.SetNumberOfTuples(np)
a.SetName("color")
r = pdi.GetPointData().GetArray("r")
g = pdi.GetPointData().GetArray("g")
b = pdi.GetPointData().GetArray("b")
for i in range(np):
        a.SetValue(i*3, r.GetValue(i))
        a.SetValue(i*3+1, g.GetValue(i))
        a.SetValue(i*3+2, b.GetValue(i))

pdo.GetPointData().AddArray(a)

# Copy through the data we do not use.
pdo.GetPointData().AddArray(pdi.GetPointData().GetArray("px"))
pdo.GetPointData().AddArray(pdi.GetPointData().GetArray("py"))
#-----------------------------------




> From: "Giulio Reina" <giulio.re...@unisalento.it>
> To: <paraview@paraview.org>
> Cc:
> Date: Tue, 21 Feb 2012 19:44:57 +0100
> Subject: [Paraview] 3D point cloud with color
>
> Hi,
>
>
>
> I have been working with 3D stereo reconstruction. So, I have huge 3d point 
> clouds co-registered with color in this format [X Y Z R G B] (the first three 
> vector columns specify the location of the single point and the last three 
> one its color in RGB space). I have been trying to display the data in 
> Paraview without success.
>
>
>
> I use the “table to points” filter to show the 3D coordinates but then I do 
> not know  how to specify the color of each single point using its RGB 
> components. Can you please help me out?
>
>
>
> Cheers,
>
>
>
> Giulio
>
>


-- 
___________________________________________
Andrew J. P. Maclean

___________________________________________
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview

Reply via email to