Hi Ali, I don't think that there's a deficiency. I just ran the itkSyNImageRegistrationTest and added the following snippet to write the displacement field to disk starting at line 275.
typedef itk::ImageFileWriter<DisplacementFieldType> WriterType2; typename WriterType2::Pointer writer2 = WriterType2::New(); writer2->SetFileName( "/Users/ntustison/Desktop/testDisplacementField.nii.gz" ); writer2->SetInput( outputTransform->GetDisplacementField() ); writer2->Update(); The result was a non-zero displacement field that looked reasonable based on the parameters specified by the test. Nick On Dec 1, 2012, at 8:30 PM, "Ghayoor, Ali" <[email protected]> wrote: > Hello Developers, > > In a registration framework, at each iteration, I get the current moving > transform from the metric of the "itkSyNImageRegistrationMethod" filter; > however, the returned moving transform has a displacement field with all zero > values at every iteration. > > To inspect this deficiency in ITK, I used "itkSyNImageRegistrationTest.cxx", > and made some modifications in the test code for this purpose. > I added an iteration observer to the SyN registration stage: > > typedef CommandIterationUpdate<DisplacementFieldRegistrationType> > DisplacementFieldCommandType; > typename DisplacementFieldCommandType::Pointer DisplacementFieldObserver > = DisplacementFieldCommandType::New(); > displacementFieldRegistration->AddObserver( itk::IterationEvent(), > DisplacementFieldObserver ); > > Then, inside the observer class, I asked for the parameters of the moving > transform at the current iteration: > > std::cout << " parameters: " << const_cast<TFilter *>( filter > )->GetMetric()->GetMovingTransform()->GetParameters() << std::endl; > std::cout << " fixed parameters " << const_cast<TFilter *>( filter > )->GetMetric()->GetMovingTransform()->GetFixedParameters() << std::endl; > > However, the Parameters of the moving transform is an all zero valued > displacement field at each iteration. > Do you know why the registration filter does not return the right moving > transform? Could you please help about this problem. > > Thanks, > Ali > _______________________________________________ > 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://kitware.com/products/protraining.php > > 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-developers
_______________________________________________ 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://kitware.com/products/protraining.php 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-developers
