[Insight-users] Help using the processObject::update() method works

Luis Ibanez luis.ibanez at kitware.com
Wed Mar 2 19:55:17 EST 2005


Hi Chris,


Please look at the class hierarchy of the UnaryFunctorImageFilter

http://www.itk.org/Insight/Doxygen/html/classitk_1_1UnaryFunctorImageFilter.html

The methods

         GenerateData()

is defined as "virtual" at the level of tht itk::ProcessObject

http://www.itk.org/Insight/Doxygen/html/classitk_1_1ProcessObject.html


and the method

         ThreadedGenerateData()

are defined as "virtual" at the level of the class

    itkImageSource

http://www.itk.org/Insight/Doxygen/html/classitk_1_1UnaryFunctorImageFilter.html



ThreadedGenerateData() is invoked from the method
itk::ImageSource::ThreaderCallback(),

and

GenerateData() is invoked from the method UpdateOutputData().



in practice you don't need to worry about this.  Just create one
method GenerateData()  XOR  ThreadedGenerateData() in your filter
(note that it is an "exclusive" or, meaning that you should have
one method or the other, but NOT both).

Your method will be invoked when the user triggers the execution
of the pipeline by calling Update() in your filter.


You may want to read the Chapter on writing filters in the ITK
Software Guide


          http://www.itk.org/ItkSoftwareGuide.pdf



    Regards,



       Luis



-------------------------
tjswift at telus.net wrote:

> Hello Everyone,
> 
>     I've spent the better part of today examining the code for the 
> DeformableMesh3DFilter and the UnaryFunctorImageFilter. My current guess is 
> that DeformableMesh3DFilter::advance() and 
> UnaryFUnctorImageFilter::ThreadedGenerateData() are the two respective 
> functions that cause the bulk of the deforming/Image processing to take place. 
> Specifically in UnaryFunctorImageFilter::ThreadedGenerateData():
> 
> "while( !inputIt.IsAtEnd() ) 
>     {
>     outputIt.Set( m_Functor( inputIt.Get() ) );
>     ++inputIt;
>     ++outputIt;
>     progress.CompletedPixel();  // potential exception thrown here
>     }"
> 
> However, I can't seem to figure out for the life of me how those two methods 
> ever get ran. Consequently, I can't write my own filter/Deformable Model 
> because I don't understand how to specify which methods will be ran when update
> () is called.
> 
> I apologize if there is some document on "developing filters for itk" that I 
> should be reading, but any help would be greatly appreciated.
> 
> Thank's for your time.
> 
> -Chris
> 
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 
> 





More information about the Insight-users mailing list