Skip to content

Commit

Permalink
Fixed a rather serious problem with SPM based Normalization routines.
Browse files Browse the repository at this point in the history
  • Loading branch information
andreashorn committed May 20, 2016
1 parent 501b682 commit bd71618
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ea_checkforwardinv.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ function ea_checkforwardinv(options,forwardinv)
switch forwardinv
case 'forward'
V=spm_vol([options.root,options.patientname,filesep,'y_ea_normparams.nii']);
Vmni=spm_vol([options.earoot,'templates',filesep,'mni_hires.nii']);
[~,templ]=ea_whichnormmethod([options.root,options.patientname,filesep]);
Vmni=spm_vol(templ);

if ~isequal(V.dim,Vmni.dim)
if ~isequal(V.dim,Vmni(1).dim)

ea_redo_inv([options.root,options.patientname,filesep],options,'forward');
end
Expand Down
2 changes: 2 additions & 0 deletions ea_whichnormmethod.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
switch whichnormmethod
case 'ea_normalize_spmdartel' % use dartel MNI template
tempfile=[leaddir,'templates',filesep,'dartel',filesep,'dartelmni_6.nii'];
case 'ea_normalize_spmnewseg'
tempfile=[leaddir,'templates',filesep,'TPM.nii'];
otherwise % use mni_hires
tempfile=[leaddir,'templates',filesep,'mni_hires.nii'];
end

0 comments on commit bd71618

Please sign in to comment.