Hi Luis,<br>      sure, sounds like a good plan. I am heading out right now, but hopefully I should be able to get it done by tomorrow! I will try with time steps at 1/2^N, 1/2^(N+1), and 1.5/2^N and send out another e-mail.<br>
<br>Cheers,<br><br>C.S.N<br><br>P.S :- Just in case anyone is interested, the paper is available as a tech report from Berkeley<br><br><a href="http://digitalassets.lib.berkeley.edu/techreports/ucb/text/CSD-88-483.pdf">http://digitalassets.lib.berkeley.edu/techreports/ucb/text/CSD-88-483.pdf</a><br>
<br><br><div class="gmail_quote">On Mon, Feb 15, 2010 at 3:58 PM, Luis Ibanez <span dir="ltr">&lt;<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.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;">
<div class="im">Hi Natarajan,<br>
<br>
You are right, the code is actually testing for<br>
<br>
</div>                        1/2^(N+1)<br>
<div class="im"><br>
not for<br>
<br>
                           1/2^(N)<br>
<br>
as I incorrectly wrote in my email.<br>
<br>
<br>
This filter is intended to be the implementation of<br>
the Perona-Malik method, as described in:<br>
<br>
 * Pietro Perona and Jalhandra Malik, ``Scale-space and edge detection using<br>
 * anisotropic diffusion,&#39;&#39; IEEE Transactions on Pattern Analysis Machine<br>
 * Intelligence, vol. 12, pp. 629-639, 1990.<br>
<br>
<br>
I don&#39;t have at hand the Perona Malik paper,<br>
so let&#39;s do this:<br>
<br>
<br>
Could you please modify the code locally in your ITK code,<br>
and run it with a couple of cases, using a timestep that is<br>
in the range:<br>
<br>
                    1/2^(N+1)  &lt;  t  &lt; 1/2^(N)<br>
<br>
and let us know if the output looks correct ?<br>
<br>
---<br>
<br>
Typically when you use a timestep that is too large, you<br>
will see intensity artifacts that look like rhomboids in the<br>
borders of the objects in the image.<br>
<br>
<br>
     Please let us know what you find,<br>
<br>
<br>
            Thanks<br>
<br>
<br>
</div>                 Luis<br>
<br>
<br>
---------------------------------------------------------------------------<br>
<div><div></div><div class="h5">On Mon, Feb 15, 2010 at 3:34 PM, Natarajan CS &lt;<a href="mailto:csnataraj@gmail.com">csnataraj@gmail.com</a>&gt; wrote:<br>
&gt; Hi Luis,<br>
&gt;      thanks for the quick reply. Nope, I do not believe I have enabled this<br>
&gt; flag. I am confused, I did take a look at the code snippet you suggested and<br>
&gt; figured that time step is &lt;= 1/2^(N+1) not 1/2^N (Judging from line 75<br>
&gt; and/through 81). In reality I believe this has to be 1/2^N as you suggested,<br>
&gt; at least if the implementation is same as Perona and Malik..<br>
&gt;<br>
&gt; just in case my metadata looks as follows :<br>
&gt;<br>
&gt; NDims = 3<br>
&gt; DimSize = 256 256 256<br>
&gt; ElementType = MET_SHORT<br>
&gt; ElementDataFile = raw256.raw<br>
&gt;<br>
&gt;<br>
&gt; Again, thanks for the help!<br>
&gt;<br>
&gt; Cheers,<br>
&gt;<br>
&gt; C.S.N<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Mon, Feb 15, 2010 at 2:00 PM, Luis Ibanez &lt;<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>&gt;<br>
&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi Natarajan,<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;                      &quot;Glimpsing at the Source, leaves no doubt&quot;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; This is what the file:<br>
&gt;&gt;<br>
&gt;&gt;           Insight/Code/BasicFilters/itkAnisotropicDiffusionImageFilter.txx<br>
&gt;&gt;<br>
&gt;&gt; has in lines 75-82:<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;  if ( m_TimeStep &gt;  (minSpacing / vcl_pow(2.0,<br>
&gt;&gt; static_cast&lt;double&gt;(ImageDimension) + 1))  )<br>
&gt;&gt;    {<br>
&gt;&gt;    //    f-&gt;SetTimeStep(1.0 / vcl_pow(2.0,<br>
&gt;&gt; static_cast&lt;double&gt;(ImageDimension)));<br>
&gt;&gt;    itkWarningMacro( &lt;&lt; &quot;Anisotropic diffusion unstable time step: &quot;<br>
&gt;&gt;                     &lt;&lt; m_TimeStep &lt;&lt; std::endl<br>
&gt;&gt;                     &lt;&lt; &quot;Stable time step for this image must be smaller<br>
&gt;&gt; than &quot;<br>
&gt;&gt;                     &lt;&lt; minSpacing / vcl_pow(2.0,<br>
&gt;&gt; static_cast&lt;double&gt;(ImageDimension+1)));<br>
&gt;&gt;    }<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; In summary:<br>
&gt;&gt;<br>
&gt;&gt;                    Timestep    &lt;     pixelSpacing  /  ( 2^N )<br>
&gt;&gt;<br>
&gt;&gt; where N is the image dimension (e.g. 3 for 3D images, and 2 for 2D<br>
&gt;&gt; images).<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Did you enable the flag:<br>
&gt;&gt;<br>
&gt;&gt;               UseImageSpacing  ?<br>
&gt;&gt;<br>
&gt;&gt; If so, what is the pixel spacing of your image ?<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;      Regards,<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;            Luis<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; -------------------------------------------<br>
&gt;&gt; On Mon, Feb 15, 2010 at 12:27 PM, Natarajan CS &lt;<a href="mailto:csnataraj@gmail.com">csnataraj@gmail.com</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt; &gt; Hello all,<br>
&gt;&gt; &gt;       Not sure if this is a bug or a implementation detail I am<br>
&gt;&gt; &gt; overlooking,<br>
&gt;&gt; &gt; I am tending towards the latter, so any info would be helpful !<br>
&gt;&gt; &gt;  I get  the following warning from the<br>
&gt;&gt; &gt; GradientAnisotropicDiffusionImageFilter (The filter is being applied to<br>
&gt;&gt; &gt; a<br>
&gt;&gt; &gt; 256^3 dataset of type short)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; WARNING: In<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; /hpc/soft/natac0/itk/include/InsightToolkit/BasicFilters/itkAnisotropicDiffusionImageFilter.txx,<br>
&gt;&gt; &gt; line 78<br>
&gt;&gt; &gt; GradientAnisotropicDiffusionImageFilter (0xbc4120): Anisotropic<br>
&gt;&gt; &gt; diffusion<br>
&gt;&gt; &gt; unstable time step: 0.07<br>
&gt;&gt; &gt; Stable time step for this image must be smaller than 0.0625<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; i was under the impression that the ITK implimentation was a explicit<br>
&gt;&gt; &gt; method<br>
&gt;&gt; &gt; with the time step requirement for 3D images is &lt;= 1/8 and &lt;= 1/4 for<br>
&gt;&gt; &gt; 2D. Am<br>
&gt;&gt; &gt; i completely off-track here?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Appreciate any help!<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Thanks,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; C.S.N<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; _____________________________________<br>
&gt;&gt; &gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Visit other Kitware open-source projects at<br>
&gt;&gt; &gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Kitware offers ITK Training Courses, for more information visit:<br>
&gt;&gt; &gt; <a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Please keep messages on-topic and check the ITK FAQ at:<br>
&gt;&gt; &gt; <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt; &gt; <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br>