Changeset 300
- Timestamp:
- Nov 24, 2011, 10:34:50 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r298 r300 404 404 end 405 405 406 % %% default first_i and j and increments407 % first_i=str2double(get(handles.first_i,'String'));%value possibly set by uvmat_Opening408 % if isnan(first_i)|| first_i < 1409 % first_i=1; %default first_i410 % end411 % last_i=str2double(get(handles.last_i,'String'));412 % if isnan(last_i)|| last_i < first_i413 % last_i=first_i; %default last_i414 % end415 % first_j=str2double(get(handles.first_j,'String'));416 % if isnan(first_j)|| first_j < 1417 % first_j=1; %default first_j418 % end419 % last_j=str2double(get(handles.last_j,'String'));420 % if isnan(last_j)|| last_j < first_j421 % last_j=first_j; %default last_j422 % end423 % incr_i=str2double(get(handles.incr_i,'String'));424 % if isnan(incr_i) || incr_i < 1;425 % set(handles.incr_i,'String','1') %default incr_i426 % end427 % incr_j=str2double(get(handles.incr_j,'String'));428 % if isnan(incr_j) || incr_j < 1;429 % set(handles.incr_j,'String','1') %default incr_j430 % end431 432 406 %% determine nomenclature types and extension of the input files 433 407 ext_ima='';%default … … 437 411 RootName=fullfile(RootPath,FileName); 438 412 set(handles.RootName,'String',RootName) 439 num_ref_i=str2double(i1_str); 440 num_ref_j=str2double(j1_str); 441 browse=[];%default 413 num_i1=str2double(i1_str); 414 num_i2=str2double(i2_str); 415 num_j1=str2double(j1_str); 416 num_j2=str2double(i2_str); 417 ref_i=num_i1;%efaulmt ref index 418 ref_j=num_j1; 419 browse.incr_pair=[0 0];%default 442 420 if ~isempty(imformats(ext_input(2:end)))||strcmp(lower(ext_input),'.avi')% if the extension corresponds to an image or movie format recognized by Matlab 443 421 ext_ima=ext_input; … … 445 423 else %case of netcdf input file, look for corresponding images 446 424 nom_type_nc=nom_type_input; 425 if ~isempty(num_i2) 426 ref_i=floor((ref_i+num_i2)/2);% reference image number corresponding to the file 427 browse.incr_pair(1)=num_i2-num_i1; 428 browse.incr_pair(2)=0; 429 end 447 430 %TODO: read the image name in the netcdf file (if documented) 448 431 dirima='';%default … … 495 478 end 496 479 end 497 set(handles.RootName,'UserData',browse); 480 498 481 % ext_imadoc=get(handles.ImaDoc,'String'); 499 482 % browse=get(handles.RootName,'UserData');%default … … 642 625 set(handles.first_j,'String',num2str(num_ref_j)); 643 626 set(handles.last_j,'String',num2str(num_ref_j));% 644 browse.nom_type_ima=nom_type_ima;645 set(handles.RootName,'UserData',browse)% store the nomenclature type646 627 647 628 %% set the civ options depending on the input file content … … 660 641 set(handles.(ListOptions{index}),'value',0) 661 642 end 662 for index = ind_opening+1 :length(ListOptions)643 for index = ind_opening+1 663 644 set(handles.(ListOptions{index}),'value',1) 664 645 end … … 682 663 683 664 %% update the subdirectory display 684 listot=dir(RootPath); 665 listot=dir(RootPath);%directory of RootPath 685 666 idir=0; 686 667 listdir={''};%default 668 % get the list of existing civ subdirectories in the path of theinput root file 687 669 for ilist=1:length(listot) 688 670 if listot(ilist).isdir … … 695 677 end 696 678 Value=find(strcmp(subdir,listdir));%search the index of subdir in the cell listdir 697 if isempty(Value) 698 ValueCiv1=get(handles.ListSubdirCiv1,'Value'); 679 if isempty(Value)% if the input subdir is not found 680 ValueCiv1=get(handles.ListSubdirCiv1,'Value');%read the currrently selected dir name 699 681 if ValueCiv1>numel(listdir) 700 682 ValueCiv1=1; 701 683 end 702 684 set(handles.ListSubdirCiv1,'Value',ValueCiv1) 685 set(handles.txt_SubdirCiv1,'String',listdir{ValueCiv1}) 703 686 ValueCiv2=get(handles.ListSubdirCiv2,'Value'); 704 687 if ValueCiv2>numel(listdir) … … 706 689 end 707 690 set(handles.ListSubdirCiv2,'Value',ValueCiv2) 708 else 709 set(handles.ListSubdirCiv1,'Value',Value) 710 set(handles.ListSubdirCiv2,'Value',Value) 711 end 712 set(handles.ListSubdirCiv1,'Value',1) 713 set(handles.ListSubdirCiv2,'Value',1) 691 set(handles.txt_SubdirCiv2,'String',listdir{ValueCiv2}) 692 else 693 set(handles.txt_SubdirCiv1,'String',listdir{Value}) 694 set(handles.txt_SubdirCiv2,'String',listdir{Value}) 695 end 696 set(handles.ListSubdirCiv1,'Value',Value) 697 set(handles.ListSubdirCiv2,'Value',Value) 714 698 set(handles.ListSubdirCiv1,'String',[listdir;'new...']) 715 699 set(handles.ListSubdirCiv2,'String',[listdir;'new...']) 716 700 if isempty(listdir) 717 dirname='CIV';718 else 719 dirname=listdir{1}; %default civ directory name 720 end 721 set(handles.txt_SubdirCiv1,'String',dirname) 722 set(handles.txt_SubdirCiv2,'String',dirname) 723 701 set(handles.txt_SubdirCiv1,'String','CIV') 702 set(handles.txt_SubdirCiv2,'String','CIV') 703 end 704 705 %% store info 706 browse.nom_type_ima=nom_type_ima; 707 set(handles.RootName,'UserData',browse)% store the nomenclature type 724 708 725 709 %% list the possible index pairs, depending on the option set in ListPairMode … … 972 956 % be performed, while the result is needed for next steps. 973 957 displ_pair={''}; 974 select=ones(size(1:nbpair)) ;%flag for displayed pairs =1 for display958 select=ones(size(1:nbpair))%flag for displayed pairs =1 for display 975 959 testpair=0; 976 960 % case with no checkciv1 operation, netcdf files need to exist for reading … … 1054 1038 end 1055 1039 set(handles.ListPairCiv1,'String',displ_pair'); 1056 ichoice=find(select,1); 1040 1041 %% determine the default selection in the pair menu 1042 ichoice=find(select,1)% index of selected pair 1057 1043 if (isempty(ichoice) || ichoice < 1); ichoice=1; end; 1058 initial=get(handles.ListPairCiv1,'Value') ;%initial choice of pair1059 if initial>nbpair 1044 initial=get(handles.ListPairCiv1,'Value')%initial choice of pair 1045 if initial>nbpair || (numel(select)>=initial && ~isequal(select(initial),1)) 1060 1046 set(handles.ListPairCiv1,'Value',ichoice);% first valid pair proposed by default in the menu 1061 1047 end 1062 if numel(select)>=initial && ~isequal(select(initial),1)1063 set(handles.ListPairCiv1,'Value',ichoice);% first valid pair proposed by default in the menu1064 end1048 % if numel(select)>=initial && ~isequal(select(initial),1) 1049 % set(handles.ListPairCiv1,'Value',ichoice);% first valid pair proposed by default in the menu 1050 % end 1065 1051 1066 1052 %set(handles.ListPairCiv2,'String',displ_pair'); … … 1129 1115 subdir_civ1=get(handles.txt_SubdirCiv1,'String');%subdirectory subdir_civ1 for the netcdf data 1130 1116 subdir_civ2=get(handles.txt_SubdirCiv2,'String');%subdirectory subdir_civ2 for the netcdf data 1131 % first_i=str2num(get(handles.first_i,'String'));1132 % last_i=str2num(get(handles.last_i,'String'));1133 % incr=str2num(get(handles.incr_i,'String'));1134 % num1=first_i:incr:last_i;1135 % if isempty(num1)1136 % set(handles.ListPairCiv2,'Value',1);1137 % set(handles.ListPairCiv2,'String',{''});1138 % return1139 % end1140 1117 ref_i=str2double(get(handles.ref_i,'String')); 1141 1118 if isequal(mode,'pair j1-j2')%|isequal(mode,'st_pair j1-j2') … … 1148 1125 time=[0 1];%default 1149 1126 end 1150 %dt_unit=str2num(get(handles.dt,'String'));% used when there is no image documentation file1151 %dt_unit=1000;1152 1127 displ_num=get(handles.ListPairCiv1,'UserData'); 1153 1154 1128 1155 1129 %eliminate the first pairs inconsistent with the position … … 3077 3051 checkbox(4)=get(handles.CheckCiv2,'Value'); 3078 3052 checkbox(5)=get(handles.CheckFix2,'Value'); 3079 checkbox(6)=get(handles.CheckPatch2,'Value') 3080 ind_selected=find(checkbox );3053 checkbox(6)=get(handles.CheckPatch2,'Value'); 3054 ind_selected=find(checkbox,1); 3081 3055 if ~isempty(ind_selected) 3082 3056 RootName=get(handles.RootName,'String'); … … 3090 3064 set(handles.ListSubdirCiv1,'Visible','on') 3091 3065 find_netcpair_civ1(handles) % select the available netcdf files 3092 % check_civ2pair=ind_selected(4;6);3093 3066 if max(checkbox(4:6))% case of civ2 pair choice needed 3094 3067 set(handles.TitlePairCiv2,'Visible','on') … … 3104 3077 set(handles.ListPairCiv2,'Visible','off') 3105 3078 end 3106 %index_last=find(checkbox,1,'last');%last selected button3107 3079 options={'Civ1','Fix1','Patch1','Civ2','Fix2','Patch2'}; 3108 3080 for ilist=1:length(options)
Note: See TracChangeset
for help on using the changeset viewer.