[Insight-developers] Managing Abort in Filters

Bill Lorensen wlorens1@nycap.rr.com
Wed, 16 Apr 2003 18:18:22 -0400


Luis,
I added the try/catch to ProcessObject. This looks like a good place for the default behavior. I removed the default behavior from some of the filters you changed. As you correctly pointed out, special processing may be required in filters that have intermediate data or results. At least for now, all filters that use the Progress iterator will support abort.

Bill

At 04:23 PM 4/16/03 -0400, Luis Ibanez wrote:

>The Abort is implemented so far by throwing an
>exception from the ProgressReporter class.
>
>Any filter that uses the progress reporter is
>now capable of accepting an Abort request.
>
>However, any temporary memory allocated in the
>GetnerateData or ThreadedGenerateData will not
>be cleaned up.  Only a few filters has been
>visited to verify if they need to release
>memory when an abort is invoked.
>
>I looked at the option of moving the try/catch
>block to the ProcessObject and realized that
>there is nothing to do at this level except
>rethrow the exception...   since the ProcessObject
>doesn't have any knowledge nor access to the
>temporary memory that may have been allocated
>in the GenerateData() and ThreadedGenerateData()
>methods on the filters.
>
>It looks like the option is to visit all the filters,
>we may simply avoid to add try/catch blocks to the
>filters that don't allocate temporary memory....
>
>
>   Luis
>
>
>Lorensen, William E (Research) wrote:
>> Luis made a first cut the abort feature. In discussions (below) we decided
>> to move the implementation into the superclass (itkProcessObject). We have
>> not done that yet. However, Luis did do a few filters with his initial
>> approach. I don't think the API will chamge.
>>
>> As for the stability of the system. It's looking pretty good these days. I
>> would wait for a "clean" morning dahsboard, then update to that.
>>
>> Bill
>>
>> -----Original Message-----
>> From: Kurt Augustine [mailto:augustine.kurt@mayo.edu]
>> Sent: Wednesday, April 16, 2003 3:51 PM
>> To: Insight Developers List
>> Subject: RE: [Insight-developers] Managing Abort in Filters
>>
>>
>> Has this been implemented yet?  We could really use this abort feature
>> described below.  If so, is the current cvs version pretty stable (i.e. is
>> it safe to replace 1.2 for our development).
>>
>> Thanks ... Kurt
>>
>>
>>>-----Original Message-----
>>>From: Luis Ibanez [mailto:luis.ibanez@kitware.com]
>>>Sent: Friday, April 11, 2003 11:05 PM
>>>To: Lorensen, William E (Research)
>>>Cc: Miller, James V (Research); Insight Developers List
>>>Subject: Re: [Insight-developers] Managing Abort in Filters
>>>
>>>
>>>
>>>Bill,
>>>
>>>That's a good idea,
>>>
>>>I agree with you in that it is a lot of work to add
>>>the try/catch to all the filters. It actually takes
>>>away the simplicity + elegance of some filters...
>>>
>>>I'll move the exception to the call of GenerateData
>>>in ProcessObject, and double check the behavior
>>>in the filters that need clean up.
>>>
>>>This will be done progressively...
>>>
>>>
>>>Luis
>>>
>>>
>>>---------
>>>Lorensen, William E (Research) wrote:
>>>
>>>>Luis,
>>>>Why not move the try/catch and the if(abort generate data) code into
>>>>itkProcessObject.cxx. The try/catch would go around the
>>>
>>>GenerateData in
>>>
>>>>ProcessObject.
>>>>
>>>>Then, be default, every filter would support abort. If a
>>>
>>>filter needed to
>>>
>>>>modify the default behavior
>>>>
>>>>1) to clean up intermediate data. Then it could try/catch,
>>>
>>>clean up its data
>>>
>>>>and rethrow.
>>>>2) to produce intermediate results. It could try/catch,
>>>
>>>reset the Abort flag
>>>
>>>>and continue.
>>>>
>>>>It seems like a lot of work to add the current code to all
>>>
>>>filters since
>>>
>>>>most will use the default behavior.
>>>>
>>>>Bill
>>>>
>>>
>>>_______________________________________________
>>>Insight-developers mailing list
>>>Insight-developers@public.kitware.com
>>>http://public.kitware.com/mailman/listinfo/insight-developers
>>>
>>
>> _______________________________________________
>> Insight-developers mailing list
>> Insight-developers@public.kitware.com
>> http://public.kitware.com/mailman/listinfo/insight-developers
>> _______________________________________________
>> Insight-developers mailing list
>> Insight-developers@public.kitware.com
>> http://public.kitware.com/mailman/listinfo/insight-developers
>>
>
>
>
>
>_______________________________________________
>Insight-developers mailing list
>Insight-developers@public.kitware.com
>http://public.kitware.com/mailman/listinfo/insight-developers