From: Romulo Pinho Date: Tue, 28 Feb 2012 09:47:09 +0000 (+0100) Subject: added initial image centralization to BLUTDIR X-Git-Tag: v1.3.0~86 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=c94c334d5e6dfc9f21b545344627b63f02669751;p=clitk.git added initial image centralization to BLUTDIR --- 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(); + } //=======================================================