[Insight-developers] Bug in ExtractImageFilter

Bradley Lowekamp blowekamp at mail.nih.gov
Fri Oct 16 10:46:55 EDT 2009


On Oct 16, 2009, at 10:20 AM, Kevin H. Hobbs wrote:

> On Fri, 2009-10-16 at 09:32 -0400, Bradley Lowekamp wrote:
>> Hello Kevin,
>>
>
> Thank you for looking into this.

I have run into this many time before, and it has been asked before too.

>
>>
>> This is not a bug.
>
> Somehow I just don't buy it.

It happens with just about every filter when the size of the largest  
possible region is changed on the filter's input.

I agree is is not good behavior. I have just gotten use to using the  
"UpdateLargestPossibleRegion" instead.

>
>
> Neither :
>
> extract->SetExtractionRegion( region );
> image->SetRequestedRegionToLargestPossibleRegion();
>
> nor :
>
> extract->SetExtractionRegion( region );
> extract->GetOutput()->SetRequestedRegionToLargestPossibleRegion();
>
> works. What are you suggesting I try?

This method may actually be to low level, so it may not work in this  
case. I believe is assumes that the OutputInformation is up to date.

>
> Again, I have a negative emotional reaction to this.
>
> When a user sets the region to be extracted the user is literally
> requesting a region.

No. The extracted region is a parameter to the filter, which describes  
what the filter should do, while the RequestedRegion is different. It  
is a part of ITK's pipeline execution. Section 13.3 in "ITK Software  
Guide" gives most of the details of how the pipeline is executed.

When you call filter->Update(), the pipeline does not know what part  
of the image you are trying to update because the RequestedRegion has  
not been set.

The basic problem comex down to when filter->Update() is invoked for  
the first time the RequestedRegion is automagically set to the  
LargestPossibleRegion (which has to propagate through the pipeline in  
the UpdateOutputInformation phase of pipeline execution). When Update  
is called again, the magic does not happen a second time.


>
> I just don't see any user then writing a command that by it's name is
> asking for some other region.
>

========================================================
Bradley Lowekamp
Lockheed Martin Contractor for
Office of High Performance Computing and Communications
National Library of Medicine
blowekamp at mail.nih.gov


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20091016/74132197/attachment.htm>


More information about the Insight-developers mailing list