<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Mar 18, 2016 at 8:43 PM, Liu_tj <span dir="ltr"><<a href="mailto:tjlp@netease.com" target="_blank">tjlp@netease.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>I thought that vtkImageThreshold still provide a greyscale output instead of binary output. My understanding was that vtkImageThreshold just remove the points beyond the greyscale range.</blockquote><div><br></div><div>It can be used that way, but in your code, it is producing a binary output.  <span style="font-size:12.8px">Points in the range are set to 1, and points outside the range are set to 0:</span></div><div><br></div><div><span style="font-size:12.8px">            image_threshold.ReplaceInOn();</span><br style="font-size:12.8px"><span style="font-size:12.8px">            image_threshold.SetInValue(1);</span><br style="font-size:12.8px"><span style="font-size:12.8px">            image_threshold.ReplaceOutOn()</span><span style="font-size:12.8px">;</span><br style="font-size:12.8px"><span style="font-size:12.8px">            image_threshold.SetOutValue(0)</span><span style="font-size:12.8px">;</span><br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">But even if you change vtkImageThreshold so that it just removes the points outside of the range, I still recommend that you do not use it before vtkMarchingCubes, because marching cubes expects to have valid grey values on both sides of the isosurface (on the inside and on the outside).  If you set the outside voxels to black, then the resulting surface will be shifted inward slightly.</span><br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"> - David</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div><div><br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div><div> </div></div></div></div>