function mne_gui_lsy_v2(SsName, SsFile, PickTime) % Parameters: % SsName, % SsFile, % PickTime, % % 2016/04/27 Sanyuan Lin, lin.sanyuan@gmail.com %% Check ispc, isunix, ismac. % this program runs only in linux (ubuntu) or mac if ispc error('Use Ubuntu or Mac.') end SsName SsFile PickTime %% Set environment directory for making init.sh % check if mne_env.mat exists if exist('mne_env.mat','file') load mne_env.mat disp('mne_env.mat loaded'); else disp('You don''t have the file mne_env.mat.'); disp('Please select required directories in the pop-out windows'); ask_directories end %% Pass parqmeters to shell script. ShellScript = 'initMNE_practice.sh'; % ask_Ss_info GetSsFileHead % Put Shell Script and parameters together and send to bash eval(['!bash ', ShellScript,' ',SsName,' ',SsFile,' ',SsFileHead,' ',... Freesurfer_ROOT,' ', Matlab_ROOT,' ',MNE_ROOT,' ',... SUBJECTS_Anatomy_ROOT,' ',SUBJECTS_DATA_ROOT,' ',PickTime]); %% After initMNE_practice.sh finished. % Call mrVista to do the overlay % % % Setup mrSESSION % params = mrInitDefaultParams; % params.inplane = [SUBJECTS_Anatomy_ROOT,'/',SsName]; % params.vAnatomy = [SUBJECTS_Anatomy_ROOT,'/',SsName]; % params.sessionDir = [SUBJECTS_DATA_ROOT,'/',SsName]; % mrInit(params); % % % Call mrVista superimpose data fucntion % meshBuildFromClass % meshVisualize %% read in current estimate values from w / stc files %(output of mne_make_movie) % disp('Read in Current Estimate file'); % % cd(SUBJECT_ROOT); % pick_time = 9.1; % [m,n] = size(num2str(pick_time)); % time = '00000.0'; % time(7-n+1:7) = num2str(pick_time); % w_filename = [SsFileHead, '-w.fif-', time ,'-rh.w']; % w = mne_read_w_file(w_filename); % disp('w file obtained'); % w % % stc_filename = [SsFileHead, '-stc.fif-rh.stc']; % % stc = mne_read_stc_file(stc_filename); % disp('stc file obtained'); % stc % % fileName = [SsFileHead,'_Current Estimation.mat']; % save(fileName, 'w', 'stc'); % disp('w and stc saved.'); end