You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: spm_klaff.m
    path of file: ./repos/malini/Codes/deconvolution - model/spm8/toolbox/DARTEL
    
    the code of the file until where you have to start completion: function M = spm_klaff(Nf, Ng)
% Affine registration by minimising Kullback-Leibler Divergence
% FORMAT M = spm_klaff(Nf,Ng)
% Nf - NIfTI handle for one image
% Ng - Nifti handle for the other.  If not passed, then
%      spm*/toolbox/Seg/TPM.nii is used.
% M  - The voxel-for-voxel affine transform
%
% The images that are matched are tissue probability maps, in the
% same form as spm/toolbox/Seg/TPM.nii or the Template files
% generated by DARTEL.  To save some memory, no more than three
% (GM, WM and other) classes are matched together.
%
% Note that the code is very memory hungry because it stores a
% load of image gradients.  If it doesn't work because of this,
% the recommandation is to buy a more powerful computer.
%________________________________________________________
% (c) Wellcome Trust Centre for NeuroImaging (2009)


    
function M = spm_klaff(Nf, Ng)
% Affine registration by minimising Kullback-Leibler Divergence
% FORMAT M = spm_klaff(Nf,Ng)
% Nf - NIfTI handle for one image
% Ng - Nifti handle for the other.  If not passed, then
%      spm*/toolbox/Seg/TPM.nii is used.
% M  - The voxel-for-voxel affine transform
%
% The images that are matched are tissue probability maps, in the
% same form as spm/toolbox/Seg/TPM.nii or the Template files
% generated by DARTEL.  To save some memory, no more than three
% (GM, WM and other) classes are matched together.
%
% Note that the code is very memory hungry because it stores a
% load of image gradients.  If it doesn't work because of this,
% the recommandation is to buy a more powerful computer.
%________________________________________________________
% (c) Wellcome Trust Centre for NeuroImaging (2009)

% John Ashburner
% $Id: spm_klaff.m 4148 2011-01-04 16:49:23Z guillaume $

if nargin<2,   Ng = fullfile(spm('Dir'),'toolbox','Seg','TPM.nii'); end