0001 function job_plot_cmap_register_area(inst_id)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 global vbmeg_inst;
0014 if isempty(vbmeg_inst.plotcmap{inst_id}.V), return; end
0015 if isempty(vbmeg_inst.plotcmap{inst_id}.Jact), return; end
0016
0017
0018
0019
0020
0021 ix_peak = vbmeg_inst.plotcmap{inst_id}.ix_peak;
0022 ed5 = vbmeg_inst.plotcmap{inst_id}.ed5;
0023 nextDD = vbmeg_inst.plotcmap{inst_id}.nextDD;
0024 nextIX = vbmeg_inst.plotcmap{inst_id}.nextIX;
0025
0026
0027
0028
0029
0030 R = str2num(get(ed5,'String'))*1e-3;
0031 ix_area = find(nextDD{ix_peak}<=R);
0032 ix_area = nextIX{ix_peak}(ix_area);
0033
0034 [brain_dir,brain_file] ...
0035 = vb_file_select({'.area.mat'},'Select area file');
0036
0037 if ~isempty(brain_file),
0038 areafile = [brain_dir filesep brain_file{1}];
0039
0040 prompt = {'Enter arbitrary string as ID of area'};
0041 title = 'Area registration';
0042 lines= 1;
0043 def = {'new area'};
0044 str = inputdlg(prompt,title,lines,def);
0045
0046 if isempty(str),
0047 return;
0048 elseif ~isempty(str{1}),
0049 area_new.key = str{1};
0050 area_new.Iextract = ix_area;
0051
0052 vb_add_area(areafile,area_new);
0053 end
0054 end
0055
0056 return;