Home > vbmeg > functions > tool_box > neuromag > check_neuromag_orient.m

check_neuromag_orient

PURPOSE ^

Check orientation of image with analyzefile

SYNOPSIS ^

function check_neuromag_orient(mri_fiffile, analyzefile)

DESCRIPTION ^

 Check orientation of image with analyzefile
  check_neuromag_orient(mri_fiffile, analyzefile)
     mri_fiffile : MRI fiffile.
     analyzefile : analyze file.

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function    check_neuromag_orient(mri_fiffile, analyzefile)
0002 % Check orientation of image with analyzefile
0003 %  check_neuromag_orient(mri_fiffile, analyzefile)
0004 %     mri_fiffile : MRI fiffile.
0005 %     analyzefile : analyze file.
0006 %
0007 % Copyright (C) 2011, ATR All Rights Reserved.
0008 % License : New BSD License(see VBMEG_LICENSE.txt)
0009 
0010 % change neuromag vox image to RAS
0011 avw = change_neuromag_ras(mri_fiffile);
0012 
0013 img = double( avw.img);
0014 
0015 % dimension
0016 dim   = avw.hdr.dime.dim(2:4);
0017 vsize = avw.hdr.dime.pixdim(2:4);
0018 
0019 % analyze image to RAS
0020 [B, Vdim, Vsize] = vb_load_analyze_to_right(analyzefile);
0021 
0022 % check dimension
0023 errdim = sum(abs(Vdim(:) - dim(:)));
0024 errsize = sum(abs(Vsize(:) - vsize(:)));
0025 
0026 %voxは整数値なので、Bも最大強度に合わせて整数値にして比較
0027 vmax = max(img(:));
0028 bmax = max(B(:));
0029 B = fix(B *vmax/bmax);
0030 
0031 % Check image data intensity
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

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005