[Insight-developers] Events in Filters

Holmes, David R., Ph.D. Holmes.David3@mayo.edu
Mon, 14 Apr 2003 10:55:26 -0500


Jim & Luis-

Thanks for the help and for the tip.  I looked into the filter watcher and tried it on two of the filters.  They both worked.  I am very pleased to see that the events are in there.

I obviously misread (or incorrectly assessed) the itkEventObject.h file.  It seems that most events are derived from the AnyEvent, but for some reason the AnyEvent is not handled the same way the other events are.  Although I don't have time now, I may look into that later because I do think that you may want to observer all of the Events derived from AnyEvent without separate methods for each.

Nevertheless, you have now pointed my in the right direction.  I will provide feedback about the filters that are working and not working.  There is a good chance that I will be reviewing many filters, so hopefully the feedback will be very helpful.

Thanks again

david

====================================================================
David R Holmes III                            holmes.david3@mayo.edu
Mayo Foundation                                 voice: (507)538-5503
Rochester, MN                                     fax: (507)284-9171
====================================================================

>  -----Original Message-----
>  From: Miller, James V (Research) [mailto:millerjv@crd.ge.com]
>  Sent: Sunday, April 13, 2003 8:50 PM
>  To: 'Holmes, David R., Ph.D.'; 'Insight Developers List '
>  Subject: RE: [Insight-developers] Events in Filters
>  
>  I am suprised that you are not getting Start and End events since they
>  are handled by the pipeline and not by a filter itself.
>  
>  But I have never tried to observer itk::AnyEvent().  I have used the
>  FilterWatcher object in Testing/Code/BasicFilters/itkFilterWatcher.h
>  on a number of filters.
>  
>  
>  
>  
>  > -----Original Message-----
>  > From: Holmes, David R., Ph.D. [mailto:Holmes.David3@mayo.edu]
>  > Sent: Friday, April 11, 2003 5:17 PM
>  > To: 'Insight Developers List '
>  > Subject: [Insight-developers] Events in Filters
>  >
>  >
>  > Hi all-
>  >
>  > I have been looking into the ITK Observer/Event Paradigm for
>  > our work with Analyze.  I have a feeling that I am doing
>  > something completely wrong.
>  >
>  > So, I setup a simple FilterObserver which simply executes:
>  >
>  > void FilterObserver::Execute(const itk::Object * object,
>  > const itk::EventObject & event)
>  > {
>  > cout << "Here: ";
>  > event.Print(cout);
>  >
>  > }
>  >
>  > And in my filter code, I put a:
>  >
>  > //	Define Observer Object
>  > 	FilterObserver::Pointer observer = FilterObserver::New();
>  > 	myFilter->AddObserver( itk::AnyEvent(), observer );
>  >
>  >
>  > And then I ran several different filters.  I am mostly
>  > interested in the Progess Events because few of the filters
>  > are iterative, but still curious about other events.
>  > Unfortunately, none of the filters that I tried are
>  > generating Progress events.  Actually, from what I can tell,
>  > they are only generating modified events and delete events,
>  > so no Start or End Events either.  Here are the filters that I tried:
>  >
>  > Bilateral
>  > BinomialBlur
>  > CurvatureAnisotropicDiffusion
>  > CurvatureFlow
>  > DiscreteGaussian
>  > MinMaxCurvatureFlow
>  > DanielssonDistanceMap
>  > DerivativeFilter
>  > ZeroCrossingBasedEdgeDetection
>  >
>  > I realize that this is a small subset of filters, but rather
>  > than moving forward, I thought that I'd ask what I was doing wrong.
>  >
>  > Thanks
>  >
>  > david
>  > _______________________________________________
>  > Insight-developers mailing list
>  > Insight-developers@public.kitware.com
>  > http://public.kitware.com/mailman/listinfo/insight-developers
>  >