<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7226.0">
<TITLE>Confusion about update sequence and required region</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<BR>

<P><FONT SIZE=2>Hi everyone:<BR>
I want to have a region extracted from a larger image, and to have subsampled images of this region at some different resolutions. However, I keep getting 'invalid region request' exeptions on the second time I subsample the extracted region.<BR>
How should the required region be re-set? it always works the first time no matter what the value of r_iter, within reason (2-16, even integers) so I guess that some region from the first time through is propagated to the second time<BR>
<BR>
<BR>
Here is simplified code I used to test without all teh other stuff going on . I am pretty sure the region extraction has worked correctly so that inputImage is a valid ImageType::Pointer<BR>
<BR>
Thanks<BR>
Robert<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
typedef itk::ShrinkImageFilter&lt;ImageType,ImageType&gt; ShrinkerType;<BR>
...<BR>
&nbsp;ShrinkerType::Pointer fshrinker = ShrinkerType::New ();<BR>
&nbsp;r_iter = 4;<BR>
...<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fshrinker-&gt;SetShrinkFactors (r_iter);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fshrinker-&gt;SetInput (inputImage);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fshrinker-&gt;Update ();<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } catch (itk::ExceptionObject &amp; err) {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; &quot;ExceptionObject caught fshrinker !&quot; &lt;&lt; std::endl;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; fshrinker &lt;&lt; std::endl;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; &quot;Quitting&quot; &lt;&lt; std::endl;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; err &lt;&lt; std::endl;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return -1;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fshrinker-&gt;SetShrinkFactors (r_iter &gt;&gt; 1);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fshrinker-&gt;SetInput (inputImage);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fshrinker-&gt;Update ();<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } catch (itk::ExceptionObject &amp; err) {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; &quot;ExceptionObject caught fshrinker 2 !&quot; &lt;&lt; std::endl;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; fshrinker &lt;&lt; std::endl;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; &quot;Quitting&quot; &lt;&lt; std::endl;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; err &lt;&lt; std::endl;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return -1;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>
<BR>
...<BR>
<BR>
<BR>
Output<BR>
ExceptionObject caught fshrinker 2 !<BR>
ShrinkImageFilter (0x85422f0)<BR>
&nbsp; RTTI typeinfo:&nbsp;&nbsp; itk::ShrinkImageFilter&lt;itk::Image&lt;float, 3u&gt;, itk::Image&lt;float, 3u&gt; &gt;<BR>
&nbsp; Reference Count: 2<BR>
&nbsp; Modified Time: 370<BR>
&nbsp; Debug: Off<BR>
&nbsp; Observers:<BR>
&nbsp;&nbsp;&nbsp; none<BR>
&nbsp; Number Of Required Inputs: 1<BR>
&nbsp; Number Of Required Outputs: 1<BR>
&nbsp; Number Of Threads: 2<BR>
&nbsp; ReleaseDataFlag: Off<BR>
&nbsp; ReleaseDataBeforeUpdateFlag: Off<BR>
&nbsp; Input 0: (0x8520490)<BR>
&nbsp; Output 0: (0x85449c0)<BR>
&nbsp; AbortGenerateData: Off<BR>
&nbsp; Progress: 1<BR>
&nbsp; Multithreader:<BR>
&nbsp;&nbsp;&nbsp; RTTI typeinfo:&nbsp;&nbsp; itk::MultiThreader<BR>
&nbsp;&nbsp;&nbsp; Reference Count: 1<BR>
&nbsp;&nbsp;&nbsp; Modified Time: 90<BR>
&nbsp;&nbsp;&nbsp; Debug: Off<BR>
&nbsp;&nbsp;&nbsp; Observers:<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; none<BR>
&nbsp;&nbsp;&nbsp; Thread Count: 2<BR>
&nbsp;&nbsp;&nbsp; Global Maximum Number Of Threads: 0<BR>
&nbsp; Shrink Factor: 2 2 2<BR>
<BR>
Quitting<BR>
<BR>
itk::InvalidRequestedRegionError (0x8562e00)<BR>
Location: &quot;virtual void itk::DataObject::PropagateRequestedRegion()&quot;<BR>
File: /sources/local/ITK_cvs/Code/Common/itkDataObject.cxx<BR>
Line: 397<BR>
Description: Requested region is (at least partially) outside the largest possible region.<BR>
<BR>
<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>