-
Notifications
You must be signed in to change notification settings - Fork 26
Description
Hello,
I'm developing a small GUI to manually adjust the registration of two brain images in 2d, and I can't manage to understand the coordinate system of the bspline parameters.
It displays the fixed image, the transformed moving image, and the bspline parameters as a vector field (like a matplotlib quiver). The vector arrows are shown as a grid with their origin calculated as follows :
(i * grid_spacing[0], j * grid_spacing[1])
With i and j the indexes defined by GridSize, and the grid_spacing defined by GridSpacing of the parameters file. I do not use the GridOrigin information which seems to make the results worse (maybe my mistake comes from there). All sizes are in pixel, matching the Size of the parameter file.
I added two images below, one using GridOrigin (making the grid go too far on the bottom right) and one without using it but not matching properly. I also checked that the manual modification of the parameters from the interface confirms the misalignment, as the moved region is generally shifted (with no clear rule) from the vectors I moved.
In my case, the bspline is applied after an affine transform, but if I understand correctly, this should not modify the bspline coordinate system that is on the fixed image. However, it seems that if vector field is at least scaled and translated when comparing the the images, but also a bit rotated.
Can you help me clarify how this coordinate system work and how I can manage to calculate the exact vector origin on the fixed image ?
Thank you very much for your help

