<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi Elena,</div><div><br></div><div><div>Please keep this on the email list in case others have similar</div><div>questions.</div><div><br></div><div>Unfortunately, I don't have the time to walk you through the code</div><div>identifying in detail where certain events of Boykov's graph cut</div><div>algorithm occur. However, in broad strokes, the alpha expansion</div><div>filter takes an input image to be segmented into n labels. Within</div><div>the alpha expansion filter, for each binary segmentation problem,</div><div>the image is converted to a graph structure (itkGraph) using the </div><div>BoykovImageToGraphFunctor where the traits of the graph are </div><div>defined by the class BoykovGraphTraits. The min cut for that graph</div><div>is found using the BoykovMinCutFilter. We then iterate through the</div><div>nodes of the output graph and label the voxels of the image based </div><div>on the labels of the nodes (note that each graph node has the index</div><div>to it's corresponding voxel as defined by the graph traits).</div><div><br></div><div>Nick</div></div><div><br></div><div><br></div><div><div>On Feb 5, 2013, at 8:40 AM, Elena Ranguelova <<a href="mailto:elboyran@gmail.com">elboyran@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hello Nick,<br><br>Thanks for the quick answer. <br><br>I have looked at the code, but I find it difficult to trace (debug) C++ template classes, have no experience in that. So, for example, I still can't locate what happens <br>
when filter->Update() is called, so it's hard to trace the steps of the algorithm.<br><br>I was aware that the Boykov graph min cut is a step of the alpha expansion, but does it mean that if we specify Nlabels = 2 (i.e. we want binary segmentation) your program using alpha expansion would be equivalent to using directly and only the Boykov graph cut filter (i.e. 1 step only)?<br>
<br>I see that the alpha expansion filter is descendant of MRFImageFilter, while the BoykovMinCutFliter descends from InPlaceGraphFilter, hence there usage is not so equivalent in terms of input and output.<br><br>Regards,<br>
Elena<br><br><div class="gmail_quote">On 5 February 2013 02:19, Nick Tustison <span dir="ltr"><<a href="mailto:ntustison@gmail.com" target="_blank">ntustison@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 style="word-wrap:break-word"><div>Hi Elena,</div><div><br></div><div>I haven't looked at that code for a long time. As soon as we found out</div><div>it was patented, we kind of lost interest in its further development and</div>
<div>went a different direction for our segmentation needs. I don't have </div><div>any of those example files any more and I don't know why they aren't</div><div>in the source code (or if they ever were in the first place). </div>
<div><br></div><div>Although the test code itkBoykovGraphCutFilterTest.cxx, does </div><div>interface with the alpha expansion filter, the latter requires the use of</div><div>the Boykov graph min cut filter to work for each binary segmentation</div>
<div>step. You have the basic idea regarding the main steps. I would </div><div>encourage you to look at the code for further details. </div><div><br></div><div>Nick</div><div><br></div><br><div><div><div class="h5"><div>
On Feb 4, 2013, at 8:32 AM, Elena Ranguelova <<a href="mailto:elboyran@gmail.com" target="_blank">elboyran@gmail.com</a>> wrote:</div><br></div></div><blockquote type="cite"><div><div class="h5">Hello,<br><br>I'm new to ITK and graph cuts, but currently very interested in both. Hence, I came across to Nick Tustison's graph cuts extension of ITK and I found he is an active member of this mailing list.<br>
<br>
<a href="http://www.insight-journal.org/browse/publication/306" target="_blank">http://www.insight-journal.org/browse/publication/306</a><br><br>The paper presented claims that there are 2 codes for testing:<br>itkGraphTest.cxx<br>
itkBoykovAlphaExpansionFilterTest.cxx<br>
and 1 example:<br>BoykovGraphCutFilter,<br><br>but in reality the example doesn't exist, nor the AlphaExpansion test under that name. There is a testing source called<br>itkBoykovGraphCutFilterTest.cxx, but in fact it illustrates the Alpha Expansion filter, not the BoykovGraphCut filter.<br>
<br>I would really like to have an example of how to use the provided code for performing only Boykov Minimum graph cut filtering on an input image/volume + likelihood images, as shown on figure 7 of the paper. Also how the main steps are performed?:<br>
1. input image to graph conversion<br>2. the setup of the likelihood images as filter input<br>3. the actual minimal cut<br>4. obtaining image (segmentation) from the cut graph<br><br>Does anyone have such a code/example? Would the author (Tustison) be willing to provide such an example usage? (This remark is already mentioned in the first review by David Doria).<br>
<br>Kind regards,<br>Elena<br><br></div></div>
_____________________________________<br>Powered by <a href="http://www.kitware.com/" target="_blank">www.kitware.com</a><br><br>Visit other Kitware open-source projects at<br><a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>Kitware offers ITK Training Courses, for more information visit:<br><a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br><br>Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</blockquote></div><br></div></blockquote></div><br>
</blockquote></div><br></body></html>