Thanks alot, it worked!
----- Original Message -----
From: "John Ashburner" <[log in to unmask]>
To: [log in to unmask]
Sent: Thursday, July 21, 2011 4:11:53 AM
Subject: Re: [SPM] Use normalized mutual information as a cost function for affine registration in SPM- Please help
spm_coreg gives a choice of four objective functions (try "help
spm_coreg"). You can get it to do affine registration via:
% Images to register
fixed_image = 'Template_8.nii,1,1';
moved_image = 'grey.nii,1,1';
% Run the registration
x=spm_coreg(fixed_image,moved_image,...
struct('params',[0 0 0 0 0 0 1 1 1 0 0 0],'cost_fun','nmi'));
%% Move the moved image (commented out)
%spm_get_space(moved_image,spm_matrix(x)\spm_get_space(moved_image));
Best regards,
-John
On 21 July 2011 01:49, Robert L. Barry <[log in to unmask]> wrote:
> AFNI's affine registration supports around a dozen cost functions, including
> normalized mutual information:
>
> http://afni.nimh.nih.gov/pub/dist/doc/program_help/3dAllineate.html
>
> Kind regards,
>
> -Rob
>
>
> On Wed, Jul 20, 2011 at 5:31 PM, Aaryani Tipirneni <[log in to unmask]>
> wrote:
>
>> Hi SPM experts,
>>
>> I could find only affine registration in SPM using least squares as the
>> cost function. I would like to use normalized mutual information (nmi) as
>> the cost function for affine registration. Could anyone please tell me if
>> you know or can share any script that uses 'nmi'.
>>
>>
>> Thanks for your time
>> Aaryani
>
>
|