<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; ">Hello Thomas,<div><br></div><div>In SimpleITK the order of the image inputs is the same as that used in ITK. We hope to add name arguments to SimpleITK shortly which should help for this type of case. In many cases to under stand what it going on in a filter sometimes you need to look at the ITK Code for example for the MorphologicalWatershedFromMarkers[1] you can look at the header[2]. &nbsp;Sometime you need to look at the SimpleITK JSON which describes the filter too[3]. So for this particular filter this first image is the feature image and the second is the markers. And this will improve in SimpleITK in the future.</div><div><br></div><div>[1]&nbsp;<a href="http://www.itk.org/Doxygen/html/classitk_1_1MorphologicalWatershedFromMarkersImageFilter.html">http://www.itk.org/Doxygen/html/classitk_1_1MorphologicalWatershedFromMarkersImageFilter.html</a></div><div>[2]&nbsp;<a href="http://www.itk.org/Doxygen/html/itkMorphologicalWatershedFromMarkersImageFilter_8h_source.html">http://www.itk.org/Doxygen/html/itkMorphologicalWatershedFromMarkersImageFilter_8h_source.html</a></div><div>[3]<a href="https://github.com/SimpleITK/SimpleITK/blob/master/Code/BasicFilters/json/MorphologicalWatershedFromMarkersImageFilter.json#L8">https://github.com/SimpleITK/SimpleITK/blob/master/Code/BasicFilters/json/MorphologicalWatershedFromMarkersImageFilter.json#L8</a></div><div><br></div><div>Brad</div><div><br></div><div><br></div><div><div>On May 21, 2013, at 12:11 PM, Thomas Deschamps &lt;<a href="mailto:tdeschamps@lbl.gov">tdeschamps@lbl.gov</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><div dir="ltr">Thank you for your answer.<div style="">Could you tell me if the convention for morphological reconstructions is always</div><div style=""><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div style="">FunctionName( SeedImage, MaskImage, optional parameters) ?</div><div style=""><br></div></blockquote>And is it the same for other routines like MorphologicalWatershedFromMarkersImageFilter?<br><div style="">I could not find the answer in the documentation.</div>
<div style=""><br></div><div style="">Thanks!</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 21, 2013 at 3:01 AM, Richard Beare <span dir="ltr">&lt;<a href="mailto:richard.beare@gmail.com" target="_blank">richard.beare@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Yes, it is unclear. I always end up getting it wrong even though I wrote the current version. FYI, the requirement is not really necessary for the current implementation, and was kept for&nbsp;compatibility with the original (slow) version. My preference would be to produce a marker that was the pixelwise min of the marker and mask, hence avoiding this issue. Also note that it is the Vincent algorithm that is being used.<div>


<br></div><div>It is possible that the error message is back to front. For a reconstruction by dilation the marker should be &lt;= mask.</div><div><br></div><div>The convention is that the Marker image is dilated, and then masked by the mask image, so the marker is the one that needs to be &lt;= for a reconstruction by dilation. In the opening by reconstruction the marker is an eroded version of the original (always &lt;= original) and the mask is the original.</div>

<div><br></div><div>&nbsp;</div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Tue, May 21, 2013 at 4:35 PM, Thomas Deschamps <span dir="ltr">&lt;<a href="mailto:tdeschamps@lbl.gov" target="_blank">tdeschamps@lbl.gov</a>&gt;</span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Hi<br><br>In ITK ReconstructionByDilationImageFilter it's specifically written <a href="http://www.itk.org/Doxygen/html/classitk_1_1ReconstructionByDilationImageFilter.html" target="_blank">in the documentation</a> that The marker image must be less than or equal to the mask image (on a pixel by pixel basis).<br>


But in SimpleITK I get the following error message with sitk.ReconstructionByDilationImageFilter: <br><br><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">itk::ERROR: ReconstructionByDilationImageFilter(0x7fd6fc671ea0): Marker pixels must be &gt;= mask pixels.</blockquote>


<br>So either the message means that some marker pixels have been found to be &gt;= to mask pixels, or another convention as been chosen. Does anybody know the answer?<div><br></div><div>BTW, it is clearly not indicated in the documentation which image is the marker image and which one is the mask image. Is this documented anywhere?</div>


<div><br></div><div>Thanks for your help.</div><span><font color="#888888"><div><br>TD.</div><div><br></div></font></span></div>
<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>
<br></blockquote></div><br></div>
</blockquote></div><br></div>
_____________________________________<br>Powered by <a href="http://www.kitware.com">www.kitware.com</a><br><br>Visit other Kitware open-source projects at<br><a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br><br>Kitware offers ITK Training Courses, for more information visit:<br>http://www.kitware.com/products/protraining.php<br><br>Please keep messages on-topic and check the ITK FAQ at:<br>http://www.itk.org/Wiki/ITK_FAQ<br><br>Follow this link to subscribe/unsubscribe:<br>http://www.itk.org/mailman/listinfo/insight-users<br></blockquote></div><br></body></html>