[Insight-developers] RequestedRegion are modified when calling itk filters (2)

Arnaud Garcia arnaud.garcia at sim.hcuge.ch
Wed Mar 15 06:45:02 EST 2006


no problem for the noise espcially with a gaussian filter problem ;-)

I think There is something not clear with the use of RequestedRegion.
To my understanding I thought, that If I want a bounding box, because I 
don't want to use my ITK filter on the LargestPossibleRegion I could 
just set:
myImage->SetRequestedRegion (myBoundingBoxRegion), but luis seems to say 
(if I am right understand) that the requestedRegion is a kind of 
internal parameters for the filters pipeline ...
But I thought that I you set a requestedRegion, Automatically the filter 
use it, because most of the time in the filters we use 
image->GetRequestedRegion ...

But, As I said most of the time the RequestedRegion is overidden by the 
largestPossibleRegion and If you want to add a bounding Box you have to 
set it by calling
a function like  SetRegion ... as we do with the: 
itk::MinimumMaximumImageCalculator


so ?

Arnaud


Karthik Krishnan a écrit :

>
>
> Karthik Krishnan wrote:
>
>> What I meant was: what if I want to put the filter in a pipeline and 
>> just have my application run on an interactive user chosen VOI. I 
>> would need to use crop filters etc ?
>> It could run the separable gaussian filters on the requested region 
>> instead of the whole region.
>>
>> If I did want it to run on the whole image, I could always say: 
>> UpdateLargestPossibleRegion().  But there is no way I can have it 
>> update on just a defined image region.
>>
> Correcting myself:
> I guess I could say :
>
> filter->GetInput()->SetLargestPossibleRegion()->( voiRegion );
> filter->Update();
>
> and have it work.
>
> sorry for the noise
> -karthik
>
>> -karthik
>>
>> Luis Ibanez wrote:
>>
>>>
>>> Hi Arnaud,
>>>
>>> The Recursive Gaussian image filter needs the entire image as
>>> input because it is implemented using IIR separable filters.
>>>
>>> IIR filters have infinite support and therefore cannot be
>>> computed using pieces of the image.  A better understanding
>>> of this implementation can be gained by looking at how it
>>> is expressed in the Z transform space.
>>>
>>>
>>> You may want to read the report by Rachid Deriche:
>>>
>>> "Recursively Implementing The Gaussian and Its Derivatives",
>>> INRIA, 1993,
>>> ftp://ftp.inria.fr/INRIA/tech-reports/RR/RR-1893.ps.gz
>>>
>>>
>>> Where these filters were originally proposed.
>>>
>>>
>>>
>>>
>>>    Regards,
>>>
>>>
>>>
>>>        Luis
>>>
>>>
>>> ------------------------
>>> Karthik Krishnan wrote:
>>>
>>>>
>>>>
>>>> Arnaud Garcia wrote:
>>>>
>>>>> Hi itk developers,
>>>>>
>>>>> It seems that most itk filters change the RequestedRegion when 
>>>>> calling them ...
>>>>> Some filters overide  the GenerateInputRequestedRegion with  
>>>>> something like:
>>>>>
>>>>> SetRequestedRegion( input->GetLargestPossibleRegion() );
>>>>>
>>>>>
>>>>>
>>>>> => So if you set your requested region and call such filters you 
>>>>> have to set it again after calling theses filters ...
>>>>>
>>>>> is it right ?
>>>>>
>>>> Yes. This is the expected behaviour since if you use such a filter 
>>>> in a pipeline and the filter needs the whole input to process, it 
>>>> must make such a request to those filters on its upstream. That 
>>>> said, such a request will not be propagated downstream. For 
>>>> instance if you use
>>>>
>>>> A --> B --> C
>>>> and B needs the whole input to process.
>>>>
>>>> C->SetRequestedRegion( ... )
>>>> C->Update();
>>>>
>>>> This should set the requested regions of A's input and B's input to 
>>>> the whole image, but C's input's requested region should stay 
>>>> unchanged.
>>>>
>>>> That said, there are a good number of filters that require the 
>>>> whole input to process, either because they do, or in some cases 
>>>> the filter is not well written to handle them.
>>>>
>>>> For instance RecursiveSeparableGaussianFilter: I am not sure why 
>>>> the filter must make an assumption that it requires the entire 
>>>> input. It doesn't sound reasonable. Maybe the others have something 
>>>> to say about it.
>>>>
>>>> -karthik
>>>>
>>>>> thanks for answer,
>>>>>
>>>>> Arnaud
>>>>>
>>>>> _______________________________________________
>>>>> Insight-developers mailing list
>>>>> Insight-developers at itk.org
>>>>> http://www.itk.org/mailman/listinfo/insight-developers
>>>>>
>>>> _______________________________________________
>>>> Insight-developers mailing list
>>>> Insight-developers at itk.org
>>>> http://www.itk.org/mailman/listinfo/insight-developers
>>>>
>>>>
>>>
>>>
>> _______________________________________________
>> Insight-developers mailing list
>> Insight-developers at itk.org
>> http://www.itk.org/mailman/listinfo/insight-developers
>>
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers
>



More information about the Insight-developers mailing list