[Insight-users] itk/simpleitk differences for ReconstructionByDilationImageFilter marker/mask inputs?

Bradley Lowekamp blowekamp at mail.nih.gov
Tue May 21 13:50:41 EDT 2013


Hello Thomas,

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].  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.

[1] http://www.itk.org/Doxygen/html/classitk_1_1MorphologicalWatershedFromMarkersImageFilter.html
[2] http://www.itk.org/Doxygen/html/itkMorphologicalWatershedFromMarkersImageFilter_8h_source.html
[3]https://github.com/SimpleITK/SimpleITK/blob/master/Code/BasicFilters/json/MorphologicalWatershedFromMarkersImageFilter.json#L8

Brad


On May 21, 2013, at 12:11 PM, Thomas Deschamps <tdeschamps at lbl.gov> wrote:

> Thank you for your answer.
> Could you tell me if the convention for morphological reconstructions is always
> 
> FunctionName( SeedImage, MaskImage, optional parameters) ?
> 
> And is it the same for other routines like MorphologicalWatershedFromMarkersImageFilter?
> I could not find the answer in the documentation.
> 
> Thanks!
> 
> 
> On Tue, May 21, 2013 at 3:01 AM, Richard Beare <richard.beare at gmail.com> wrote:
> 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 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.
> 
> It is possible that the error message is back to front. For a reconstruction by dilation the marker should be <= mask.
> 
> 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 <= for a reconstruction by dilation. In the opening by reconstruction the marker is an eroded version of the original (always <= original) and the mask is the original.
> 
>  
> 
> 
> On Tue, May 21, 2013 at 4:35 PM, Thomas Deschamps <tdeschamps at lbl.gov> wrote:
> Hi
> 
> In ITK ReconstructionByDilationImageFilter it's specifically written in the documentation that The marker image must be less than or equal to the mask image (on a pixel by pixel basis).
> But in SimpleITK I get the following error message with sitk.ReconstructionByDilationImageFilter: 
> 
> itk::ERROR: ReconstructionByDilationImageFilter(0x7fd6fc671ea0): Marker pixels must be >= mask pixels.
> 
> So either the message means that some marker pixels have been found to be >= to mask pixels, or another convention as been chosen. Does anybody know the answer?
> 
> 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?
> 
> Thanks for your help.
> 
> TD.
> 
> 
> _____________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
> 
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
> 
> 
> 
> _____________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
> 
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130521/1183f461/attachment.htm>


More information about the Insight-users mailing list