[vtkusers] Fwd: How to smooth (or filter) polydata scalars?
Kevin H. Hobbs
hobbsk at ohiou.edu
Wed Jan 14 10:14:45 EST 2009
On Wed, 2009-01-14 at 13:38 +0100, Fabio Meneghini wrote:
>
> Thank you very much for your reply. I really appreciated it!
You're welcome.
> So, for every vertex of the polydata,
"Vertex" has a specific meaning in VTK it means a cell with one point.
I'm not much of a jargon nut but this could prevent some confusion as
you search through classes.
> I could compute the mean of the scalar values of its neighbors
> (possibly with some weights, depending on their distance from the
> current vertex, and then replace the actual scalar value of current
> vertex with the mean.
In general yes that's how I'd do it. Do the replacement in a temporary
scalar array or calculate the average from a copy of the scalar array.
That way you won't contaminate the average of the neighbors of later
points with the average of the neighbors of earlier points.
> waiting for a better suggestion about wich classes do this job
> better,
> Thanks again for the hint...
>
Use of the gradient or gradient magnitude filters might help you with
highpass filters.
> Fabio
I'm attaching code that does point (position) smoothing in a particular
way that I need. It should help you walk the polydata.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smooth_trace.cxx
Type: text/x-c++src
Size: 4624 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090114/c92938bc/attachment.cxx>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090114/c92938bc/attachment.pgp>
More information about the vtkusers
mailing list