[Insight-users] StatisticsLabelObject

Gaëtan Lehmann gaetan.lehmann at jouy.inra.fr
Thu Apr 22 03:18:12 EDT 2010


Hi,

Christian, of course we can't refuse a proposition to help improving  
anything in ITK!

You're right, the documentation is outdated. It is also not complete  
enough in the source code -- this makes the doxygen doc not that  
useful for these classes.

I can provide you an access to the article repository, or can take  
your enhancements to the article as a diff output -- just as you prefer!
For the doxygen documentation, I think this is a good case for the  
"Adopt a Bug" program, and a good way to put a hand in ITK  
development :-)

About the GetFlatness() and GetBinaryFlatness() (and others): I know  
the attribute names are not good enough, but I don't have much skills  
in "choosing a good name". I would appreciate any proposition to  
improve them. The same is true for the template parameters of course  
(TFeatureImage).

Finally, the ShapeLabelObject is the superclass of the  
StatisticsLabelObject, so they are not redundant :-)

Gaëtan

Le 16 avr. 10 à 10:08, Christian Werner a écrit :

> Thank you, Luis. Looking at the source code is a good point! I have  
> done this before but this time I somehow didn't take this into  
> consideration and sticked to the documentation where some things are  
> actually missing. It still might be a good idea to do some updates  
> there. I am pretty sure that in the future, many people will at  
> first stick to the documentation to get an idea of how to do their  
> image analysis. These classes are so powerful and valuable that they  
> deserve a decent, up-to-date, documentation. I still have the  
> "outdated" documentation printed out on my desk as a reference for  
> now and then (yes, on paper! :)
>
> Best regards,
> Christian
>
>
> Luis Ibanez wrote:
>>
>> 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 
>>  <mailto: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 <http://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
>>
>>
>
> _____________________________________
> 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

-- 
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
http://voxel.jouy.inra.fr  http://www.itk.org
http://www.mandriva.org  http://www.bepo.fr

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 203 bytes
Desc: Ceci est une signature ?lectronique PGP
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100422/64b76eef/attachment.pgp>


More information about the Insight-users mailing list