[Insight-developers] Calculators: Buffered or Requested regio ns?

Luis Ibanez luis . ibanez at kitware . com
Thu, 12 Jun 2003 13:39:12 -0400


Well, in many cases we use the Calculators inside filters,
as part of the computations. For example, this is done in
the RescaleIntensityImageFilter.

It is nice to allow the user of the Calculator to make the
decision as to what region should be considered for the
computation. The current flaw that Jim pointed out is that
the user doesn't have any control over the region to be
used by the calculator, and unfortunately, different
calculators use different default regions.

By adding the region as a parameter that the user can set,
and initializing this region to the "RequestedRegion()" we
could achieve both,

1) A standard default behavior
2) The versatility for controling the calculators from the outside


[We could equally well set the default region to the largest
possible region,... but in some cases this region is not
really available...]


It will be important then, to revisit all the filters that
use Calulators internally and verify that they are using the
appropiate region for their computations.



   Luis



---------------------------
Stephen R. Aylward wrote:
> With threading/streaming, how do we distinguish the two?   And we'll 
> probably want to make the default behaviour to be over the entire image.
> 
> Are they really image calculators or should we have distinct regions 
> calculators too?
> 
> Thanks,
> Stephen
> 
> Miller, James V (Research) wrote:
> 
>> Stephen,
>>
>> I think there are times when you want the min/max to be over the entire
>> image and there are times when you may want it to be computed over a
>> particular region.
>>
>> Jim
>>
>> -----Original Message-----
>> From: Stephen R. Aylward [mailto:aylward at unc . edu]
>> Sent: Thursday, June 12, 2003 12:23 PM
>> To: Luis Ibanez
>> Cc: Miller, James V (Research); Insight-developers (E-mail)
>> Subject: Re: [Insight-developers] Calculators: Buffered or Requested
>> regions?
>>
>>
>> Hi,
>>
>> I am probably being slow today....shouldn't image calculators always 
>> be over the entire image?   I think it would be confusing if the min 
>> and max for an image would seem to change if the minimummaximum 
>> calculator is called with a subregion because of threading/streaming.
>>
>> Or are we going to add logic so that min and max (for example) remain 
>> valid for an image when only a subregion is being processed by a 
>> particular thread.   Actually, can we process a thread without 
>> processing a whole image to init its min and max?
>>
>> Okay, I really am being slow and not following this.   help!  :)
>>
>> Thanks,
>> Stephen
>>
>> Luis Ibanez wrote:
>>
>>> Hi Jim,
>>>
>>> That sounds like a good idea.
>>>
>>> It will be pretty useful to select the region over which the
>>> computation is going to be performed.  We could still agree
>>> in using the RequestedRegion() as the default region.
>>>
>>>
>>>  Luis
>>>
>>>
>>>
>>> -------------------------------------
>>> Miller, James V (Research) wrote:
>>>
>>>
>>>> I was just looking through some of the calculators.  The 
>>>> MinimumMaximumImageCalculator performs its calculation across the 
>>>> RequestedRegion. The OtsuThresholdImageCalculator performs its 
>>>> calculation over the BufferedRegion.
>>>>
>>>> So there is an inconsistency here.  Besides the inconsistency, the 
>>>> Otsu method uses the MinimumMaximum to determine how to build its 
>>>> own histogram.  So the range of values for its histogram is based on 
>>>> the pixels in the RequestedRegion but it determines a threshold from 
>>>> the histogram based on the BufferedRegion.  This inconsistency could 
>>>> bias the threshold calculated.
>>>>
>>>> At a minimum, I would think the calculators should be consistent.  I 
>>>> could make a case for either region being appropriate (more than I 
>>>> want to get into here).  Perhaps the calculators should take a 
>>>> region over which to perform the calculation?
>>>>
>>>>
>>>> *Jim Miller*
>>>> */_____________________________________/*
>>>> /Visualization & Computer Vision//
>>>> /GE Research/
>>>> /Bldg. KW, Room C218B/
>>>> /P.O. Box 8, Schenectady NY 12301/
>>>>
>>>> //_millerjv at research . ge . com <mailto:millerjv at research . ge . com>_/
>>>>
>>>> /_james . miller at research . ge . com_/
>>>> /(518) 387-4005, Dial Comm: 8*833-4005, /
>>>> /Cell: (518) 505-7065, Fax: (518) 387-6981/
>>>>
>>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Insight-developers mailing list
>>> Insight-developers at www . itk . org
>>> http://www . itk . org/mailman/listinfo/insight-developers
>>
>>
>>
>>
> 
>