If your aim is to obtain the closest rigid-body alignment to MNI space
(ie affine registration with the scaling and shearing removed), then
maybe take a look at some of the code that is part of the new segment.
Within the function that writes various output files
(spm_preproc_write8.m), the code that writes out "imported images"
calls a routine for doing procrustes analysis. This step will take a
deformation and determine the closest rigid alignment. Maybe this is
what you want, although you'll have to do a little bit of extra
On 14 July 2011 22:12, Aaryani Tipirneni <[log in to unmask]> wrote:
> Hi John,
> Thank you so much! I really appreciate your detailed explanation.
> Actually, I'm working on affine registration of the MR 3D data sets to the atlas template (T1 or T2). I would like to do only rigid body registration so that there would be no scaling and shearing, but rigid body to atlas is not as robust as affine. Sometimes, it is good and sometimes it is not. I would like to use cost functions like mutual information, normalised mutual information, cross correlation as you mentioned in the affine registration instead of mean square difference. Could you please tell me how to tweak the coreg option to include affine registration.
> Also, as a last step I would like to remove the scaling and shearing from the registered data sets and adjust the other paramters accordingly (i.e translations, rotations) so that they produce the same results with unscaling and unshearing. Could you please help me if you have any suggestions on this as well.
> Thank you so much for your time and patience,
> ----- Original Message -----
> From: "John Ashburner" <[log in to unmask]>
> To: "Aaryani Tipirneni" <[log in to unmask]>
> Cc: [log in to unmask]
> Sent: Thursday, July 14, 2011 12:50:32 PM
> Subject: Re: [SPM] Cost function used in the affine regularization
> Affine registration, or affine regularization? There are a few affine
> registration options in SPM8 and a couple of different regularization
> The initial affine registration under the Normalize button uses mean
> squares difference as an objective function. This one is quite old,
> and a bit primative, but probably still the more appropriate method
> for aligning PET the the PET template.
> The Coreg option can be tweaked to make it do affine registration, and
> this allows various objective functions to be used - as long as they
> can be computed from joint intensity histograms. These include mutual
> information, normalised mutual information and a few others.
> For the segmentation, there area couple of very slightly different
> cost functions. The older segmentation maximises the mutual
> information between the image and tissue probability maps (after
> approximately excluding background). New segment does its initial
> affine registration using essentially the same objective function as
> the segmentation itself, except that it models intensity distributions
> with histograms (instead of mixtures of Gaussians), and does not
> include the bias correction part.
> There's also the affine registration for aligning population average
> tissue probability maps to MNI space. This one minimises the KL
> divergence between the tissue probabilities.
> As for regularisation, the main one is based on decomposing the affine
> transform into rigid-body transform and a matrix that encodes zooms
> and shears. The matrix logarithm of the the zooms and shears matrix
> is penalised.
> Best regards,
> On 13 July 2011 20:18, Aaryani Tipirneni <[log in to unmask]> wrote:
>> Hi SPM experts,
>> Could anyone please tell me what is the cost function used in the affine regularization in SPM? I did not find in the manual what exactly is used, I read somewhere that it uses least squares, is that true?