[Insight-users] FloodFilledFunctionConditionalConstIterator
Mathias Seitel
mathias . seitel at igd . fhg . de
Mon, 21 Jul 2003 17:29:49 +0200
Hi Luis,
I've got another question related to my previous, about images with a
region index != 0. Some filters which require the specification of seed
points or alike, e.g. ConnectedThresholdImageFilter, take into account
the region index when dealing with the seed points, while others, e.g.
FastMarchingImageFilter, do not.
For example, assume an image with index (0, 0, 8) and size (256, 256, 5).
A seed point at (100, 100, 10) specified for a
ConnectedThresholdImageFilter lies within the correct range.
The same seed point used as a trial point for a FastMarchingImageFilter,
however, does not, and is discarded by the filter. (100, 100, 3) has to
be specified here to address the desired pixel. This makes sense since
FastMarchingImageFilter only provides a SetOutputSize() method, but no
SetOutputIndex() method.
It would seem reasonable to me to also use an index for
FastMarchingImageFilter (and possibly others), for making things more
consistent. Another drawback of the output of FastMarchingImageFilter
always having an index of 0 is that the index has to be set manually, if
the output is to be used together with an image which has an index != 0.
I hope my reasoning makes sense :-)
Mathias
Luis Ibanez wrote:
>
> 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
>>
>
>
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk . org
> http://www . itk . org/mailman/listinfo/insight-users
>