[Insight-users] Filter and SetRequestedRegion

Arnaud Garcia arnaud.garcia at sim.hcuge.ch
Sat Mar 11 09:45:32 EST 2006


Hi all,

Is there a simple filter in ITK that take image with a RequestedRegion ?

I did a simple filter by implemented the GenerateData methods, but now I 
want to set a BoundingBox so I set a RequestedRegion in my InputImage 
but the requestedImage region is lost in my GenerateDate (the 
requestedRegion is replaced by the LargestPossibleRegion !) ...

I also overide the GenerateInputRequestedRegion and 
EnlargeOutputRequestedRegion  as below but no change ... I still lost my 
RequestedRegion of my InputImage in my Filter ...


thanks,
Arnaud


---------------------------------------------------------------------
GenerateInputRequestedRegion ()
{
    Superclass::GenerateInputRequestedRegion ();
    if (this->GetInput ())
    {
        InputImagePointer image = const_cast < InputImageType * 
 >(this->GetInput ());
    //    image->SetRequestedRegionToLargestPossibleRegion ();
    image->SetRequestedRegion( image->GetRequestedRegion());
    }

:EnlargeOutputRequestedRegion (DataObject * output)
{
    Superclass::EnlargeOutputRequestedRegion (output);
    //output->SetRequestedRegionToLargestPossibleRegion ();
    this->GetOutput()->SetRequestedRegion( 
this->GetOutput()->GetRequestedRegion() );





More information about the Insight-users mailing list