<!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<ImageType,ImageType> ShrinkerType;<BR>
...<BR>
ShrinkerType::Pointer fshrinker = ShrinkerType::New ();<BR>
r_iter = 4;<BR>
...<BR>
<BR>
fshrinker->SetShrinkFactors (r_iter);<BR>
fshrinker->SetInput (inputImage);<BR>
<BR>
try {<BR>
fshrinker->Update ();<BR>
} catch (itk::ExceptionObject & err) {<BR>
std::cerr << "ExceptionObject caught fshrinker !" << std::endl;<BR>
std::cerr << fshrinker << std::endl;<BR>
std::cerr << "Quitting" << std::endl;<BR>
std::cerr << err << std::endl;<BR>
return -1;<BR>
}<BR>
<BR>
fshrinker->SetShrinkFactors (r_iter >> 1);<BR>
fshrinker->SetInput (inputImage);<BR>
try {<BR>
fshrinker->Update ();<BR>
} catch (itk::ExceptionObject & err) {<BR>
std::cerr << "ExceptionObject caught fshrinker 2 !" << std::endl;<BR>
std::cerr << fshrinker << std::endl;<BR>
std::cerr << "Quitting" << std::endl;<BR>
std::cerr << err << std::endl;<BR>
return -1;<BR>
}<BR>
<BR>
...<BR>
<BR>
<BR>
Output<BR>
ExceptionObject caught fshrinker 2 !<BR>
ShrinkImageFilter (0x85422f0)<BR>
RTTI typeinfo: itk::ShrinkImageFilter<itk::Image<float, 3u>, itk::Image<float, 3u> ><BR>
Reference Count: 2<BR>
Modified Time: 370<BR>
Debug: Off<BR>
Observers:<BR>
none<BR>
Number Of Required Inputs: 1<BR>
Number Of Required Outputs: 1<BR>
Number Of Threads: 2<BR>
ReleaseDataFlag: Off<BR>
ReleaseDataBeforeUpdateFlag: Off<BR>
Input 0: (0x8520490)<BR>
Output 0: (0x85449c0)<BR>
AbortGenerateData: Off<BR>
Progress: 1<BR>
Multithreader:<BR>
RTTI typeinfo: itk::MultiThreader<BR>
Reference Count: 1<BR>
Modified Time: 90<BR>
Debug: Off<BR>
Observers:<BR>
none<BR>
Thread Count: 2<BR>
Global Maximum Number Of Threads: 0<BR>
Shrink Factor: 2 2 2<BR>
<BR>
Quitting<BR>
<BR>
itk::InvalidRequestedRegionError (0x8562e00)<BR>
Location: "virtual void itk::DataObject::PropagateRequestedRegion()"<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>