<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2016-03-18 13:51 GMT+01:00 David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Fri, Mar 18, 2016 at 12:47 AM, Elvis Stansvik <span dir="ltr"><<a href="mailto:elvis.stansvik@orexplore.com" target="_blank">elvis.stansvik@orexplore.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"><div class="gmail_extra"><div class="gmail_quote"><span>2016-03-18 3:19 GMT+01:00 David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">You can segment an image with just one threshold (i.e. just the lower threshold).  It is not necessary to set a range.</div></blockquote><div><br></div></span><div>Sorry for jumping in here, but I'm also pretty new to VTK, and what Liu describes sounds like something we will want to do soon: Allow the user to set a grayscale range, and only show the parts of the volume that falls within this range.<br><br></div><div>When you say "you can segment an image with just one threshold", do you mean that it somehow doesn't make sense to use two thresholds? If so, why? What if the use really wants to "extract" the parts of the volume where the scalar values are within some range?<br></div></div></div></div></blockquote><div><br></div></span><div>It often makes sense to use a single threshold.  Examples:</div><div>1) segmenting bone from a CT image</div><div>2) removing background/noise from an MR image</div><div>3) segmenting vessels from a contrast image</div><div>Yes, there are also circumstances where two thresholds work better, but I've written more software that uses one threshold than that uses two.</div></div></div></div></blockquote><div><br></div><div>Ah, yes, then it makes perfect sense. For a while I thought you were talking about "not making sense" in a technical sense. In our case it's tomography of rock (drill core), so it makes sense to allow the user to select a range (in our case, from a histogram), and have the volume rendering show parts that are within that range (presumably corresponding to some structure/mineral/element with around that density). Thanks for clarifying!<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>The main point that I have been trying to make is that, if you want to get a smooth result out of vtkMarchingCubes, you should should give it a greyscale input, not a binary input.  In other words, you should not give marching cubes the output of vtkImageThreshold.</div><div><br></div><div>Marching cubes gives surfaces corresponding to isovalues.  If you have a range instead of a single threshold, then you should produce one surface for the lower end of the range, and another surface for the upper end of the range.  VTK surfaces are oriented, so you must reverse the sense of the upper-range surface (i.e. reverse the polygon winding and the normal directions).  Then you can combine the lower-range surface and the upper-range surface into a single polydata with vtkAppendPolyData.</div></div></div></div></blockquote><div><br></div><div>Excellent, thank for that tip. We're not there yet, but we may do something like that in the future (instead of just showing the volume rendering filtered by two endpoints).<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>If this sounds too complicated, then you can instead take the output from vtkImageThreshold, apply a mild gaussian blur to it, and apply marching cubes to the blurred data.  If you only have a binary mask (i.e. if you no longer have the original data) then this is a reasonable way to produce a greyscale input for marching cubes.  But if you have the original data, then a more accurate result can be achieved by feeding the original data into marching cubes, so that it uses the original greyscale values when it analyzes the voxels and produces the surface.</div></div></div></div></blockquote><div><br></div><div>Yes, I imagine this is what we'll do (the latter approach).<br><br></div><div>Again, thanks for your input and your nice support on this list.<br><br></div><div>Elvis<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="HOEnZb"><font color="#888888"><div><br></div><div> - David</div></font></span></div></div></div>
</blockquote></div><br></div></div>