<div dir="ltr">Stephen,<div><br></div><div>It sounds like you would need to first create a dilated binary mask, then mask out your original data.</div><div><br></div><div>vtkImageThreshold should let you get the initial binary mask. Then you can use vtkImageDilateErode3D to dilate the mask. Finally, use vtkImageMask to pull out the original image masked by the dilated threshold.</div><div><br></div><div>HTH,</div><div>Cory</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 3, 2015 at 8:05 PM, Stephen Hamilton <span dir="ltr"><<a href="mailto:stephenshamilton@gmail.com" target="_blank">stephenshamilton@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/ImageDilateErode3D</a>  </div><div><br></div><div>Any help would be appreciated!</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Stephen</div><div><br></div></font></span></div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Cory Quammen<br>R&D Engineer<br>Kitware, Inc.</div>
</div>