[Insight-developers] LabelObject::ConstIndexIterator compiler warnings?
Gaëtan Lehmann
gaetan.lehmann at jouy.inra.fr
Mon Aug 1 14:06:15 EDT 2011
Le 1 août 11 à 17:02, Williams, Norman K a écrit :
> ITK has
>
>
> ImageRegionIterator
> ImageRegionIteratorWithIndex
> ImageRegionConstIterator
> ImageRegionConstIteratorWithIndex
>
> which leads me to see 'ConstIndexIterator' as having it's
> constituent name
> attributes in the wrong order.
ok, so I guess it should be
LineConstIterator
IndexConstIterator
>
> 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.
But there are some other examples with inner classes.
I propose to keep them as is for now - it should be possible to move
them away later if needed, and provide a typedef to keep the existing
code usable.
Thanks for your comments,
Gaëtan
>
> 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.
> ________________________________
--
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
-------------- 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/mailman/private/insight-developers/attachments/20110801/06f5ab94/attachment.pgp>
More information about the Insight-developers
mailing list