[Insight-users] Confusion about update sequence and required region
Atwood, Robert C
r.atwood at imperial.ac.uk
Tue Jan 31 19:16:25 EST 2006
Hi everyone:
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.
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
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
Thanks
Robert
typedef itk::ShrinkImageFilter<ImageType,ImageType> ShrinkerType;
...
ShrinkerType::Pointer fshrinker = ShrinkerType::New ();
r_iter = 4;
...
fshrinker->SetShrinkFactors (r_iter);
fshrinker->SetInput (inputImage);
try {
fshrinker->Update ();
} catch (itk::ExceptionObject & err) {
std::cerr << "ExceptionObject caught fshrinker !" << std::endl;
std::cerr << fshrinker << std::endl;
std::cerr << "Quitting" << std::endl;
std::cerr << err << std::endl;
return -1;
}
fshrinker->SetShrinkFactors (r_iter >> 1);
fshrinker->SetInput (inputImage);
try {
fshrinker->Update ();
} catch (itk::ExceptionObject & err) {
std::cerr << "ExceptionObject caught fshrinker 2 !" << std::endl;
std::cerr << fshrinker << std::endl;
std::cerr << "Quitting" << std::endl;
std::cerr << err << std::endl;
return -1;
}
...
Output
ExceptionObject caught fshrinker 2 !
ShrinkImageFilter (0x85422f0)
RTTI typeinfo: itk::ShrinkImageFilter<itk::Image<float, 3u>, itk::Image<float, 3u> >
Reference Count: 2
Modified Time: 370
Debug: Off
Observers:
none
Number Of Required Inputs: 1
Number Of Required Outputs: 1
Number Of Threads: 2
ReleaseDataFlag: Off
ReleaseDataBeforeUpdateFlag: Off
Input 0: (0x8520490)
Output 0: (0x85449c0)
AbortGenerateData: Off
Progress: 1
Multithreader:
RTTI typeinfo: itk::MultiThreader
Reference Count: 1
Modified Time: 90
Debug: Off
Observers:
none
Thread Count: 2
Global Maximum Number Of Threads: 0
Shrink Factor: 2 2 2
Quitting
itk::InvalidRequestedRegionError (0x8562e00)
Location: "virtual void itk::DataObject::PropagateRequestedRegion()"
File: /sources/local/ITK_cvs/Code/Common/itkDataObject.cxx
Line: 397
Description: Requested region is (at least partially) outside the largest possible region.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20060201/5b882395/attachment.html
More information about the Insight-users
mailing list