[Insight-users] Accuracy of demons registration

Luis Ibanez luis.ibanez at kitware.com
Wed May 20 23:04:01 EDT 2009


Hi Yogish,


   Why are you assigning the landmarks to Indexes ?

   Are they really defined in pixel coordinates ?

   Usually landmarks are recorded in Physical Space
   (taking origin,spacing and orientation into account).



    Luis



-------------------
Yogish Mallya wrote:
> 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 Click here! 
> <http://in.rd.yahoo.com/tagline_Travel_1/*http://in.travel.yahoo.com/>
> 
> 
> ------------------------------------------------------------------------
> 
> _____________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list