Home > functions > device > meg > yokogawa > utility > vb_save_yokogawa_srf.m

vb_save_yokogawa_srf

PURPOSE ^

SYNOPSIS ^

function vb_save_yokogawa_srf()

DESCRIPTION ^

 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    vb_save_yokogawa_srf()
0002 %
0003 % Copyright (C) 2011, ATR All Rights Reserved.
0004 % License : New BSD License(see VBMEG_LICENSE.txt)
0005 
0006 mesg1 = '横河マーカーファイルを指定してください';
0007 mesg2 = '横河MRIファイルを指定してください';
0008 mesg3 = 'フィットしたMEG座標ファイルを指定してください';
0009 mesg4 = '出力するファイル名 (*.srf) を入力してください';
0010 
0011 % yokogawa marker file
0012 [marker_path, marker_file_name] = vb_file_select({'.mrk'}, mesg1);
0013 
0014 if isempty(marker_file_name), return; end
0015 
0016 marker_file_name = [marker_path marker_file_name{1}];
0017 
0018 % yokogawa mri file
0019 [mri_path, mri_file_name] = vb_file_select({'.mri'}, mesg2);
0020 
0021 if isempty(mri_file_name), return; end
0022 
0023 mri_file_name = [mri_path mri_file_name{1}];
0024 
0025 % meg position file
0026 [meg_path, meg_file_name] = vb_file_select({'.pos.mat'}, mesg3);
0027 
0028 if isempty(meg_file_name), return; end
0029 
0030 meg_file_name = [meg_path meg_file_name{1}];
0031 
0032 
0033 [file_name_to_save_path, file_name_to_save] = vb_file_select({'.srf'}, mesg4, true);
0034 
0035 if isempty(file_name_to_save), return; end
0036 
0037 file_name_to_save = [file_name_to_save_path file_name_to_save{1}];
0038 
0039 %
0040 %  meg_to_mri : 位置合わせの変換行列
0041 %
0042 %  meg_pos : 4 x N
0043 %  mri_pos = meg_to_mri * meg_pos : 4 x N
0044 
0045 trans_mat.meg_to_mri = vb_posfile_get_transinfo(meg_file_name);
0046 
0047 meg_to_mri = trans_mat.meg_to_mri;
0048 meg_to_mri = meg_to_mri';
0049 
0050 % 070927 TY
0051 meg_to_mri = [-1 0 0 0; 0 -1 0 0; 0 0 1 0; 0 0 0 1] * meg_to_mri;
0052 
0053 Make_SRF( file_name_to_save, marker_file_name, mri_file_name, meg_to_mri );
0054

Generated on Tue 27-Aug-2013 11:46:04 by m2html © 2005