[Insight-users] Confusion about update sequence and required
region
Andinet Enquobahrie
andinet.enqu at kitware.com
Wed Feb 1 16:47:57 EST 2006
Hi Robert,
Thank you for the detailed description of the bug in ShrinkImageFilter.
As documented in itk::ProcessObject header file, a second call of
Update() doesn't update the OutputRequestedRegion correctly and
consequently it resulted in "InvalidRequestedRegion" error in your case...
Again as indicated in the same documentation, one work around is to use
UpdateLargestPossibleRegion() instead of Update() for a second call.
However, Luis and I discussed about it, and we thought that it would be
more elegant to still be able to invoke Update() to update the pipeline
for a second time and get the correct output requested region.We
figured out that this is possible by defining the
"EnlargeOutputRequestedRegion" in ShrinkImageFilter similar to
itk::RegionOfInterestImageFilter.
We have committed this change to the cvs version. Please, update your
version and give it a try and let us know if it solves your problem.
-Andinet
>
> 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.
>
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Insight-users mailing list
>Insight-users at itk.org
>http://www.itk.org/mailman/listinfo/insight-users
>
>
More information about the Insight-users
mailing list