<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV>Dear All,</DIV>
<DIV> </DIV>
<DIV>Here is a piece of code that I have written to estimate accuracy of demons registration. The code reads index of the landmark points on fixed and moving image from a file and calculates reference vectors. Accuracy is calculated by taking difference between reference vector field and vector field generated by demons at fixed landmark position. Qualitativly or visually the registration results look good (deformed moving image overlaid on to fixed image). However the components of error vector are very high. Is there any coding errors ?</DIV>
<DIV> </DIV><FONT size=2>
<DIV>FILE *read_fixed_landmarks = fopen(argv[7],</FONT><FONT color=#800000 size=2><FONT color=#800000 size=2>"rt"</FONT></FONT><FONT size=2>);</DIV>
<DIV>FILE *read_moving_landmarks = fopen(argv[8],</FONT><FONT color=#800000 size=2><FONT color=#800000 size=2>"rt"</FONT></FONT><FONT size=2>);</DIV>
<DIV>FILE *error_file = fopen(argv[9],</FONT><FONT color=#800000 size=2><FONT color=#800000 size=2>"w"</FONT></FONT><FONT size=2>);</DIV>
<DIV></DIV>
<DIV> </DIV>
<DIV>VectorType est_displacement;</DIV>
<DIV>VectorType ref_displacement;</DIV>
<DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2></FONT></FONT> </DIV>
<DIV><FONT color=#0000ff size=2><FONT color=#0000ff size=2>double</FONT></FONT><FONT size=2> error[3];</DIV>
<DIV></FONT><FONT size=2>;</DIV>
<DIV></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2> </DIV></FONT></FONT><FONT size=2>
<DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>while</FONT></FONT><FONT size=2> (!feof(read_fixed_landmarks) && !feof(read_moving_landmarks))</DIV>
<DIV>{</DIV>
<DIV></DIV>
<DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>float</FONT></FONT><FONT size=2> fixed_x, fixed_y, fixed_z;</DIV>
<DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>float</FONT></FONT><FONT size=2> moving_x, moving_y, moving_z;</FONT></DIV>
<DIV><FONT size=2> </DIV>
<DIV>fscanf(read_fixed_landmarks,</FONT><FONT color=#800000 size=2><FONT color=#800000 size=2>"%f %f %f\n"</FONT></FONT><FONT size=2>, &fixed_x, &fixed_y, &fixed_z);</DIV>
<DIV>fscanf(read_moving_landmarks,</FONT><FONT color=#800000 size=2><FONT color=#800000 size=2>"%f %f %f\n"</FONT></FONT><FONT size=2>, &moving_x, &moving_y, &moving_z);</DIV>
<DIV></DIV>
<DIV> </DIV>
<DIV>DeformationFieldType::IndexType index;</DIV>
<DIV>index[0] = fixed_x;</DIV>
<DIV>index[1] = fixed_y;</DIV>
<DIV>index[2] = fixed_z;</DIV>
<DIV></FONT>
<DIV><FONT color=#008000 size=2><FONT color=#008000 size=2></DIV></FONT></FONT><FONT size=2>est_displacement = field->GetPixel(index);</DIV>
<DIV>ref_displacement[0] = moving_x*moving_spacing[0]- fixed_x*fixed_spacing[0];</DIV>
<DIV>ref_displacement[1] = moving_y*moving_spacing[1]- fixed_y*fixed_spacing[1];</DIV>
<DIV>ref_displacement[2] = moving_z*moving_spacing[2]- fixed_z*fixed_spacing[2];</DIV>
<DIV> </DIV>
<DIV>error[0] = est_displacement[0]- ref_displacement[0];</DIV>
<DIV>error[1] = est_displacement[1]- ref_displacement[1];</DIV>
<DIV>error[2] = est_displacement[2]- ref_displacement[2];</DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV> </DIV>
<DIV>}</DIV>
<DIV> </DIV>
<DIV>Thank you in advance</DIV>
<DIV>Yogish Mallya</DIV></FONT></td></tr></table><br>
<!--3--><hr size=1></hr> Explore and discover exciting holidays and getaways with Yahoo! India Travel <a href="http://in.rd.yahoo.com/tagline_Travel_1/*http://in.travel.yahoo.com/"> Click here!</a>