<div dir="ltr">VTK List,<div><br></div><div>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):</div><div><br></div><div>Given a small set of values in a 2D vtkImageData:</div><div>001520</div><div>015553</div><div>015500</div><div><br></div><div>If we did a threshold of > 3, we get an unstructured grid as follows:</div><div> 5</div><div>555</div><div>55 </div><div><br></div><div>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:</div><div><br></div><div>  152</div><div> 15553</div><div> 1550</div><div><br></div><div>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 <a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/ImageDilateErode3D">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/ImageDilateErode3D</a>  </div><div><br></div><div>Any help would be appreciated!</div><div><br></div><div>Stephen</div><div><br></div></div>