[Insight-users] ::UpdateOutputData() when running the image registration process.

Luis Ibanez luis.ibanez at kitware.com
Fri Nov 6 07:38:28 EST 2009


Hi Motes,

This is not an error.

The ITK pipeline is designed to ensure that a filter is
run only once, *except* if in between the runs, any of
its parameters have changed.

In your particular case you are re-running the filter
for the purpose of profiling it, so you could "force"
it to rerun by calling:

                 registration->Modified();

before you call

                 registration->Update();


This will make the filter think that one (or more) of its
input parameters have changed, and that therefore,
the filter should be executed again.


      Regards,


            Luis


---------------------------------------------------------------------------------
On Mon, Nov 2, 2009 at 2:57 PM, motes motes <mort.motes at gmail.com> wrote:
> In an application I call Update() on the image registration method
> multiple times:
>
>
>    for (int i=0; i<runs; i++) {
>      itkProbesStart("Registration");
>      run();
>      itkProbesStop("Registration");
>      itkProbesReport( std::cout );
>
> }
>
>
>
>  int run() {
>    std::cout << std::endl << "[INFO]::Starting Registration" << std::endl;
>    try {
>      registration->Update();
>    }
>    catch( itk::ExceptionObject & err ) {
>      std::cerr << "ExceptionObject caught !" << std::endl;
>      std::cerr << err << std::endl;
>      return EXIT_FAILURE;
>    }
>    return EXIT_SUCCESS;
>  }
>
>
> But the second time run() is called the Update() method returns before
> the image registration process is even started. I have narrowed the
> "error" down to:
>
> DataObject
> ::UpdateOutputData()
> {
>  // If we need to update due to PipelineMTime, or the fact that our
>  // data was released, then propagate the UpdateOutputData to the source
>  // if there is one.
>  if ( m_UpdateMTime < m_PipelineMTime || m_DataReleased ||
>       this->RequestedRegionIsOutsideOfTheBufferedRegion() )
>    {
>    if ( m_Source )
>      {
>      m_Source->UpdateOutputData(this);
>      }
>    }
> }
>
>
>
> The if-statement:
>
>  if ( m_UpdateMTime < m_PipelineMTime || m_DataReleased ||
>       this->RequestedRegionIsOutsideOfTheBufferedRegion() )
>
>
>  never evals to true the second time and therefore the image
> registration method is never started.
>
>
> Any ideas on why I cannot run Update() on the image registration
> method multiple times?
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>


More information about the Insight-users mailing list