From c94c334d5e6dfc9f21b545344627b63f02669751 Mon Sep 17 00:00:00 2001 From: Romulo Pinho Date: Tue, 28 Feb 2012 10:47:09 +0100 Subject: [PATCH] added initial image centralization to BLUTDIR --- registration/clitkBLUTDIRGenericFilter.cxx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/registration/clitkBLUTDIRGenericFilter.cxx b/registration/clitkBLUTDIRGenericFilter.cxx index ca10c2d..9f808e7 100644 --- a/registration/clitkBLUTDIRGenericFilter.cxx +++ b/registration/clitkBLUTDIRGenericFilter.cxx @@ -29,7 +29,8 @@ It is distributed under dual licence #include "clitkBLUTDIRGenericFilter.h" #include "clitkBLUTDIRCommandIterationUpdateDVF.h" - +#include "itkCenteredTransformInitializer.h" + namespace clitk { @@ -495,6 +496,20 @@ namespace clitk itk::Vector finalTranslation = clitk::GetTranslationPartMatrix3D(rigidTransformMatrix); rigidTransform->SetTranslation(finalTranslation); } + else + { + if(m_Verbose) std::cout<<"No itinial matrix given. Centering all images..."< TransformInitializerType; + typename TransformInitializerType::Pointer initializer = TransformInitializerType::New(); + initializer->SetTransform( rigidTransform ); + initializer->SetFixedImage( fixedImage ); + initializer->SetMovingImage( movingImage ); + initializer->GeometryOn(); + initializer->InitializeTransform(); + } //======================================================= -- 2.47.1