<div class="gmail_quote">On Thu, Aug 6, 2009 at 1:07 PM, David Doria <span dir="ltr">&lt;<a href="mailto:daviddoria%2Bitk@gmail.com">daviddoria+itk@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I am trying to follow Examples/NeighborhoodIterators1.cxx<br><br>In the example, there is:<br>  typedef itk::ConstNeighborhoodIterator&lt; ImageType &gt; NeighborhoodIteratorType;<br>...<br>  NeighborhoodIteratorType::RadiusType radius;<br>

  radius.Fill(1);<br>  NeighborhoodIteratorType it( radius, reader-&gt;GetOutput(),<br>
                               reader-&gt;GetOutput()-&gt;GetRequestedRegion() );<br><br>When I try to do the same thing inside itkConnectedThresholdImageFilter.h (I&#39;m attempting to modify it):<br><br>    typedef itk::ConstNeighborhoodIterator&lt; InputImageType &gt; NeighborhoodIteratorType;<br>

// I also tried removing the itk:: since I am now working inside itk:: already , with no change in the error<br>   // typedef ConstNeighborhoodIterator&lt; InputImageType &gt; NeighborhoodIteratorType;<br>
    NeighborhoodIteratorType::RadiusType radius;</blockquote><div><br>do as the error says. say<br><br>  typename NeighborhoodIteratorType::RadiusType radius;<br><br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I get<br>error: dependent-name &#39;itk::NeighborhoodIteratorType::RadiusType&#39; is parsed as a non-type, but instantiation yields a type<br>note: say &#39;typename itk::NeighborhoodIteratorType::RadiusType&#39; if a type is meant<br>


<br>I originally tried to create the iterator directly:<br>ConstNeighborhoodIterator&lt; InputImageType &gt; it(1, this-&gt;GetInputImage(), this-&gt;GetInputImage()-&gt;GetRequestedRegion() );</blockquote><div><br>As the error below indicates, the first argument &quot;1&quot; is not castable to a &quot;SizeType &amp;&quot;. Please say:<br>
<br>  SizeType size(Dimension);<br>  size.Fill(1); // radius of 1.<br>  ConstNeighborhoodIterator&lt; InputImageType &gt; it(size, this-&gt;GetInputImage(),this-&gt;GetInputImage()-&gt;GetRequestedRegion() );<br><br><br><br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><br>but I get a lovely template error:<br>
<br>/home/doriad/src/Insight/Code/Common/itkRegionEdgeFunction.h:128: error: no matching function for call to &#39;itk::ConstNeighborhoodIterator&lt;itk::Image&lt;float, 1u&gt;, itk::ZeroFluxNeumannBoundaryCondition&lt;itk::Image&lt;float, 1u&gt; &gt; &gt;::ConstNeighborhoodIterator(int, const itk::Image&lt;float, 1u&gt;*, const itk::ImageRegion&lt;1u&gt;&amp;)&#39;<br>

/home/doriad/src/Insight/Code/Common/itkConstNeighborhoodIterator.h:111: note: candidates are: itk::ConstNeighborhoodIterator&lt;TImage, TBoundaryCondition&gt;::ConstNeighborhoodIterator(const typename itk::Neighborhood&lt;typename TImage::InternalPixelType*, itk::ConstNeighborhoodIterator&lt;TImage, TBoundaryCondition&gt;::Dimension, itk::NeighborhoodAllocator&lt;typename TImageType::InternalPixelType*&gt; &gt;::SizeType&amp;, const TImage*, const typename TImage::RegionType&amp;) [with TImage = itk::Image&lt;float, 1u&gt;, TBoundaryCondition = itk::ZeroFluxNeumannBoundaryCondition&lt;itk::Image&lt;float, 1u&gt; &gt;]<br>

/home/doriad/src/Insight/Code/Common/itkConstNeighborhoodIterator.txx:186: note: itk::ConstNeighborhoodIterator&lt;TImage, TBoundaryCondition&gt;::ConstNeighborhoodIterator(const itk::ConstNeighborhoodIterator&lt;TImage, TBoundaryCondition&gt;&amp;) [with TImage = itk::Image&lt;float, 1u&gt;, TBoundaryCondition = itk::ZeroFluxNeumannBoundaryCondition&lt;itk::Image&lt;float, 1u&gt; &gt;]<br>

/home/doriad/src/Insight/Code/Common/itkConstNeighborhoodIterator.txx:158: note: itk::ConstNeighborhoodIterator&lt;TImage, TBoundaryCondition&gt;::ConstNeighborhoodIterator() [with TImage = itk::Image&lt;float, 1u&gt;, TBoundaryCondition = itk::ZeroFluxNeumannBoundaryCondition&lt;itk::Image&lt;float, 1u&gt; &gt;]<br>

<br>Can anyone see what the problem may be?<br><br clear="all">Thanks,<br><font color="#888888"><br>David<br>
</font><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>
Please keep messages on-topic and check the ITK FAQ at: <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><br clear="all"><br>-- <br>Karthik Krishnan<br>R&amp;D Engineer,<br>Kitware Inc.<br>Ph: 518 881 4919<br>Fax: 518 371 4573<br>