#include "clitkBLUTDIRGenericFilter.h"
#include "clitkBLUTDIRCommandIterationUpdateDVF.h"
-
+#include "itkCenteredTransformInitializer.h"
+
namespace clitk
{
itk::Vector<double,3> finalTranslation = clitk::GetTranslationPartMatrix3D(rigidTransformMatrix);
rigidTransform->SetTranslation(finalTranslation);
}
+ else
+ {
+ if(m_Verbose) std::cout<<"No itinial matrix given. Centering all images..."<<std::endl;
+
+ rigidTransform=RigidTransformType::New();
+
+ typedef itk::CenteredTransformInitializer<RigidTransformType, FixedImageType, MovingImageType > TransformInitializerType;
+ typename TransformInitializerType::Pointer initializer = TransformInitializerType::New();
+ initializer->SetTransform( rigidTransform );
+ initializer->SetFixedImage( fixedImage );
+ initializer->SetMovingImage( movingImage );
+ initializer->GeometryOn();
+ initializer->InitializeTransform();
+ }
//=======================================================