0001 function varargout = bayes_parm_basic_gui(fig, command, varargin)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 if ~exist('fig', 'var') || isempty(fig) || ~ishandle(fig)
0018 error('invalid figure handle is specified.');
0019 end
0020
0021
0022
0023
0024
0025
0026 data = guidata(fig);
0027 H = data.H;
0028
0029 switch(command)
0030
0031
0032
0033 case 'is_exist'
0034 if isfield(H, 'fig')
0035 varargout{1} = true;
0036 else
0037 varargout{1} = false;
0038 end
0039 case 'figure_pull_up_to_top'
0040 figure(H.fig);
0041 case 'gui_update'
0042 bayes_parm = varargin{1};
0043 data = set_gui_parms(data, bayes_parm);
0044 case 'get_project_root'
0045 project_root = get(H.project_root_edit, 'String');
0046 varargout{1} = project_root;
0047 case 'set_project_root'
0048 set(H.project_root_edit, 'String', varargin{1});
0049
0050
0051
0052
0053 case 'get_gui_handles'
0054 varargout{1} = H;
0055
0056
0057
0058 case 'call_back'
0059 hObj = varargin{1};
0060 data = callback(data, hObj);
0061
0062 bayes_parm = get_gui_parms(data);
0063
0064 bayes_parm_editor(data.main_obj, 'merge_bayes_parm', bayes_parm);
0065 end
0066
0067 function data = set_gui_parms(data, bayes_parm)
0068
0069
0070
0071
0072
0073
0074
0075
0076 H = data.H;
0077
0078
0079
0080
0081 if isfield(bayes_parm, 'proj_dir') && isempty(get(H.project_root_edit, 'String'))
0082 set(H.project_root_edit, 'String', bayes_parm.proj_dir);
0083 end
0084 data = set_gui_meg_file(data, bayes_parm.megfile);
0085 set_gui_basis_file(H, bayes_parm.basisfile);
0086 set(H.brain_file_edit, 'String', bayes_parm.brainfile);
0087
0088 [output_dir, filename, ext] = vb_get_file_parts(bayes_parm.bayesfile);
0089 set(H.result_file_outputdir_edit, 'String', output_dir);
0090 set(H.result_filename_edit, 'String', [filename, ext]);
0091 set_gui_act_file(H, bayes_parm.actfile);
0092 set_gui_area_file(H, bayes_parm.areafile);
0093
0094
0095
0096
0097 area_keys = get(H.area_key_listbox, 'String');
0098 if isempty(area_keys)
0099 set(H.area_key_listbox, 'String', bayes_parm.area_key);
0100 area_keys = bayes_parm.area_key;
0101 end
0102 idx = strmatch(bayes_parm.area_key, area_keys, 'exact');
0103 if ~isempty(idx)
0104 set(H.area_key_listbox, 'Value', idx);
0105 else
0106 set(H.area_key_listbox, 'Value', 1);
0107 end
0108
0109 act_keys = get(H.act_key_listbox, 'String');
0110 if isempty(act_keys)
0111 set(H.act_key_listbox, 'String', bayes_parm.act_key);
0112 act_keys = bayes_parm.act_key;
0113 end
0114 idx = [];
0115
0116 if ischar(bayes_parm.act_key)
0117 bayes_parm.act_key = cellstr(bayes_parm.act_key);
0118 end
0119 for k=1:length(bayes_parm.act_key)
0120 idx = [idx; strmatch(bayes_parm.act_key{k}, act_keys, 'exact')];
0121 end
0122 if ~isempty(idx)
0123 set(H.act_key_listbox, 'Value', idx);
0124 else
0125 set(H.area_key_listbox, 'Value', 1);
0126 end
0127
0128
0129
0130
0131
0132 if length(bayes_parm.twin_meg) == 2
0133 wtime_from_index = bayes_parm.twin_meg(1);
0134 wtime_to_index = bayes_parm.twin_meg(2);
0135
0136 wtime_from_msec = bayes_parm_editor(data.main_obj, ...
0137 'index_to_time',...
0138 wtime_from_index,...
0139 'meg');
0140 wtime_to_msec = bayes_parm_editor(data.main_obj, ...
0141 'index_to_time',...
0142 wtime_to_index,...
0143 'meg');
0144 set(H.whole_time_window_from_edit,...
0145 'String', sprintf('%.2f', wtime_from_msec));
0146 set(H.whole_time_window_to_edit,...
0147 'String', sprintf('%.2f', wtime_to_msec));
0148 end
0149
0150
0151
0152 set(H.time_shift_start_pos_edit, 'String', '');
0153 set(H.time_shift_end_pos_edit, 'String', '');
0154 set(H.time_shift_window_size_edit, 'String', '');
0155 set(H.time_shift_shift_length_edit, 'String', '');
0156
0157 if (length(bayes_parm.Tperiod) == 1) &&...
0158 (length(bayes_parm.Tnext) == 1)
0159 change_time_shift_mode(H, 'equally');
0160
0161 window_size = bayes_parm_editor(data.main_obj, ...
0162 'data_len_to_time_len',...
0163 bayes_parm.Tperiod,...
0164 'meg');
0165 shift_len = bayes_parm_editor(data.main_obj, ...
0166 'data_len_to_time_len',...
0167 bayes_parm.Tnext,...
0168 'meg');
0169 set(H.time_shift_window_size_edit,...
0170 'String', sprintf('%.2f', window_size));
0171 set(H.time_shift_shift_length_edit,...
0172 'String', sprintf('%.2f', shift_len));
0173 elseif (length(bayes_parm.Tperiod) ~= 0) &&...
0174 (length(bayes_parm.Tnext) ~= 0)
0175
0176 change_time_shift_mode(H, 'manual');
0177 start_idx = bayes_parm.Tnext + bayes_parm.twin_meg(1) -1;
0178 start_pos = bayes_parm_editor(data.main_obj, ...
0179 'index_to_time',...
0180 start_idx,...
0181 'meg');
0182 end_idx = bayes_parm.Tnext + bayes_parm.Tperiod + ...
0183 bayes_parm.twin_meg(1)-2;
0184 end_pos = bayes_parm_editor(data.main_obj, ...
0185 'index_to_time',...
0186 end_idx,...
0187 'meg');
0188 spos_comma_text = bayes_parm_gui_util('comma_text', start_pos);
0189 epos_comma_text = bayes_parm_gui_util('comma_text', end_pos);
0190 set(H.time_shift_start_pos_edit, 'String', spos_comma_text);
0191 set(H.time_shift_end_pos_edit, 'String', epos_comma_text);
0192 else
0193 change_time_shift_mode(H, 'equally');
0194 set(H.time_shift_window_size_edit, 'String', '');
0195 set(H.time_shift_shift_length_edit,'String', '');
0196 set(H.time_shift_start_pos_edit, 'String', '');
0197 set(H.time_shift_end_pos_edit, 'String', '');
0198 end
0199
0200
0201
0202
0203
0204
0205
0206 if IsTreatableEstimationModel(bayes_parm) == true
0207
0208
0209
0210 set_forward_model(H, bayes_parm.forward_model, true);
0211
0212
0213
0214
0215 model = bayes_parm.noise_estimation_model;
0216
0217
0218
0219
0220
0221
0222
0223
0224 set(H.noise_estimation_model_popup, 'Value', model);
0225 set_estimation_GUI_properties(H);
0226
0227
0228
0229
0230
0231 set(H.obsn_cov_popup, 'Value', bayes_parm.noise_model);
0232
0233
0234 if bayes_parm.update_sx == ON
0235 update_state = 1;
0236 else
0237 update_state = 0;
0238 end
0239 set(H.update_sx_checkbox, 'Value', update_state);
0240
0241
0242
0243
0244
0245
0246 if bayes_parm.update_v == ON
0247 update_state = 1;
0248 else
0249 update_state = 0;
0250 end
0251 set(H.update_v_checkbox, 'Value', update_state);
0252
0253 else
0254 error_str = sprintf(['Cannot read Estimation Model Parameters.\n', ...
0255 '(The combination not to be able to treat was specified.)\n', ...
0256 'Default Estimation Model parameters are set.']);
0257 errordlg(error_str, 'notice');
0258
0259
0260 set_forward_model(H, STR_FORWARD_MODEL_FOCAL, true);
0261 end
0262
0263
0264
0265 set(H.sensor_noise_file_listbox,'String',bayes_parm.megfile_baseline);
0266 data = set_noise_file_time_window(data, bayes_parm);
0267
0268
0269 if isfield(bayes_parm, 'comment')
0270 set(H.comment_edit, 'String', bayes_parm.comment);
0271 end
0272
0273
0274 set(H.Rfilt_edit, 'String', sprintf('%.2f', bayes_parm.Rfilt(1)*1e3));
0275
0276
0277 set(H.reduce_edit, 'String', sprintf('%.2f', bayes_parm.reduce(1)));
0278
0279
0280 set(H.magnification_edit, 'String', num2str(bayes_parm.a0_act));
0281
0282
0283 set(H.confidence_edit', 'String', num2str(bayes_parm.Ta0_act));
0284
0285 function bayes_parm = get_gui_parms(data)
0286
0287
0288
0289
0290
0291
0292
0293 H = data.H;
0294
0295
0296
0297
0298
0299 bayes_parm.megfile = get(H.meg_file_listbox, 'String');
0300 bayes_parm.basisfile = get(H.basis_file_listbox, 'String');
0301 bayes_parm.brainfile = get(H.brain_file_edit, 'String');
0302 bayes_parm.bayesfile = [get(H.result_file_outputdir_edit, 'String'),...
0303 filesep,...
0304 get(H.result_filename_edit, 'String')];
0305 bayes_parm.actfile = get(H.act_file_edit, 'String');
0306 bayes_parm.areafile = get(H.area_file_edit, 'String');
0307
0308
0309
0310
0311 area_keys = get(H.area_key_listbox, 'String');
0312 if ischar(area_keys)
0313 bayes_parm.area_key = area_keys;
0314 else
0315 bayes_parm.area_key = area_keys{get(H.area_key_listbox, 'Value')};
0316 end
0317 act_keys = get(H.act_key_listbox, 'String');
0318
0319 if ischar(act_keys)
0320 bayes_parm.act_key = {act_keys};
0321 else
0322 bayes_parm.act_key = act_keys(get(H.act_key_listbox, 'Value'));
0323 end
0324
0325
0326
0327
0328
0329 Tperiod = [];
0330 Tnext = [];
0331 twin_meg = [];
0332 try
0333 if get(H.time_shift_equally_radiobutton, 'Value')
0334
0335
0336
0337
0338
0339 wtime_from_msec = str2double(...
0340 get(H.whole_time_window_from_edit, 'String'));
0341 wtime_to_msec = str2double(get(H.whole_time_window_to_edit, 'String'));
0342
0343
0344 wtime_from_index = bayes_parm_editor(data.main_obj, ...
0345 'time_to_index',...
0346 wtime_from_msec, 'meg');
0347 wtime_to_index = bayes_parm_editor(data.main_obj, ...
0348 'time_to_index',...
0349 wtime_to_msec, 'meg');
0350
0351 twin_meg = [wtime_from_index, wtime_to_index];
0352
0353 window_size = str2double(...
0354 get(H.time_shift_window_size_edit, 'String'));
0355 time_shift_len = str2double(...
0356 get(H.time_shift_shift_length_edit, 'String'));
0357
0358 Tperiod = bayes_parm_editor(data.main_obj, ...
0359 'time_len_to_data_len',...
0360 window_size, 'meg');
0361 Tnext = bayes_parm_editor(data.main_obj, ...
0362 'time_len_to_data_len',...
0363 time_shift_len, 'meg');
0364 else
0365
0366
0367
0368
0369
0370 command = ['[' get(H.time_shift_start_pos_edit, 'String') ']'];
0371 start_pos = eval(command);
0372 command = ['[' get(H.time_shift_end_pos_edit, 'String') ']'];
0373 end_pos = eval(command);
0374 [start_idx, err] = bayes_parm_editor(data.main_obj, ...
0375 'time_to_index',...
0376 start_pos, 'meg');
0377 if err, return, end;
0378 [end_idx, err] = bayes_parm_editor(data.main_obj, ...
0379 'time_to_index',...
0380 end_pos, 'meg');
0381 if err, return, end;
0382
0383
0384 twin_meg = [min(start_idx), max(end_idx)];
0385 Tperiod = end_idx - start_idx + 1;
0386 Tnext = [start_idx - twin_meg(1) + 1];
0387 if length(Tnext) == 1
0388 Tnext = Tperiod;
0389 end
0390 end
0391 catch
0392 end
0393
0394 bayes_parm.twin_meg = twin_meg;
0395 bayes_parm.Tnext = Tnext;
0396 bayes_parm.Tperiod = Tperiod;
0397
0398
0399
0400
0401
0402 bayes_parm.forward_model = get_forward_model(H);
0403 bayes_parm.noise_estimation_model = get_noise_estimation_model(H);
0404
0405
0406 if get(H.specified_checkbox, 'Value')
0407 num_files = length(bayes_parm.megfile);
0408 meg_file = get(H.sensor_noise_file_edit, 'String');
0409
0410
0411 bayes_parm.megfile_baseline = repmat(cellstr(meg_file), num_files, 1);
0412 else
0413
0414 bayes_parm.megfile_baseline = get(H.sensor_noise_file_listbox,'String');
0415 end
0416
0417
0418
0419
0420
0421 bayes_parm.noise_model = get(H.obsn_cov_popup, 'Value');
0422
0423
0424 twin_from_msec = str2double(get(H.obsn_time_window_from_edit, 'String'));
0425 twin_to_msec = str2double(get(H.obsn_time_window_to_edit, 'String'));
0426 twin_from_index = bayes_parm_editor(data.main_obj, ...
0427 'time_to_index',...
0428 twin_from_msec, 'meg');
0429 twin_to_index = bayes_parm_editor(data.main_obj, ...
0430 'time_to_index',...
0431 twin_to_msec, 'meg');
0432 bayes_parm.twin_noise = [twin_from_index twin_to_index];
0433
0434
0435 update_state = get(H.update_sx_checkbox, 'Value');
0436 if update_state
0437 bayes_parm.update_sx = ON;
0438 else
0439 bayes_parm.update_sx = OFF;
0440 end
0441
0442
0443
0444
0445
0446
0447
0448
0449
0450 twin_from_msec = str2double(get(H.obsn_time_window_from_edit, 'String'));
0451 twin_to_msec = str2double(get(H.obsn_time_window_to_edit, 'String'));
0452 twin_from_index = bayes_parm_editor(data.main_obj, ...
0453 'time_to_index',...
0454 twin_from_msec, 'meg');
0455 twin_to_index = bayes_parm_editor(data.main_obj, ...
0456 'time_to_index',...
0457 twin_to_msec, 'meg');
0458
0459 bayes_parm.twin_baseline = [twin_from_index twin_to_index];
0460
0461
0462 update_state = get(H.update_v_checkbox, 'Value');
0463 if update_state
0464 bayes_parm.update_v = ON;
0465 else
0466 bayes_parm.update_v = OFF;
0467 end
0468
0469
0470
0471
0472 bayes_parm.flag_baseline = str2double(get(H.flag_baseline_edit, 'String'));
0473 bayes_parm.flag_noise_set = str2double(get(H.flag_noise_set_edit, 'String'));
0474
0475
0476 bayes_parm.comment = get(H.comment_edit, 'String');
0477
0478
0479 bayes_parm.Rfilt = str2num(get(H.Rfilt_edit, 'String'))*1e-3;
0480
0481
0482 bayes_parm.reduce = str2num(get(H.reduce_edit, 'String'));
0483
0484
0485 bayes_parm.a0_act = str2num(get(H.magnification_edit, 'String'));
0486
0487
0488 bayes_parm.Ta0 = str2num(get(H.confidence_edit, 'String'));
0489 bayes_parm.Ta0_act = str2num(get(H.confidence_edit, 'String'));
0490
0491 function data = callback(data, hObj)
0492
0493
0494
0495
0496
0497
0498
0499
0500
0501 global vbmeg_inst;
0502 define = vbmeg_inst.const;
0503
0504 H = data.H;
0505
0506 switch(hObj)
0507 case H.project_root_push
0508 dirname = dir_dialog(get(H.project_root_edit, 'String'));
0509 if dirname ~= 0
0510 set(H.project_root_edit, 'String', dirname);
0511 end
0512 case H.brain_file_push
0513 project_root = get(H.project_root_edit, 'String');
0514 [dirname fname selected] = bayes_parm_gui_util(...
0515 'filedlg_relative',...
0516 {define.BRAIN_EXTENSION},...
0517 0, project_root, ...
0518 'Select cortical model file');
0519 if selected
0520 set(H.brain_file_edit, 'String', [dirname filesep fname{1}]);
0521 end
0522 case H.basis_file_add_push
0523 project_root = get(H.project_root_edit, 'String');
0524 [dirname fname selected] = bayes_parm_gui_util(...
0525 'filedlg_relative',...
0526 {define.BASIS_EXTENSION},...
0527 0, project_root, ...
0528 'Select leadfield file');
0529 if selected
0530 num = length(fname);
0531 add_files = {};
0532 for n=1:num
0533 add_files = ...
0534 [add_files; cellstr([dirname filesep fname{n}])];
0535 end
0536 filenames = get(H.basis_file_listbox, 'String');
0537 set_gui_basis_file(H, [filenames; add_files]);
0538 end
0539 case H.basis_file_remove_push
0540 idx = get(H.basis_file_listbox, 'Value');
0541 filenames = get(H.basis_file_listbox, 'String');
0542 if ~isempty(filenames)
0543 filenames(idx) = [];
0544 list_focus = idx(1)-1;
0545 if idx(1)-1 == 0
0546 list_focus = 1;
0547 end
0548 set(H.basis_file_listbox, 'Value', list_focus);
0549 set_gui_basis_file(H, filenames);
0550 end
0551 case H.meg_file_add_push
0552 project_root = get(H.project_root_edit, 'String');
0553 [dirname fnames selected] = bayes_parm_gui_util(...
0554 'filedlg_relative',...
0555 {define.MEG2_EXTENSION, ...
0556 define.EEG_EXTENSION},...
0557 0, project_root, ...
0558 'Select MEG/EEG data');
0559 if selected
0560 num = length(fnames);
0561 add_files = {};
0562 for n=1:num
0563 add_files = ...
0564 [add_files; cellstr([dirname filesep fnames{n}])];
0565 end
0566 filenames = get(H.meg_file_listbox, 'String');
0567 data = set_gui_meg_file(data, [filenames; add_files]);
0568 end
0569 case H.meg_file_remove_push
0570 idx = get(H.meg_file_listbox, 'Value');
0571 filenames = get(H.meg_file_listbox, 'String');
0572
0573 if ~isempty(filenames)
0574 filenames(idx) = [];
0575 list_focus = idx(1)-1;
0576 if idx(1)-1 == 0
0577 list_focus = 1;
0578 end
0579
0580 set(H.meg_file_listbox, 'Value', list_focus);
0581 data = set_gui_meg_file(data, filenames);
0582 end
0583 case H.result_file_outputdir_push
0584 project_root = get(H.project_root_edit, 'String');
0585 dirname = dir_dialog(get(H.project_root_edit, 'String'), false);
0586 if (dirname ~= 0) & (~isempty(project_root))
0587 path_relative = vb_relativepath(dirname, project_root);
0588 path_relative = path_relative(1:length(path_relative)-1);
0589 set(H.result_file_outputdir_edit, 'String', path_relative);
0590 end
0591 case H.result_filename_edit
0592 result_file = get(hObj, 'String');
0593
0594 [path_name, fname, ext] = vb_get_file_parts(result_file);
0595 if isempty(ext)
0596 ext = define.BAYES_EXTENSION;
0597 end
0598 set(hObj, 'String', [fname ext]);
0599 case H.area_file_push
0600 project_root = get(H.project_root_edit, 'String');
0601 [dirname fname selected] = bayes_parm_gui_util(...
0602 'filedlg_relative',...
0603 {define.AREA_EXTENSION},...
0604 0, project_root, ...
0605 'Select cortical area file');
0606 if selected
0607 area_file = [dirname filesep fname{1}];
0608 data = reload_gui_area_file(data, area_file);
0609 end
0610 case H.act_file_push
0611 project_root = get(H.project_root_edit, 'String');
0612 [dirname fname selected] = bayes_parm_gui_util(...
0613 'filedlg_relative',...
0614 {define.FMRI_EXTENSION},...
0615 0, project_root, ...
0616 'Select cortical activity file');
0617 if selected
0618 act_file = [dirname filesep fname{1}];
0619 set_gui_act_file(H, act_file);
0620 end
0621 case { H.whole_time_window_from_edit, H.whole_time_window_to_edit }
0622 time = str2double(get(hObj, 'String'));
0623 [match_time, err] = time_match_sample_point(data, time, 'meg');
0624 if err == 1
0625 errordlg('select meg file.', 'error');
0626 set(hObj, 'String', '');
0627 elseif err == 2
0628 errordlg('Illigal input.', 'error');
0629 set(hObj, 'String', '');
0630 else
0631 set(hObj, 'String', sprintf('%.2f', match_time));
0632 end
0633 case H.time_shift_manual_radiobutton
0634 change_time_shift_mode(H, 'manual');
0635 case H.time_shift_equally_radiobutton
0636 change_time_shift_mode(H, 'equally');
0637 case {H.time_shift_window_size_edit, H.time_shift_shift_length_edit}
0638 time_len = str2double(get(hObj, 'String'));
0639 if time_len < 0
0640 errordlg('The value should be positive value.', 'Error');
0641 set(hObj, 'String', '');
0642 else
0643 [ceil_time_len, err] = ceil_time_length(data, time_len, 'meg');
0644 if err == 1
0645 errordlg('select meg file.', 'error');
0646 elseif err == 2
0647 errordlg('Illigal input.', 'error');
0648 else
0649 set(hObj, 'String', sprintf('%.2f', ceil_time_len));
0650 end
0651 end
0652 case { H.time_shift_start_pos_edit, H.time_shift_end_pos_edit }
0653
0654 command = ['[' get(hObj, 'String') ']'];
0655 try
0656 pos = eval(command);
0657 [match_time, err] = time_match_sample_point(data, pos, 'meg');
0658 catch
0659 errordlg('positions are invalid.', 'error');
0660 return;
0661 end
0662 match_time = sort(match_time);
0663 pos_text = bayes_parm_gui_util('comma_text', match_time);
0664 set(hObj, 'String', pos_text);
0665 case H.duration_check_push
0666
0667 [start_pos, end_pos, err] = get_interval(H);
0668 if err
0669 return;
0670 end
0671 time_window_string = [num2str(start_pos, '%-8.2f'),...
0672 repmat(' - ', length(start_pos), 1),...
0673 num2str(end_pos, '%-8.2f')];
0674
0675 set(H.duration_listbox, 'String', time_window_string);
0676
0677 set(H.duration_listbox, 'Value', 1);
0678 case H.noise_estimation_model_popup
0679 set_estimation_GUI_properties(H);
0680
0681
0682
0683 case H.specified_checkbox
0684 if get(hObj, 'Value')
0685 data = change_sensor_noise_file_selection_mode(data, ON);
0686 else
0687 data = change_sensor_noise_file_selection_mode(data, OFF);
0688 end
0689 case H.sensor_noise_file_edit
0690 data = set_noise_file_time_window(data);
0691 case H.sensor_noise_file_push
0692 project_root = get(H.project_root_edit, 'String');
0693 [dirname fname selected] = bayes_parm_gui_util('filedlg_relative',...
0694 {define.MEG2_EXTENSION},...
0695 0,...
0696 project_root);
0697 if selected
0698 set(H.sensor_noise_file_edit, 'String', [dirname filesep fname{1}]);
0699 data = set_noise_file_time_window(data);
0700 end
0701 case {H.obsn_time_window_from_edit, ...
0702 H.obsn_time_window_to_edit}
0703
0704
0705 value = str2double(get(hObj, 'String'));
0706 [match_time, err] = time_match_sample_point(data, value, 'noise');
0707 if err == 1
0708 errordlg('select meg file.', 'error');
0709 set(hObj, 'String', '');
0710 elseif err == 2
0711 errordlg('Illigal input.', 'error');
0712 set(hObj, 'String', '');
0713 else
0714 set(hObj, 'String', sprintf('%.2f', match_time));
0715 end
0716 case H.advanced_parm_push
0717 bayes_parm_editor_init_advanced_gui(data.main_obj);
0718 case H.save_push
0719
0720 bayes_parm = get_gui_parms(data);
0721
0722 bayes_parm_editor(data.main_obj, 'merge_bayes_parm', bayes_parm);
0723
0724 bayes_parm_editor(data.main_obj, 'save_bayes_parm');
0725 case H.load_push
0726
0727 bayes_parm_editor(data.main_obj, 'load_bayes_parm');
0728 case H.exec_push
0729 push_button_caption = get(H.exec_push, 'String');
0730 set(H.exec_push, 'String', 'Processing...');
0731 pause(0.01);
0732
0733
0734 bayes_parm = get_gui_parms(data);
0735
0736 bayes_parm_editor(data.main_obj, 'merge_bayes_parm', bayes_parm);
0737
0738 bayes_parm_editor(data.main_obj, 'exec_estimation');
0739
0740 set(H.exec_push, 'String', 'Exec');
0741 otherwise
0742 end
0743
0744 function [start_pos, end_pos, err] = get_interval(H,data)
0745
0746
0747
0748
0749
0750
0751
0752
0753 start_pos = [];
0754 end_pos = [];
0755 err = false;
0756
0757 meg_info = data.meg_info;
0758
0759 if get(H.time_shift_manual_radiobutton, 'Value')
0760
0761 command = ['[' get(H.time_shift_start_pos_edit, 'String') ']'];
0762 start_pos = eval(command);
0763 start_pos = start_pos(:);
0764 command = ['[' get(H.time_shift_end_pos_edit, 'String') ']'];
0765 end_pos = eval(command);
0766 end_pos = end_pos(:);
0767
0768 if length(start_pos) ~= length(end_pos)
0769 errordlg('Check Start positions and End positions.', 'Error');
0770 err = true;
0771 end
0772 else
0773
0774 window_size = str2double(...
0775 get(H.time_shift_window_size_edit, 'String'));
0776 shift_length = str2double(...
0777 get(H.time_shift_shift_length_edit, 'String'));
0778 begin = str2double( ...
0779 get(H.whole_time_window_from_edit, 'String'));
0780 last = str2double(...
0781 get(H.whole_time_window_to_edit, 'String'));
0782
0783 index = vb_time_to_index([begin last],meg_info);
0784 Tsample = index(2)-index(1)+1;
0785 Tperiod = vb_time_to_numsamp(window_size,sample_freq);
0786 Tnext = vb_time_to_numsamp(shift_length,sample_freq);
0787 Twindow = vb_calc_timewindow(Tsample,Tperiod,Tnext);
0788
0789 start_pos = Twindow(:,1);
0790 end_pos = Twindow(:,2);
0791 start_pos = vb_index_to_time(start_pos,meg_info);
0792 end_pos = vb_index_to_time(end_pos,meg_info);
0793
0794
0795
0796
0797
0798
0799
0800
0801
0802
0803
0804
0805
0806
0807
0808
0809
0810
0811
0812
0813
0814
0815
0816
0817
0818 end
0819
0820 function data = set_noise_file_time_window(data, bayes_parm)
0821
0822
0823
0824
0825
0826
0827 H = data.H;
0828
0829 project_root = get(H.project_root_edit, 'String');
0830 noise_file = [];
0831
0832 if get(H.specified_checkbox, 'Value')
0833 noise_file = get(H.sensor_noise_file_edit, 'String');
0834 else
0835 filenames = get(H.sensor_noise_file_listbox, 'String');
0836 if length(filenames)
0837 noise_file = filenames{1};
0838 end
0839 end
0840
0841
0842 filename = [];
0843 if ~isempty(noise_file)
0844 filename = [project_root filesep noise_file];
0845 end
0846 set_sensor_noise_file_info(data, filename);
0847
0848
0849
0850 meg_info = bayes_parm_editor(data.main_obj, 'get_sensor_noise_file_info');
0851 if isempty(meg_info)
0852 return;
0853 end
0854
0855 pretrigger = vb_meginfo_get_pre_trigger(meg_info);
0856
0857 if exist('bayes_parm', 'var') && ...
0858 isfield(bayes_parm, 'twin_noise') && ...
0859 size(bayes_parm.twin_noise, 2) == 2
0860
0861 time_window_noise_from = bayes_parm.twin_noise(1);
0862 time_window_noise_to = bayes_parm.twin_noise(2);
0863 else
0864 time_window_noise_from = 1;
0865 time_window_noise_to = pretrigger;
0866 end
0867 if exist('bayes_parm', 'var') && ...
0868 isfield(bayes_parm, 'twin_baseline') && ...
0869 size(bayes_parm.twin_baseline, 2) == 2
0870 time_window_global_from = bayes_parm.twin_baseline(1);
0871 time_window_global_to = bayes_parm.twin_baseline(2);
0872 else
0873 time_window_global_from = 1;
0874 time_window_global_to = pretrigger;
0875 end
0876
0877 [noise_from, err] = bayes_parm_editor(data.main_obj, ...
0878 'index_to_time', ...
0879 time_window_noise_from, ...
0880 'noise');
0881 [noise_to, err] = bayes_parm_editor(data.main_obj, ...
0882 'index_to_time', ...
0883 time_window_noise_to, ...
0884 'noise');
0885 noise_from_str = sprintf('%.2f', noise_from);
0886 noise_to_str = sprintf('%.2f', noise_to);
0887
0888 [global_from, err] = bayes_parm_editor(data.main_obj, ...
0889 'index_to_time', ...
0890 time_window_global_from, ...
0891 'noise');
0892 [global_to, err] = bayes_parm_editor(data.main_obj, ...
0893 'index_to_time', ...
0894 time_window_global_to, ...
0895 'noise');
0896 global_from_str = sprintf('%.2f', global_from);
0897 global_to_str = sprintf('%.2f', global_to);
0898
0899
0900 set(H.obsn_time_window_from_edit, 'String', noise_from_str);
0901 set(H.obsn_time_window_to_edit, 'String', noise_to_str);
0902
0903
0904
0905
0906
0907 function data = change_sensor_noise_file_selection_mode(data, mode)
0908
0909
0910
0911
0912
0913
0914
0915 H = data.H;
0916 switch(mode)
0917 case ON
0918 set(H.sensor_noise_file_edit, 'Visible', 'on');
0919 set(H.sensor_noise_file_push, 'Visible', 'on');
0920 set(H.sensor_noise_file_listbox, 'Visible', 'off');
0921 data = set_noise_file_time_window(data);
0922 case OFF
0923 set(H.sensor_noise_file_edit, 'Visible', 'off');
0924 set(H.sensor_noise_file_push, 'Visible', 'off');
0925 set(H.sensor_noise_file_listbox, 'Visible', 'on');
0926 data = set_noise_file_time_window(data);
0927 end
0928
0929 function change_time_shift_mode(H, mode)
0930
0931
0932
0933
0934
0935
0936 switch(mode)
0937 case 'manual'
0938 set(H.time_shift_equally_radiobutton, 'Value', 0);
0939 set(H.time_shift_manual_radiobutton, 'Value', 1);
0940
0941 set(H.time_shift_start_pos_label, 'Visible', 'on');
0942 set(H.time_shift_end_pos_label, 'Visible', 'on');
0943 set(H.time_shift_start_pos_edit, 'Visible', 'on');
0944 set(H.time_shift_end_pos_edit, 'Visible', 'on');
0945
0946 set(H.time_shift_window_size_label, 'Visible', 'off');
0947 set(H.time_shift_shift_length_label, 'Visible', 'off');
0948 set(H.time_shift_window_size_edit, 'Visible', 'off');
0949 set(H.time_shift_shift_length_edit, 'Visible', 'off');
0950
0951 set(H.analysis_time_range_text, 'Visible', 'off');
0952 set(H.whole_time_window_from_edit, 'Visible', 'off');
0953 set(H.whole_time_window_to_edit, 'Visible', 'off');
0954 set(H.whole_time_window_minus_text, 'Visible', 'off');
0955 otherwise
0956 set(H.time_shift_manual_radiobutton, 'Value', 0);
0957 set(H.time_shift_equally_radiobutton, 'Value', 1);
0958
0959 set(H.time_shift_start_pos_label, 'Visible', 'off');
0960 set(H.time_shift_end_pos_label, 'Visible', 'off');
0961 set(H.time_shift_start_pos_edit, 'Visible', 'off');
0962 set(H.time_shift_end_pos_edit, 'Visible', 'off');
0963
0964 set(H.time_shift_window_size_label, 'Visible', 'on');
0965 set(H.time_shift_shift_length_label, 'Visible', 'on');
0966 set(H.time_shift_window_size_edit, 'Visible', 'on');
0967 set(H.time_shift_shift_length_edit, 'Visible', 'on');
0968
0969 set(H.analysis_time_range_text, 'Visible', 'on');
0970 set(H.whole_time_window_from_edit, 'Visible', 'on');
0971 set(H.whole_time_window_to_edit, 'Visible', 'on');
0972 set(H.whole_time_window_minus_text, 'Visible', 'on');
0973 end
0974
0975 function H = change_forward_model(H, forward_model)
0976
0977
0978
0979
0980
0981
0982
0983
0984
0985
0986
0987
0988
0989 forward_model = STR_FORWARD_MODEL_FOCAL;
0990
0991 switch(forward_model)
0992 case STR_FORWARD_MODEL_FOCAL
0993 models = { STR_COVARIANCE_NOISE,...
0994 STR_COVARIANCE_NOISE_NO_UPDATE };
0995 value = 1;
0996 case STR_FORWARD_MODEL_FOCAL_GLOBAL
0997 models = { STR_COVARIANCE_NOISE,...
0998 STR_COVARIANCE_NOISE_NO_UPDATE,...
0999 STR_ISOTROPIC_NOISE,...
1000 STR_ISOTROPIC_NOISE_NO_GLOBAL_UPDATE,...
1001 STR_ISOTROPIC_NOISE_NO_UPDATE };
1002 value = 1;
1003 end
1004
1005 set(H.noise_estimation_model_popup, 'String', models);
1006 set(H.noise_estimation_model_popup, 'Value', value);
1007
1008 set_estimation_GUI_properties(H);
1009
1010 function set_estimation_GUI_properties(H)
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020 forward_model= STR_FORWARD_MODEL_FOCAL;
1021
1022 estimation_models = get(H.noise_estimation_model_popup, 'String');
1023 ix = get(H.noise_estimation_model_popup, 'Value');
1024 estimation_model = estimation_models{ix};
1025
1026 switch(forward_model)
1027 case STR_FORWARD_MODEL_FOCAL
1028 switch(estimation_model)
1029 case STR_COVARIANCE_NOISE
1030 set(H.update_sx_checkbox, 'Value', 1);
1031 set(H.update_v_checkbox, 'Value', 0);
1032 set(H.obsn_cov_popup, 'Value', 3);
1033 set(H.flag_baseline_edit, 'String', '0');
1034 set(H.flag_noise_set_edit, 'String', '0');
1035 case STR_COVARIANCE_NOISE_NO_UPDATE
1036 set(H.update_sx_checkbox, 'Value', 0);
1037 set(H.update_v_checkbox, 'Value', 0);
1038 set(H.obsn_cov_popup, 'Value', 3);
1039 set(H.flag_baseline_edit, 'String', '0');
1040 set(H.flag_noise_set_edit, 'String', '0');
1041 end
1042 case STR_FORWARD_MODEL_FOCAL_GLOBAL
1043 switch(estimation_model)
1044 case STR_COVARIANCE_NOISE
1045 set(H.update_sx_checkbox, 'Value', 1);
1046 set(H.update_v_checkbox, 'Value', 0);
1047 set(H.obsn_cov_popup, 'Value', 3);
1048 set(H.flag_baseline_edit, 'String', '0');
1049 set(H.flag_noise_set_edit, 'String', '0');
1050 case STR_COVARIANCE_NOISE_NO_UPDATE
1051 set(H.update_sx_checkbox, 'Value', 0);
1052 set(H.update_v_checkbox, 'Value', 0);
1053 set(H.obsn_cov_popup, 'Value', 3);
1054 set(H.flag_baseline_edit, 'String', '0');
1055 set(H.flag_noise_set_edit, 'String', '0');
1056 case STR_ISOTROPIC_NOISE
1057 set(H.update_sx_checkbox, 'Value', 1);
1058 set(H.update_v_checkbox, 'Value', 1);
1059 set(H.obsn_cov_popup, 'Value', 1);
1060 set(H.flag_baseline_edit, 'String', '0');
1061 set(H.flag_noise_set_edit, 'String', '1');
1062 case STR_ISOTROPIC_NOISE_NO_GLOBAL_UPDATE
1063 set(H.update_sx_checkbox, 'Value', 1);
1064 set(H.update_v_checkbox, 'Value', 0);
1065 set(H.obsn_cov_popup, 'Value', 1);
1066 set(H.flag_baseline_edit, 'String', '0');
1067 set(H.flag_noise_set_edit, 'String', '1');
1068 case STR_ISOTROPIC_NOISE_NO_UPDATE
1069 set(H.update_sx_checkbox, 'Value', 0);
1070 set(H.update_v_checkbox, 'Value', 0);
1071 set(H.obsn_cov_popup, 'Value', 1);
1072 set(H.flag_baseline_edit, 'String', '0');
1073 set(H.flag_noise_set_edit, 'String', '1');
1074 end
1075 end
1076
1077 function data = set_gui_meg_file(data, filenames)
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088 H = data.H;
1089
1090 set(H.meg_file_listbox, 'String', filenames);
1091
1092
1093 if length(filenames)
1094
1095
1096
1097 project_root = get(H.project_root_edit, 'String');
1098 filename = [project_root filesep filenames{1}];
1099 err = set_meg_file_info(data, filename);
1100 if err, return; end
1101 meg_info = get_meg_file_info(data);
1102 [time_window_from, err] = bayes_parm_editor(data.main_obj, ...
1103 'index_to_time', ...
1104 1, 'meg');
1105 [time_window_to, err] = bayes_parm_editor(data.main_obj, ...
1106 'index_to_time', ...
1107 meg_info.Nsample, 'meg');
1108
1109 time_window_from_str = sprintf('%.2f', time_window_from);
1110 time_window_to_str = sprintf('%.2f', time_window_to);
1111
1112
1113 wsize_msec = bayes_parm_editor(data.main_obj, ...
1114 'data_len_to_time_len', ...
1115 meg_info.Nsample, 'meg');
1116 wsize_msec = sprintf('%.2f', wsize_msec);
1117 else
1118
1119
1120
1121
1122 err = set_meg_file_info(data, '');
1123 time_window_from_str = [];
1124 time_window_to_str = [];
1125 wsize_msec = [];
1126 end
1127
1128
1129 set(H.whole_time_range_from_edit, 'String', time_window_from_str);
1130 set(H.whole_time_range_to_edit, 'String', time_window_to_str);
1131
1132
1133 set(H.whole_time_window_from_edit, 'String', time_window_from_str);
1134 set(H.whole_time_window_to_edit, 'String', time_window_to_str);
1135
1136
1137 set(H.time_shift_window_size_edit, 'String', wsize_msec);
1138 set(H.time_shift_shift_length_edit, 'String', wsize_msec);
1139
1140 set(H.sensor_noise_file_listbox, 'String', filenames);
1141 set_noise_file_time_window(data);
1142
1143 function set_gui_basis_file(H, basis_files)
1144
1145
1146
1147
1148
1149
1150
1151 set(H.basis_file_listbox, 'String', basis_files);
1152
1153 function set_gui_act_file(H, act_file)
1154
1155
1156
1157
1158
1159
1160
1161
1162 set(H.act_file_edit, 'String', act_file);
1163
1164 keys = [];
1165 if ~isempty(act_file)
1166
1167 project_root = get(H.project_root_edit, 'String');
1168 load([project_root filesep act_file], 'Act');
1169 for n = 1 : length(Act)
1170 keys{n} = Act{n}.key;
1171 end
1172 end
1173
1174
1175 set(H.act_key_listbox, 'String', keys);
1176
1177 function set_gui_area_file(H, area_file)
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187 set(H.area_file_edit, 'String', area_file);
1188
1189 keys = [];
1190 if ~isempty(area_file)
1191
1192 keys = {};
1193 project_root = get(H.project_root_edit, 'String');
1194 load([project_root filesep area_file], 'Area');
1195 for n = 1 : length(Area)
1196 keys{n} = Area{n}.key;
1197 end
1198 end
1199
1200
1201 set(H.area_key_listbox, 'String', keys);
1202 set(H.area_key_listbox, 'Value', 1);
1203
1204 function data = reload_gui_area_file(data, area_file)
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214 H = data.H;
1215
1216
1217 set(H.area_file_edit, 'String', area_file);
1218
1219
1220 keys = {};
1221 project_root = get(H.project_root_edit, 'String');
1222 load([project_root filesep area_file], 'Area');
1223 for n = 1 : length(Area)
1224 keys{n} = Area{n}.key;
1225 end
1226
1227
1228 set(H.area_key_listbox, 'String', keys);
1229 set(H.area_key_listbox, 'Value', 1);
1230
1231
1232 bayes_parm.area_key_global = keys{1};
1233 bayes_parm_editor(data.main_obj, 'merge_bayes_parm', bayes_parm);
1234
1235 function [match_time, err] = time_match_sample_point(data, time, file_type)
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251 match_time = [];
1252 err = false;
1253
1254 [index, err] = bayes_parm_editor(data.main_obj, ...
1255 'time_to_index', ...
1256 time, file_type);
1257 if err, return; end
1258 [match_time, err] = bayes_parm_editor(data.main_obj, ...
1259 'index_to_time', ...
1260 index, file_type);
1261 if err, return; end
1262
1263 function [ceil_time_len, err] = ceil_time_length(data, time_len, file_type)
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276 ceil_time_len = [];
1277 err = false;
1278
1279 [data_len, err] = bayes_parm_editor(data.main_obj, ...
1280 'time_len_to_data_len',...
1281 time_len, ...
1282 file_type);
1283
1284
1285 analysis_time_from_msec = ...
1286 str2double(get(data.H.whole_time_window_from_edit, 'String'));
1287 analysis_time_to_msec = ...
1288 str2double(get(data.H.whole_time_window_to_edit, 'String'));
1289
1290 [analysis_time_from_sample, err] = bayes_parm_editor(data.main_obj, ...
1291 'time_len_to_data_len', ...
1292 analysis_time_from_msec, ...
1293 file_type);
1294
1295 if err, return; end
1296 [analysis_time_to_sample, err] = bayes_parm_editor(data.main_obj, ...
1297 'time_len_to_data_len', ...
1298 analysis_time_to_msec, ...
1299 file_type);
1300 analysis_time_sample = ...
1301 analysis_time_to_sample - analysis_time_from_sample + 1;
1302
1303
1304 [time_sample, err] = bayes_parm_editor(data.main_obj, ...
1305 'time_len_to_data_len', ...
1306 time_len, ...
1307 file_type);
1308
1309 if time_sample > analysis_time_sample
1310 time_sample = analysis_time_sample;
1311 end
1312 [ceil_time_len, err] = bayes_parm_editor(data.main_obj, ...
1313 'data_len_to_time_len', ...
1314 time_sample, ...
1315 file_type);
1316 if err, return;end;
1317
1318 function [meg_info, err] = get_meg_file_info(data)
1319
1320
1321
1322
1323
1324
1325
1326 err = false;
1327 meg_info = bayes_parm_editor(data.main_obj, 'get_megfile_info');
1328 if isempty(meg_info)
1329 errordlg('select meg file.', 'Error');
1330 err = true;
1331 end
1332
1333 function [err] = set_meg_file_info(data, meg_file)
1334
1335
1336
1337
1338
1339
1340
1341 err = false;
1342 try
1343 bayes_parm_editor(data.main_obj, 'set_megfile_info', meg_file);
1344 catch
1345 err = true;
1346 errordlg('file read error occured.', 'Error');
1347 end
1348
1349 function [s_noise_file_info, err] = get_sensor_noise_file_info(data)
1350
1351
1352
1353
1354
1355
1356
1357 err = false;
1358 s_noise_file_info = bayes_parm_editor(data.main_obj, ...
1359 'get_sensor_noise_file_info');
1360 if isempty(s_noise_file_info)
1361 errordlg('select meg file.', 'Error');
1362
1363 err = true;
1364 end
1365
1366 function [err] = set_sensor_noise_file_info(data, s_noise_file)
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376 err = false;
1377 try
1378 bayes_parm_editor(data.main_obj, ...
1379 'set_sensor_noise_file_info', s_noise_file);
1380 catch
1381 err = true;
1382 errordlg('file read error occured.', 'Error');
1383 end
1384
1385 function [forward_model] = get_forward_model(H)
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395 forward_model = STR_FORWARD_MODEL_FOCAL;
1396
1397 function H = set_forward_model(H, forward_model, force_update)
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407 if ~exist('force_update', 'var')
1408 force_update = false;
1409 end
1410
1411
1412
1413
1414
1415
1416 current_model = get_forward_model(H);
1417 if ((force_update == true) || ~(strcmp(current_model, forward_model)))
1418
1419 change_forward_model(H, forward_model);
1420 end
1421
1422 function [estimation_model_number] = get_noise_estimation_model(H)
1423
1424
1425
1426
1427
1428
1429
1430 models = get(H.noise_estimation_model_popup, 'String');
1431 noise_estimation_model = models{get(H.noise_estimation_model_popup, 'Value')};
1432
1433 switch(noise_estimation_model)
1434 case STR_COVARIANCE_NOISE
1435 estimation_model_number = 1;
1436 case STR_COVARIANCE_NOISE_NO_UPDATE
1437 estimation_model_number = 2;
1438 case STR_ISOTROPIC_NOISE
1439 estimation_model_number = 3;
1440 case STR_ISOTROPIC_NOISE_NO_GLOBAL_UPDATE
1441 estimation_model_number = 4;
1442 case STR_ISOTROPIC_NOISE_NO_UPDATE
1443 estimation_model_number = 5;
1444 end
1445
1446 function [treatable] = IsTreatableEstimationModel(bayes_parm)
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456 treatable = false;
1457
1458 switch(bayes_parm.forward_model)
1459 case STR_FORWARD_MODEL_FOCAL
1460 switch(bayes_parm.noise_estimation_model)
1461 case 1
1462 if (bayes_parm.update_sx == ON) && ...
1463 (bayes_parm.update_v == OFF) && ...
1464 (bayes_parm.noise_model == 3) && ...
1465 (bayes_parm.flag_baseline == 0) && ...
1466 (bayes_parm.flag_noise_set == 0)
1467
1468 treatable = true;
1469 end
1470 case 2
1471 if (bayes_parm.update_sx == OFF) && ...
1472 (bayes_parm.update_v == OFF) && ...
1473 (bayes_parm.noise_model == 3) && ...
1474 (bayes_parm.flag_baseline == 0) && ...
1475 (bayes_parm.flag_noise_set == 0)
1476
1477 treatable = true;
1478 end
1479 end
1480 case STR_FORWARD_MODEL_FOCAL_GLOBAL
1481 switch(bayes_parm.noise_estimation_model)
1482 case 1
1483 if (bayes_parm.update_sx == ON) && ...
1484 (bayes_parm.update_v == OFF) && ...
1485 (bayes_parm.noise_model == 3) && ...
1486 (bayes_parm.flag_baseline == 0) && ...
1487 (bayes_parm.flag_noise_set == 0)
1488
1489 treatable = true;
1490 end
1491 case 2
1492 if (bayes_parm.update_sx == OFF) && ...
1493 (bayes_parm.update_v == OFF) && ...
1494 (bayes_parm.noise_model == 3) && ...
1495 (bayes_parm.flag_baseline == 0) && ...
1496 (bayes_parm.flag_noise_set == 0)
1497
1498 treatable = true;
1499 end
1500 case 3
1501 if (bayes_parm.update_sx == ON) && ...
1502 (bayes_parm.update_v == ON) && ...
1503 (bayes_parm.noise_model == 1) && ...
1504 (bayes_parm.flag_baseline == 0) && ...
1505 (bayes_parm.flag_noise_set == 1)
1506
1507 treatable = true;
1508 end
1509 case 4
1510 if (bayes_parm.update_sx == ON) && ...
1511 (bayes_parm.update_v == OFF) && ...
1512 (bayes_parm.noise_model == 1) && ...
1513 (bayes_parm.flag_baseline == 0) && ...
1514 (bayes_parm.flag_noise_set == 1)
1515
1516 treatable = true;
1517 end
1518 case 5
1519 if (bayes_parm.update_sx == OFF) && ...
1520 (bayes_parm.update_v == OFF) && ...
1521 (bayes_parm.noise_model == 1) && ...
1522 (bayes_parm.flag_baseline == 0) && ...
1523 (bayes_parm.flag_noise_set == 1)
1524
1525 treatable = true;
1526 end
1527 end
1528 end
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538 function [v] = STR_FORWARD_MODEL_FOCAL
1539 v = 'focal';
1540 function [v] = STR_FORWARD_MODEL_FOCAL_GLOBAL
1541 v = 'focal+global';
1542
1543
1544
1545
1546 function [v] = STR_COVARIANCE_NOISE
1547 v = 'COVARIANCE NOISE';
1548 function [v] = STR_COVARIANCE_NOISE_NO_UPDATE
1549 v = 'COVARIANCE NOISE(NO UPDATE)';
1550 function [v] = STR_ISOTROPIC_NOISE
1551 v = 'ISOTROPIC NOISE';
1552 function [v] = STR_ISOTROPIC_NOISE_NO_GLOBAL_UPDATE
1553 v = 'ISOTROPIC NOISE(NO GLOBAL UPDATE)';
1554 function [v] = STR_ISOTROPIC_NOISE_NO_UPDATE
1555 v = 'ISOTROPIC NOISE(NO UPDATE)';
1556