[Insight-developers] LabelObject::ConstIndexIterator compiler warnings?

Williams, Norman K norman-k-williams at uiowa.edu
Mon Aug 1 11:02:30 EDT 2011


ITK has


ImageRegionIterator
ImageRegionIteratorWithIndex
ImageRegionConstIterator
ImageRegionConstIteratorWithIndex

which leads me to see 'ConstIndexIterator' as having it's constituent name
attributes in the wrong order.

And I don't think there's a problem with nested classes, per-se, but
again, if you take the ImageRegionIterators as the template, it would
definitely be its own class.

That's my rationale for those comments.

On 7/30/11 6:32 AM, "Gaëtan Lehmann" <gaetan.lehmann at jouy.inra.fr> wrote:

>
>Le 29 juil. 11 à 21:48, Williams, Norman K a écrit :
>
>> I found this by adding -Wall -Wextra and doing an experimental build.
>>
>>
>> /.../ITK/Modules/Filtering/LabelMap/include/
>> itkLabelMapToLabelImageFilter.h
>> xx:52: warning: 'it.itk::LabelObject<long unsigned int,
>> 2u>::ConstIndexIterator::m_Index.itk::Index<2u>::m_Index[1u]' may be
>> used
>> uninitialized in this function
>>
>> there are 220 warnings that you get with those flags and they all
>> seem to
>> stem from the curiously semi-un-ITK-ish class
>> LabelObject::ConstIndexIterator.
>>
>>
>> Leaving off for now the fact that it's a nested cast with a name
>> inconsistent with the rest of ITK...
>
>Are we supposed to not use nested classes?
>I took the implementation from Modules/Numerics/Statistics/include/
>itkListSample.h and changed it to fit my needs.
>
>Can you elaborate about what is wrong with the name?
>
>This is a good time to enhance those new features!
>
>>
>> It looks as though this warning is a false positive -- any time the
>> index
>> might actually be used, it is also set to a resonable value.
>>
>> But is it worth it to add code to initialize it? Or is there a free
>> or low
>> computational cost way to restructure this class such that the warning
>> goes away?
>
>
>We can without problem initialize it in the constructor.
>
>I'll propose a change.
>
>Gaëtan
>
>--
>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://mima2.jouy.inra.fr  http://www.itk.org
>http://www.bepo.fr
>



________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
________________________________


More information about the Insight-developers mailing list