[Insight-users] FloodFilledFunctionConditionalConstIterator
Luis Ibanez
luis . ibanez at kitware . com
Mon, 21 Jul 2003 10:48:24 -0400
Hi Mathias,
Thanks for pointing this out.
You are right, the starting index should be taken into account.
The code was modified in order to use a m_ImageRegion instead
of the Index and Size independently. The ImageRegion already
provides a method "IsInside()" which returns whether an index
is inside the region or not.
InitializeIterator()
{
...
m_ImageRegion = image->GetBufferedRegion();
...
}
DoFloodStep()
{
...
if( !m_ImageRegion.IsInside( tempIndex ) )
...
}
This changes have been commited to the repository.
Please let us know if you find further problems,
Thanks
Luis
--------------------------
Mathias Seitel wrote:
> Hello all,
>
> I came across another bug in
> FloodFilledFunctionConditionalConstIterator. When checking if the new
> index in DoFloodStep() is valid, not only the size but also the index of
> the image should be taken into account, something like
>
> const long int* m_ImageIndex;
>
> InitializeIterator()
> {
> //...
> m_ImageIndex = m_Image->GetLargestPossibleRegion().GetIndex().m_Index;
> //...
> }
>
> DoFloodStep()
> {
> //...
> if ((tempIndex.m_Index[k] < static_cast<long int>(m_ImageIndex[k])) ||
> (tempIndex.m_Index[k] >= static_cast<long int>(m_ImageIndex[k] +
> m_ImageSize[k])))
> {
> //...
> }
> //...
> }
>
> Regards,
> Mathias
>
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk . org
> http://www . itk . org/mailman/listinfo/insight-users
>