I try to register my fod to an existing template, and it works for most of the subject except a few ones, where the result is totally wrong
I suspect this is due to a bad initial rigid (or affine) registration, which may happen when the initial volume is a bit to far away from the template
I try to test
-rigid_init_rotation search
-rigid_init_rotation moments
without sucess. The I use the fa to compute a linear registration (to a fa template)
It seems that results diverge even after reasonable initialisation.
Are you using masks? If not, I’d try with.
Are FODs and template normalised (intensity values in the first volume approximately in the same range)?
Do image and template roughly share the same pose? If not adjust the pose with the “transform” tool in mrview: mrview wm_fod.nii -overlay.load template_fod.nii -overlay.opacity 0.2 and save the modified wm_fod for subsequent registration.
If you want to visualise what mrregister is doing, you can write the transformed images at each resolution stage with -linstage.diagnostics.prefix. For instance, status at initialisation (without optimisation) followed by each resolution stage (assuming default parameters):
I dig a little more further and find out a solution
In my case, adding the argument “-type nonlinear” to the mrregister of the fod make the job,
So to resume, I first use fa to compute
the affine, doing an affine registration of fa, to fa_template
and then use this affine to no-linearly register fod to fod template
I do not know why but the affine registration is bad when perform with fod, but it works much better when FA is used as input. (and as target), that is why I need this 2 steps
This being said, I do not fully understand, the mrregister argument. for instance if I omit the affine_init_matrix argument, I do have a decent result, which I do not understand given the initial mismatch in position …
is there still an affine registration done even with -type nonlinear ?
As far as I know, initialisation works but if linear registration diverges then that might undo the initialisation depending on the exact command you used. If you set the number of iterations to zero in the first stage then you’ll see the effect of the initialisation in the first diagnostics image. The -info option should give you an idea of what operations preceeded each diagnostics image.
Yes, images need to share roughly the same pose up to a translation. If images are rotated by let’s say more than 45 degrees, registration might not find a good solution as it requires a sensible starting point.
The default is centre of mass initialisation which should take care of the shift between images.
Red is image1 (“moving”), green is image 2 (“template”).
No, -type nonlinear only performs nonlinear registration (but one can initialise the linear transformation).
I’ve created an example demonstrating the effect of the initialisation method which is probably a good starting point for figuring out what’s going on:
Performing the registration in two steps using different contrast is conceptually OK. Yet, if linear registration using the FODs fails I’d be concerned that the nonlinear registration yields suboptimal results. Comapred to FODs, FA removes local and global scaling and directionality. I’d double-check that FODs’ first volumes are roughly in the range [0 0.28] and have a look at the ODFs in mrview to make sure directions are OK.