[Insight-developers] Bug in ExtractImageFilter
Bradley Lowekamp
blowekamp at mail.nih.gov
Fri Oct 16 09:32:01 EDT 2009
Hello Kevin,
This is not a bug. If you change the methods used to invoke the
pipeline execution from Update to UpdateLargestPossibleRegion it
should work. It comes down to an old requested region staying around
and not being updated. So you could also use the
SetRequestedRegionToLargestPossibleRegion before each Update methods
is called.
Interestingly enough, I believe that this issue does not occur with
the writers because the writer's output is not a DataObject and the
requested region is not pipelined the same way.
In case you are curious this oddity is the result of code in
ImageBase::UpdateOutputInformation:
// Now we should know what our largest possible region is. If our
// requested region was not set yet, (or has been set to something
// invalid - with no data in it ) then set it to the largest possible
// region.
if ( this->GetRequestedRegion().GetNumberOfPixels() == 0)
{
this->SetRequestedRegionToLargestPossibleRegion();
}
Brad
On Oct 15, 2009, at 4:46 PM, Kevin H. Hobbs wrote:
> I believe there is a bug in ExtractImageFilter.
>
> The attached code demonstrates the bug.
>
> All it does is creates a small image.
> Extracts a small region.
> Extracts another small region.
>
> During the second update the extract image filter throws an exception
> and claims that the requested region is outside of the largest
> possible
> region of the input image.
>
> I'll file a bug report if you all think I should be able to change the
> region the filter extracts.
> <CMakeLists.txt><ExtractBug.cxx><signature.asc><ATT00001..txt>
========================================================
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/250bb475/attachment.htm>
More information about the Insight-developers
mailing list