[Insight-developers] Managing Abort in Filters

Luis Ibanez luis.ibanez@kitware.com
Tue, 08 Apr 2003 10:35:33 -0400


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