<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hello,<div><br></div><div>You can find the answer to you question with in the code:</div><div><a href="https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Core/Common/include/itkImageBase.h#L403-L417">https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Core/Common/include/itkImageBase.h#L403-L417</a></div><div><br></div><div>The return of false or 0 indicate that the index is out of bounds. The index should still be set, just be sure not to use on to get access to a pixel as it's invalid.</div><div><br></div><div>Brad</div><div><br><div><div>On Jun 3, 2014, at 8:32 AM, Girish, Gavaskar Ruturaj <<a href="mailto:gavaskar.ruturaj.girish@philips.com">gavaskar.ruturaj.girish@philips.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div lang="EN-US" link="blue" vlink="purple" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="WordSection1" style="page: WordSection1;"><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">Hello,<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);"> </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">Thanks Brad, that was just what I needed, because pixels equal to the threshold value are not set to OutsideValue.<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">I have one more question (actually three). What does it mean when the method<span class="Apple-converted-space"> </span></span><span style="font-size: 10pt; font-family: 'Courier New';">itk::Image::TransformPhysicalPointToIndex(point,pixelIndex)</span><span style="font-size: 10pt; font-family: NimbusMonL-Regu;"> </span><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">returns a 0? Do the index coordinates still get stored in<span class="Apple-converted-space"> </span></span><span style="font-size: 10pt; font-family: 'Courier New';">pixelIndex</span><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">? Why are they not useful?<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);"> </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">Thanks & Regards,<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">Ruturaj<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);"> </span></div><div><div style="border-style: solid none none; border-top-color: rgb(181, 196, 223); border-top-width: 1pt; padding: 3pt 0in 0in;"><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><b><span style="font-size: 10pt; font-family: Tahoma, sans-serif;">From:</span></b><span style="font-size: 10pt; font-family: Tahoma, sans-serif;"><span class="Apple-converted-space"> </span>Bradley Lowekamp [<a href="mailto:blowekamp@mail.nih.gov" style="color: purple; text-decoration: underline;">mailto:blowekamp@mail.nih.gov</a>]<span class="Apple-converted-space"> </span><br><b>Sent:</b><span class="Apple-converted-space"> </span>Tuesday, June 03, 2014 5:43 PM<br><b>To:</b><span class="Apple-converted-space"> </span>Girish, Gavaskar Ruturaj<br><b>Cc:</b><span class="Apple-converted-space"> </span><a href="mailto:community@itk.org" style="color: purple; text-decoration: underline;">community@itk.org</a><br><b>Subject:</b><span class="Apple-converted-space"> </span>Re: [ITK] Finding non-zero pixels<o:p></o:p></span></div></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;">Hello,<o:p></o:p></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;">There quite a large number of ways to do this in ITK. Have you looked at the ThresholdImageFilter[1]?<o:p></o:p></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;">Brad<o:p></o:p></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;">[1] <a href="http://www.itk.org/Doxygen/html/classitk_1_1ThresholdImageFilter.html" style="color: purple; text-decoration: underline;">http://www.itk.org/Doxygen/html/classitk_1_1ThresholdImageFilter.html</a><o:p></o:p></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div><div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;">On Jun 3, 2014, at 2:34 AM, Girish, Gavaskar Ruturaj <<a href="mailto:gavaskar.ruturaj.girish@philips.com" style="color: purple; text-decoration: underline;">gavaskar.ruturaj.girish@philips.com</a>> wrote:<o:p></o:p></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><br><br><o:p></o:p></div><div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;">Dear all,<o:p></o:p></span></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"> <o:p></o:p></span></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;">I have a grayscale image. I want a binary mask which is white where the pixels in the original image are non-zero, and black elsewhere. Which filter(s) can I use for this task?<o:p></o:p></span></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"> <o:p></o:p></span></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;">Thanks & Regards,<o:p></o:p></span></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;">Ruturaj<o:p></o:p></span></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 9pt; font-family: Helvetica, sans-serif;"> </span></div><div class="MsoNormal" align="center" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; text-align: center;"><span style="font-size: 9pt; font-family: Helvetica, sans-serif;"><hr size="2" width="100%" align="center"></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 7.5pt; font-family: Arial, sans-serif; color: gray;">The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.<br></span><span style="font-size: 9pt; font-family: Helvetica, sans-serif;">_______________________________________________<br>Community mailing list<br><a href="mailto:Community@itk.org" style="color: purple; text-decoration: underline;"><span style="color: purple;">Community@itk.org</span></a><br><a href="http://public.kitware.com/cgi-bin/mailman/listinfo/community" style="color: purple; text-decoration: underline;"><span style="color: purple;">http://public.kitware.com/cgi-bin/mailman/listinfo/community</span></a></span></div></div></div></div></div></div></blockquote></div><br></div></body></html>