Dear MITK developers,

as I tried to run the exhaustive search from your rigid registration functionality last week, I had the problem that only one iteration was computet (origin position). By debugging I found out that the optimizer is initalized incorrectly in the mitkOptimizerFactory. Instead of initializing a StepsType array with the number of the axis of the given transformation and setting the number of steps the StepsType array was sized as the number of steps and initialized to 0 at all indizes by the constructor.

Please find attached a patch to initalize the number of steps and the steplength correctly (as described in the ITK software guide).

Best regards,
Matthias

--
| Dipl.-Ing. Matthias Keil
|
| Fraunhofer Institute for Computer Graphics (IGD)
| Cognitive Computing & Medical Imaging
| Fraunhoferstraße 5, 64283 Darmstadt, Germany
|
| phone  : +49 6151 155 212
| fax    : +49 6151 155 480
| mobile : +49 173 5709746
| e-mail : [email protected]
| skype  : matthias.keil.office
| web    : http://www.igd.fraunhofer.de/~makeil

Index: Core/Algorithms/mitkOptimizerFactory.cpp
===================================================================
--- Core/Algorithms/mitkOptimizerFactory.cpp    (revision 16061)
+++ Core/Algorithms/mitkOptimizerFactory.cpp    (working copy)
@@ -44,7 +44,15 @@
     {
       itk::ExhaustiveOptimizer::Pointer OptimizerPointer = 
itk::ExhaustiveOptimizer::New();
       OptimizerPointer->SetStepLength( 
m_OptimizerParameters->GetStepLengthExhaustive() );
-      OptimizerPointer->SetNumberOfSteps( 
m_OptimizerParameters->GetNumberOfStepsExhaustive() );
+      itk::ExhaustiveOptimizer::StepsType steps( m_NumberTransformParameters );
+      
+      for (int i = 0; i < m_NumberTransformParameters; i++)
+      {
+        steps[i] = m_OptimizerParameters->GetNumberOfStepsExhaustive();
+      }      
+         
+      OptimizerPointer->SetNumberOfSteps( steps );
+      
       return OptimizerPointer.GetPointer();
     }
     else if (optimizer == OptimizerParameters::GRADIENTDESCENTOPTIMIZER)
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to