[Insight-developers] Managing Abort in Filters

Joshua Cates cates@sci.utah.edu
Tue, 8 Apr 2003 11:32:06 -0600 (MDT)


Hi Luis,

Why not have the user handle this exception?  If a filter is aborted then
it cannot produce a correct output and the user must then decide how to
proceed.

Josh.

On Tue, 8 Apr 2003, Luis Ibanez wrote:

> Hi,
> 
> The following approach for managing Abort calls
> has been added (tentatively) to filters:
> 
> 1) The ProgressReporter tests for the
>       AbortGenerateData flag after calling
>       ProgressUpdate(). That gives the user
>       a chance to click in an "Abort/Cancel"
>       button when the GUI is refreshed after
>       the progress update.
> 
> 2) If the progress reporter finds the AbortGenerateData
>      flag ON, it throws a (newly added to the toolkit)
>      "ProgessAborted" exception.
> 
> 3) Filters should catch this "ProgressAborted" exception
>      outside the outer loop of their GenerateData() and
>      ThreadedGenerateData() methods.
> 
> 
> 
> This logic has been added to the following
> filter classes:
> 
> 
>     - UnaryFunctorImageFilter
>     - BinaryFunctorImageFilter
>     - TernaryFunctorImageFilter
>     - MedianImageFilter
> 
> The first three cover most of the pixel-wise filters.
> 
> 
> 
>    Luis
> 
> 
> 
> _______________________________________________
> Insight-developers mailing list
> Insight-developers@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-developers
>