[Insight-users] Accuracy of demons registration
Yogish Mallya
mallyayogish at yahoo.co.in
Thu May 14 13:15:26 EDT 2009
Dear All,
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 ?
FILE *read_fixed_landmarks = fopen(argv[7],"rt");
FILE *read_moving_landmarks = fopen(argv[8],"rt");
FILE *error_file = fopen(argv[9],"w");
VectorType est_displacement;
VectorType ref_displacement;
double error[3];
;
while (!feof(read_fixed_landmarks) && !feof(read_moving_landmarks))
{
float fixed_x, fixed_y, fixed_z;
float moving_x, moving_y, moving_z;
fscanf(read_fixed_landmarks,"%f %f %f\n", &fixed_x, &fixed_y, &fixed_z);
fscanf(read_moving_landmarks,"%f %f %f\n", &moving_x, &moving_y, &moving_z);
DeformationFieldType::IndexType index;
index[0] = fixed_x;
index[1] = fixed_y;
index[2] = fixed_z;
est_displacement = field->GetPixel(index);
ref_displacement[0] = moving_x*moving_spacing[0]- fixed_x*fixed_spacing[0];
ref_displacement[1] = moving_y*moving_spacing[1]- fixed_y*fixed_spacing[1];
ref_displacement[2] = moving_z*moving_spacing[2]- fixed_z*fixed_spacing[2];
error[0] = est_displacement[0]- ref_displacement[0];
error[1] = est_displacement[1]- ref_displacement[1];
error[2] = est_displacement[2]- ref_displacement[2];
}
Thank you in advance
Yogish Mallya
Explore and discover exciting holidays and getaways with Yahoo! India Travel http://in.travel.yahoo.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090514/24b240bf/attachment.htm>
More information about the Insight-users
mailing list