<div dir="ltr">Hi,<div>I'm not quite sure how you mean to use a combination of label and grayscale images. Perhaps you mean to apply a grayscale operation to a region defined by a label? If this is the case then you need a combination of masking and setting the masked out areas to either max or min of the grayscale value to have the erosion/dilation ignore them. If the label regions don't touch then you can apply the morphological operation to each one in one go. If they do touch, and you want independent operations, then you'll probably need to pull them out one at a time.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 13, 2014 at 8:00 PM, Kanishka <span dir="ltr"><<a href="mailto:kanishkasharma10@gmail.com" target="_blank">kanishkasharma10@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">thanks Bradley for sharing the python solution using simple ITK. As I see,<br>
you have binary image in your case, I am working with grayscale image and i<br>
see in the description of the ITK filters, we can indeed use the morphology<br>
operations on grayscale images too but to do the same for selective label in<br>
the grayscale image is difficult for me to achieve right now.<br>
<br>
@Richard: I am indeed looking for a solution to selectively operate on the<br>
labels. I looked into the Insight journal you shared (thanks again for<br>
sharing), maybe I can try to work around it.<br>
<br>
Maybe also, creating a label map and then extracting the particular label,<br>
applying morphology operation on it and then merging it back with other<br>
labels is what I should try next.<br>
<br>
Kanishka<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://itk-users.7.n7.nabble.com/morphology-operations-on-labeled-image-tp33351p33374.html" target="_blank">http://itk-users.7.n7.nabble.com/morphology-operations-on-labeled-image-tp33351p33374.html</a><br>

<div class="HOEnZb"><div class="h5">Sent from the ITK - Users mailing list archive at Nabble.com.<br>
_____________________________________<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>
</div></div></blockquote></div><br></div>