0001 function check_neuromag_orient(mri_fiffile, analyzefile)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 avw = change_neuromag_ras(mri_fiffile);
0012
0013 img = double( avw.img);
0014
0015
0016 dim = avw.hdr.dime.dim(2:4);
0017 vsize = avw.hdr.dime.pixdim(2:4);
0018
0019
0020 [B, Vdim, Vsize] = vb_load_analyze_to_right(analyzefile);
0021
0022
0023 errdim = sum(abs(Vdim(:) - dim(:)));
0024 errsize = sum(abs(Vsize(:) - vsize(:)));
0025
0026
0027 vmax = max(img(:));
0028 bmax = max(B(:));
0029 B = fix(B *vmax/bmax);
0030
0031
0032 err = sum(abs( B(:) - img(:) ))/sum(abs(B(:)));
0033
0034 fprintf('Error of image = %g\n',err)
0035 fprintf('Error of dim = %g\n',errdim)
0036 fprintf('Error of voxcel size = %g\n',errsize)
0037