[Insight-users] StatisticsLabelObject

Luis Ibanez luis.ibanez at kitware.com
Thu Apr 15 22:55:18 EDT 2010


Hi Christian,

Thanks for pointing this out and for offering to help with
improving the documentation.

One of the best forms of documentation is to add examples
on the use of the classes. So, once we have figured out the
answers to the API questions that you posted here, the most
useful thing you could do is to craft several (basic) examples
and send them our way, so that we can add them to the
source code repository.

--

Regarding the API questions, Gaetan certainly will be the
best person to answer, but here is my guess:

1) The StatisticsLabelObject is intended to manage information
     about the intensity values of pixels covered by every label.

2) The ShapeLabelObject is intended to manage information
     about geometrical characteristics of the regions of pixels
     that have the same label.

Regarding the difference between

StatisticsLabelObject::SetElongation()

and

ShapeLabelObject::SetBinaryElongation()


well... "Glimpsing at the Source leaves no doubt"   :-)

if you open the file

Insight/Code/Review/itkStatisticsLabelMapFilter.txx

you will find in lines 263 and 299 that the elongation
is computed as

      elongation =
vcl_sqrt(principalMoments[ImageDimension-1] /
              principalMoments[ImageDimension-2]);

where the principalMoments were computed from
the moments of pixel values that belong to the object.


While,
if you open

Insight/Code/Review/itkShapeLabelMapFilter.txx

you will find in lines 336 and 381 that the elongation
is computed as

  elongation =
vcl_sqrt(
    principalMoments[ImageDimension-1] /
    principalMoments[ImageDimension-2]);

where the principalMoments were computed from
the moments of pixel positions. That is, withoutt
taking into account the intensity values of the pixels.
In other words, all the pixels of the object are
contributing the same weight to the computation of
moments.


   The power of Open Source, includes the Joy
   of understanding how the code works, just by
    reading it and studying it.      :-)


Please let us know if this answer your questions
about the differences in API between these two
classes.


      Regards,


            Luis


-------------------------------------------------------------------
On Wed, Apr 14, 2010 at 5:06 PM, Christian Werner <
christian.werner at rwth-aachen.de> wrote:

> Hello!
>
> I am wondering why the StatisticsLabelObject has the exact same and
> additional information as the ShapeLabelObject. Doesn't this make the
> itkShapeLabelObject obsolete? Or maybe having both can speed up your
> software if you're interested only in the shape attributes.
>
> Well this is not so important, there is something else that's not clear to
> me. In the StatisticLabelObject I find such pairs of functions:
>
> GetBinaryElongation() and GetElongation(),
> GetBinaryFlatness() and GetFlatness(), ...
>
> How do they differ? Also, I find the paper explaining the handling of these
> libraries ("Label Object Representation and Manipulation in ITK") a bit
> outdated. Is there a newer version? If there is a demand I'd be happy to
> invest some time updating some sections, especially the example section
> where I am missing some typical applications (at least for what I am doing).
>
> Also, the doxygen documentation presents the StatisticsLabelMapFilter like
> this:
> itk::BinaryImageToStatisticsLabelMapFilter< TInputImage, TFeatureImage,
> TOutputImage > Class Template Reference
>
> Hmm... 2 Inputs. One of them a has features.(?) It is hard to understand
> which input has which purpose at first glance. The documentation shows an
> example that uses a mask as the TInputImage so maybe it would be a good idea
> to call it TMaskImage.
>
> Anyway, I have these classes implemented nicely into my software and I
> can't stress enough how glad I am that these ITK classes exist. I just
> wanted to point out that the documentation could use an update.
>
>
> Best regards,
> Christian
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100415/5eb04822/attachment.htm>


More information about the Insight-users mailing list