Hi, <br>I made some changes to the code,<br>and it seems as it is having better results,<br>but they are still far from the optimum.<br><br>I am using the BrainProtonDensitySlice.png and BrainProtonDensitySliceR10X13Y17S12.png from <br>
the examples data to test the algorithm.<br><br>As far as the metric parameters are concerned , I did the following changes:<br>//////////////////////<br> const unsigned int numberOfParameters = transform->GetNumberOfParameters();<br>
<br> typedef MetricType::ScalesType ScalesType;<br> ScalesType scales( numberOfParameters );<br>double t_scale;<br>double center_scale;<br> //scales.Fill( 1.0 );<br> std::cout<<" enter center_scale : ";<br>
std::cin>>center_scale; <br> std::cout<<" enter t_scale : ";<br> std::cin>>t_scale;<br> std::cout<<" enter scales[0] : "; //scaling<br> std::cin>>scales[0];<br> <br>
std::cout<<" enter scales[1] : "; //angle<br> std::cin>>scales[1];<br> <br> //const double t_scale=0.1; //translation scale<br> //scales[0] = 10.0;<br> //scales[1] = 1.0;<br> scales[2] = center_scale;<br>
scales[3] = center_scale;<br> scales[4] = t_scale;<br> scales[5] = t_scale;<br><br> <br> metric->SetDerivativeStepLengthScales(scales);<br> metric->SetDerivativeStepLength(1.0);<br><br>/////////<br>... and had some relatively (to the previous ones) good results, using:<br>
center_scale :10000,<br>t_scale: 0.1<br>scale[0] :0.1 //for scaling<br>scale[1] :1 //for the angle<br><br>Also the optimizer setting where changes to:<br><br><br> typedef OptimizerType::ScalesType OptimizerScalesType;<br>
OptimizerScalesType optimizerScales( transform->GetNumberOfParameters() );<br> const double translationScale = 1.0 / 100.0;<br> const double centerScale =1.0/100.0;<br><br> optimizerScales[0] = 10.0;<br> optimizerScales[1] = 1.0;<br>
optimizerScales[2] = centerScale;<br> optimizerScales[3] = centerScale;<br> optimizerScales[4] = translationScale;<br> optimizerScales[5] = translationScale;<br><br> optimizer->SetScales( optimizerScales );<br>
<br> double steplength = 1.0;<br> <br> if( argc > 9 )<br> {<br> steplength = atof( argv[9] );<br> }<br> optimizer->SetMaximumStepLength( steplength ); <br> optimizer->SetMinimumStepLength( 0.00001 );<br>
optimizer->SetNumberOfIterations( 500 );<br> optimizer->MaximizeOn(); //change<br>.... using step lenght=0.5<br>The algorithm exited, at iteration number 70,<br>with <br>Scale 1.00275<br>Angle (radians) -0.160493<br>
Angle (degrees) -9.19556<br>Center X = 90.318<br>Center Y = 108.849<br>Translation X=15.2579<br>Translation Y= 15.4322<br>Metric Value= 1.07114<br><br>Can I get some help , on what further changes should I do, <br>in order to get better results?<br>
I had almost optimum results working with Mattes MI, <br>Scale 0.832628<br>
Angle (radians) -0.174455<br>
Angle (degrees) -9.99554<br>
Center X = 87.1628<br>
Center Y = 107.813<br>
Translation X=7.37987<br>
Translation Y= 8.52768<br>
Metric Value= -1.42415,<br>but I want to get familiar and work with NMI.<br>What changes to the scales parameters, should I do?<br><br>Thanks in advance,<br>Giorgos<br><br><br><br><br>