[vtkusers] Expanding/Dilating a threshold

Stephen Hamilton stephenshamilton at gmail.com
Thu Dec 3 20:05:23 EST 2015


VTK List,

Hi-I'm trying to perform a function that I can't seem to figure out in
VTK.  I'm using Python and I'm trying to perform a threshold function on
vtk Image Data with an expansion caveat.  Currently I can threshold a 3D
block of cells with no problems.  What I want to do is expand that
threshold with a kernel value that I decide (even 1 would be fine for
now).  So the idea would be something like this (2d example to make it
easier to see):

Given a small set of values in a 2D vtkImageData:
001520
015553
015500

If we did a threshold of > 3, we get an unstructured grid as follows:
 5
555
55

This works great in VTK.  What I want to do is include neighboring cells,
which would result in a threshold like this for a value of 1:

  152
 15553
 1550

Is this possible in VTK?  I've looked at the vtkImageDilateErode3D
function.  The example doesn't quite work for me because it sets the Erode
and Dilate values to a specific value (0 and 255), whereas my values aren't
consistent and I need to include them based on their spatial relation, not
their value.  The example I'm referring to is at
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/ImageDilateErode3D

Any help would be appreciated!

Stephen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151203/6edbf7a1/attachment.html>


More information about the vtkusers mailing list