<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div>Hi,<br><br> I'm trying to debug my rigid registration program and the first step is to reduce the number of iterations.<br>So I set it to 0, but when I execute my program it still shows me several iterations. Any clue as to why this might be happening ?<br><br>Here is the output of the optimizer (segment 1). As you can see, NumberOfIterations = 0 . The StopCondition which I thought would be 0 is 5. So based on this and other experiments, I have a few questions.<br><br>1. Shouldn't the StopCondition be 0 ?<br>2. If optimizer->SetNumberOfIterations(0), then what do the following iterations represent and where do they come from ?<br>3. Also, it I set the NumberOfIterations to some otehr number such as 100000, it still performs 500 iterations (the default value from
the example programs)<br>4. The Mean Square error metric that I compute on Binarized input images is the same as that computed on grayscale images. So what I am doing here is that I convert the grayscale images to binary. ie. Every tissue, except bone is black. Then I use these binary images for registration. The metric value returned by the registration process is compared against the metric value obtained by applying the same transform on original grayscale images and checking the mean squared error. Surprisingly these two values are EXACTLY the same. I expect them to be different for obvious reasons.<br>The way I compute the metric on the original grayscale images is shown below under segment 2<br><br><br>What is going on ?<br><br>Any clue ?<br><br>Thanks in advance<br>Emma<br><br><br>SEGMENT 1<br>---------------<br>VersorRigid3DTransformOptimizer (019220B8)<br> RTTI typeinfo: class itk::VersorRigid3DTransformOptimizer<br>
Reference Count: 2<br> Modified Time: 874<br> Debug: Off<br> Observers:<br> none<br> InitialPosition: []<br> CurrentPosition: []<br> Scales: [1, 1, 1, 0.001, 0.001, 0.001]<br> MaximumStepLength: 0.2<br> MinimumStepLength: 0.001<br> RelaxationFactor: 0.5<br> GradientMagnitudeTolerance: 0.1<br> NumberOfIterations: 0<br> CurrentIteration: 0<br> Value: 0<br> Maximize: 0<br> CostFunction: (None)<br> CurrentStepLength: 0<br> StopCondition: 5<br> Gradient: []<br>0 1976.47 [0.000460224, -0.0157202, -0.041473, -6.58714, -9.17326, 0.231981]<br><br>1 669.48 [0.00152886, 0.00402301, -0.0345613, -6.60421, -9.36806, 0.229234]<br>2 576.079 [-0.000710302, -0.0100887, -0.0583703, -6.5576, -9.55443, 0.227974<br>]<br>3 895.329 [0.0024751, 0.017149,
-0.0188799, -6.6526, -9.70157, 0.236332]<br>4 1454.49 [0.000779181, 0.00262768, -0.0415692, -6.57818, -9.73974, 0.226865<br>]<br>5 208.619 [-0.000462126, -0.00352645, -0.0488536, -6.56913, -9.83714, 0.2190<br>21]<br>6 320.494 [0.00156166, 0.00864248, -0.0314357, -6.61138, -9.91627, 0.207684]<br><br>7 724.278 [0.000322199, -0.00121238, -0.0455856, -6.58293, -9.93788, 0.20247<br>4]<br>8 143.422 [0.000259716, 0.00266556, -0.0399937, -6.59857, -9.98223, 0.192322<br>]<br>9 223.3 [-0.000310048, -0.004876, -0.0507685, -6.57875, -10.018, 0.180773]<br>10 419.74 [0.00029441, 5.14277e-005, -0.0436893, -6.59453, -10.026, 0.177275<br>]<br>1<br>.......<br><br><br><br><br>SEGMENT 2<br><br>MetricType::Pointer metricOrig
= MetricType::New(); <br><br> metricOrig->SetInterpolator(interpolator);<br> metricOrig->SetTransform(transform);<br> metricOrig->SetFixedImage(fixedImageReaderOrig->GetOutput());<br> metricOrig->SetMovingImage(movingImageReaderOrig->GetOutput());<br> metricOrig->SetTransformParameters(finalParameters); <br> MetricType::TransformParametersType finalParam = registration->GetLastTransformParameters();<br> <br> std::cout<<" MetricOnOriginalImage = "<<metric->GetValue(finalParam)<<std::endl;<br><br><br><br><br><br></div></div><br>
<hr size=1>Fussy? Opinionated? Impossible to please? Perfect. <a href="http://us.rd.yahoo.com/evt=48516/*http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 ">Join Yahoo!'s user panel</a> and lay it on us.
</body></html>