<br>Hi Alex,<br><br>1) ITK, (just as VTK and OpenGL) does not specify units.<br>    The meaning of spacing units is up to you to define.<br><br>    People in Optical Microscopy will probably specify <br>    spacing in microns.<br>
<br>     While Electron Microscopy will probably use nanometers.<br><br>     People in Astronomy will probably use parsecs or <br>     light years.<br><br>     and most people in radiology will use millimeters.<br><br>     Again, the actual unit is up to you to decide.<br>
     Just make sure that you use the same units <br>     consistently.<br> <br>      Nobody wants to see another $125 M gone<br>      to waste like in the Mars lander crash where<br>      engineers mixed centimeters with inches....<br>
      <a href="http://www.cnn.com/TECH/space/9909/30/mars.metric/">http://www.cnn.com/TECH/space/9909/30/mars.metric/</a><br><br><br>2)   The use of NormalizationAcrossSpace flag<br>       comes down to neutralizing the use of the<br>
       spacing. This should only be done if you are<br>       actually performing scale-space analysis.<br>       That is, running filters at multiple scales to<br>       then consolidate their results across scales.<br><br>
       Most mortals do not need to use this flag  :-)<br><br><br>       So, in general, Sigma does have units<br>       equal to the image spacing units.<br><br><br><br>  Regards,<br><br><br>       Luis<br><br><br>---------------------------------------------------------------------<br>
<div class="gmail_quote">On Wed, Sep 9, 2009 at 11:03 AM, Oleksandr Dzyubak <span dir="ltr">&lt;<a href="mailto:adzyubak@gmail.com">adzyubak@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;">
Hi Luis,<br>
<br>
Thanks for your clarification.<br>
Using power of OpenSource, I looked over the templates you recommended<br>
and particular the ::SetUp method.<br>
<br>
Couple questions.<br>
<br>
1)   const ScalarRealType spacingTolerance = 1e-8;<br>
<br>
Is it 0.01 micron?<br>
<br>
2) ::SetNormalizeAcrossScale method.<br>
You have to use Sigma which is not dimensionless.<br>
Do you use sigma renormalization in such a way that it becomes dimensionless<br>
and afterward you work with only dimensionless variables?<br>
<br>
<br>
Alex<br>
<br>
<br>
Luis Ibanez 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><div></div><div class="h5">
<br>
Hi Alex,<br>
<br>
The RecursiveGaussianImageFilter  &quot;approximates&quot; convolution,<br>
but it doesn&#39;t &quot;perform&quot; convolution.<br>
<br>
This filter implements an IIR filter.<br>
For details, please see:<br>
<br>
&quot;Fast Algorithms for Low-Level Vision&quot;<br>
R.Deriche in IEEE-PAMI Vol.12, No.1, January 1990, pp 78-87,<br>
<br>
&quot;Recursively Implementing The Gaussian and Its Derivatives&quot;,<br>
R. Deriche,<br>
INRIA, 1993, <a href="ftp://ftp.inria.fr/INRIA/tech-reports/RR/RR-1893.ps.gz" target="_blank">ftp://ftp.inria.fr/INRIA/tech-reports/RR/RR-1893.ps.gz</a><br>
<br>
<br>
Note that &quot;convolution&quot; by itself doesn&#39;t really<br>
set units, *unless* you take unit conversion into<br>
account in the computation of the convolution<br>
kernel coefficients.<br>
<br>
<br>
Using the power of Open Source, things will be<br>
a  lot clearer if you look at the internals of the code.  :-)<br>
<br>
<br>
For example, look at lines 56-69 of<br>
Insight/Code/BasicFilters/itkDiscreteGaussianImageFilter.txx<br>
<br>
Which actually performs a convolution with a truncated<br>
approximation of the Gaussian kernel.<br>
<br>
Note the use of the &quot;m_UseImageSpacing&quot; variable.<br>
<br>
On the other hand, look at the<br>
<br>
itkRecursiveSeparableImageFilter which is the parent<br>
class of the itkRecursiveGaussianImageFilter. In particular<br>
look at lines 264-267 of itkRecursiveSeparableImageFilter.txx:<br>
<br>
  const typename InputImageType::SpacingType &amp; pixelSize<br>
    = inputImage-&gt;GetSpacing();<br>
   this-&gt;SetUp( pixelSize[m_Direction] );<br>
 and their effect on<br>
lines 79-256 in itkRecursiveGaussianImageFilter.txx<br>
<br>
<br>
<br>
<br>
  Regards,<br>
<br>
<br>
      Luis<br>
<br>
<br>
-----------------------------------------------------------------------------------------------------------------------<br></div></div><div><div></div><div class="h5">
On Wed, Sep 9, 2009 at 10:22 AM, Oleksandr Dzyubak &lt;<a href="mailto:adzyubak@gmail.com" target="_blank">adzyubak@gmail.com</a> &lt;mailto:<a href="mailto:adzyubak@gmail.com" target="_blank">adzyubak@gmail.com</a>&gt;&gt; wrote:<br>

<br>
<br>
    Maybe I am misreading the description.<br>
<br>
    From the Class description:<br>
<br>
    RecursiveGaussianImageFilter<br>
    &lt;<a href="http://www.itk.org/Doxygen/html/classitk_1_1RecursiveGaussianImageFilter.html" target="_blank">http://www.itk.org/Doxygen/html/classitk_1_1RecursiveGaussianImageFilter.html</a>&gt;<br>
    is the base class for recursive filters that approximate<br>
    convolution with the Gaussian kernel.<br>
<br>
    In this case, wouldn&#39;t the units from the RecursiveGaussian filter<br>
    match those you would have<br>
    from the convolution?<br>
<br>
    Alex<br>
<br>
    Luis Ibanez wrote:<br>
<br>
        The RecursiveGaussian filter doesn&#39;t use convolution.<br>
<br>
        The value of sigma is set in physical coordinates.<br>
<br>
        The output pixel values will have units of :<br>
<br>
              input intensity values /  physical coordinates<br>
<br>
           *IF* you use the FirstOrder setting.<br>
<br>
        Note that there are also ZeroOrder and SecondOrder<br>
        settings.<br>
<br>
        In which case the intensity units of the output will be:<br>
<br>
        ZeroOrder:      input intensity units<br>
<br>
        Second Order :  input intensity units / (physical units)^2<br>
<br>
<br>
<br>
           Regards,<br>
<br>
<br>
                Luis<br>
<br>
<br>
<br>
        -------------------------------------------------------------------------------<br>
        On Wed, Sep 9, 2009 at 9:51 AM, Oleksandr Dzyubak<br>
        &lt;<a href="mailto:adzyubak@gmail.com" target="_blank">adzyubak@gmail.com</a> &lt;mailto:<a href="mailto:adzyubak@gmail.com" target="_blank">adzyubak@gmail.com</a>&gt;<br></div></div><div><div></div><div class="h5">

        &lt;mailto:<a href="mailto:adzyubak@gmail.com" target="_blank">adzyubak@gmail.com</a> &lt;mailto:<a href="mailto:adzyubak@gmail.com" target="_blank">adzyubak@gmail.com</a>&gt;&gt;&gt; wrote:<br>
<br>
           Don&#39;t you change the units while convolving with the Gaussian?<br>
<br>
           Alex<br>
<br>
           Kishore Mosaliganti wrote:<br>
<br>
               The resulting units are in world coordinates. You will not<br>
               need to divide by spacing. The sigma is also in world<br>
        coordinates.<br>
<br>
               Kishore<br>
<br>
               On Tue, Sep 8, 2009 at 11:49 AM, Gomez Herrero, Alberto<br>
               &lt;<a href="mailto:alberto.gomez-herrero@philips.com" target="_blank">alberto.gomez-herrero@philips.com</a><br>
        &lt;mailto:<a href="mailto:alberto.gomez-herrero@philips.com" target="_blank">alberto.gomez-herrero@philips.com</a>&gt;<br>
               &lt;mailto:<a href="mailto:alberto.gomez-herrero@philips.com" target="_blank">alberto.gomez-herrero@philips.com</a><br>
        &lt;mailto:<a href="mailto:alberto.gomez-herrero@philips.com" target="_blank">alberto.gomez-herrero@philips.com</a>&gt;&gt;<br>
               &lt;mailto:<a href="mailto:alberto.gomez-herrero@philips.com" target="_blank">alberto.gomez-herrero@philips.com</a><br>
        &lt;mailto:<a href="mailto:alberto.gomez-herrero@philips.com" target="_blank">alberto.gomez-herrero@philips.com</a>&gt;<br>
               &lt;mailto:<a href="mailto:alberto.gomez-herrero@philips.com" target="_blank">alberto.gomez-herrero@philips.com</a><br>
        &lt;mailto:<a href="mailto:alberto.gomez-herrero@philips.com" target="_blank">alberto.gomez-herrero@philips.com</a>&gt;&gt;&gt;&gt; wrote:<br>
<br>
                  Hello all,<br>
<br>
                            this is a question regarding derivative<br>
        filters in general<br>
               and the<br>
                  RecursiveGaussianImageFilter  in particular.<br>
<br>
                            When we compute, say, the first order<br>
        derivative of, say, a 2D<br>
                   image “ I“ we get two images of the same size,<br>
        “Ix”, and<br>
               “Iy”. My<br>
                  question is,  the resulting value (i.e. the Ix and<br>
        Iy gray<br>
               levels)<br>
                  is expressed in what units?, I mean, if the gradient is<br>
               defined as<br>
                  increment_of_gray_level /<br>
                  increment_of_distance_in_world_coordinates,<br>
        everything is<br>
               ok; but<br>
                  if this filter works as a simple pixelwise convolution<br>
               mask, then<br>
                  the gradient is in increment_of_gray_level /<br>
               increment_of_pixels.<br>
                  In that case, I need to divide by the spacing to get the<br>
               right units.<br>
<br>
                            I guess this is a very basic question, but<br>
        I really need to<br>
               make<br>
                  sure that this filters work as the first definition. I<br>
               can’t find<br>
                  it in the code, I only know that the sigma for the<br>
               smoothing is in<br>
                  world coordinates though…<br>
<br>
                            Anyone can clarify this please?<br>
<br>
                            Thanks,<br>
<br>
                            Alberto<br>
<br>
<br>
                               ------------------------------------------------------------------------<br>
                  The information contained in this message may be<br>
               confidential and<br>
                  legally protected under applicable law. The message<br>
        is intended<br>
                  solely for the addressee(s). If you are not the intended<br>
                  recipient, you are hereby notified that any use,<br>
        forwarding,<br>
                  dissemination, or reproduction of this message is<br>
        strictly<br>
                  prohibited and may be unlawful. If you are not the<br>
        intended<br>
                  recipient, please contact the sender by return<br>
        e-mail and<br>
               destroy<br>
                  all copies of the original message.<br>
<br>
                  _____________________________________<br>
                  Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a> &lt;<a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a>&gt;<br>
        &lt;<a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a>&gt;<br>
               &lt;<a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a>&gt;<br>
<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:<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>
<br>
<br>
                      ------------------------------------------------------------------------<br>
<br>
<br>
<br>
               _____________________________________<br>
               Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a> &lt;<a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a>&gt;<br>
        &lt;<a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a>&gt;<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:<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>
               <br>
           _____________________________________<br>
           Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a> &lt;<a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a>&gt;<br>
        &lt;<a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a>&gt;<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:<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>
<br>
<br>
<br>
<br>
</div></div></blockquote>
<br>
</blockquote></div><br>