- Timestamp:
- Mar 11, 2012, 11:47:21 AM (13 years ago)
- Location:
- trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r382 r384 23 23 %TODO: search range 24 24 25 % Last Modified by GUIDE v2.5 27-Jan-2012 00:32:3325 % Last Modified by GUIDE v2.5 10-Mar-2012 22:32:10 26 26 % Begin initialization code - DO NOT EDIT 27 27 gui_Singleton = 1; … … 281 281 end 282 282 set(handles.RootPath,'BackgroundColor',[1 1 1])%paint RootName back to white to indicate that the file input is finished 283 283 284 %------------------------------------------------------------------------ 284 285 % --- general function activated for an input file series … … 1035 1036 %could be included in get_mask callback ? 1036 1037 if isequal(get(handles.CheckMask,'Value'),1) 1037 maskname=get(handles. txt_Mask,'String');1038 maskname=get(handles.Mask,'String'); 1038 1039 if ~exist(maskname,'file') 1039 1040 get_mask_civ1_Callback(hObject, eventdata, handles); … … 1041 1042 end 1042 1043 if isequal(get(handles.CheckMask,'Value'),1) 1043 maskname=get(handles. txt_Mask,'String');1044 maskname=get(handles.Mask,'String'); 1044 1045 if ~exist(maskname,'file') 1045 1046 get_mask_fix1_Callback(hObject, eventdata, handles); … … 1047 1048 end 1048 1049 if isequal(get(handles.CheckMask,'Value'),1) 1049 maskname=get(handles. txt_Mask,'String');1050 maskname=get(handles.Mask,'String'); 1050 1051 if ~exist(maskname,'file') 1051 1052 get_mask_civ2_Callback(hObject, eventdata, handles); … … 1053 1054 end 1054 1055 if isequal(get(handles.CheckMask,'Value'),1) 1055 maskname=get(handles. txt_Mask,'String');1056 maskname=get(handles.Mask,'String'); 1056 1057 if ~exist(maskname,'file') 1057 1058 get_mask_fix2_Callback(hObject, eventdata, handles); … … 3310 3311 maskval=get(handles.CheckMask,'Value'); 3311 3312 if isequal(maskval,0) 3312 set(handles. txt_Mask,'String','')3313 set(handles.Mask,'String','') 3313 3314 else 3314 3315 mask_displ='no mask'; %default … … 3343 3344 set(handles.CheckMask,'Value',1) 3344 3345 end 3345 set(handles. txt_Mask,'String',mask_displ)3346 set(handles. txt_Mask,'String',mask_displ)3347 set(handles. txt_Mask,'String',mask_displ)3346 set(handles.Mask,'String',mask_displ) 3347 set(handles.Mask,'String',mask_displ) 3348 set(handles.Mask,'String',mask_displ) 3348 3349 end 3349 3350 … … 3354 3355 maskval=get(handles.CheckMask,'Value'); 3355 3356 if isequal(maskval,0) 3356 set(handles. txt_Mask,'String','')3357 set(handles.Mask,'String','') 3357 3358 else 3358 3359 mask_displ='no mask'; %default … … 3385 3386 set(handles.CheckMask,'Value',1) 3386 3387 end 3387 set(handles. txt_Mask,'String',mask_displ)3388 set(handles. txt_Mask,'String',mask_displ)3388 set(handles.Mask,'String',mask_displ) 3389 set(handles.Mask,'String',mask_displ) 3389 3390 end 3390 3391 … … 3395 3396 maskval=get(handles.CheckMask,'Value'); 3396 3397 if isequal(maskval,0) 3397 set(handles. txt_Mask,'String','')3398 set(handles.Mask,'String','') 3398 3399 else 3399 3400 mask_displ='no mask'; %default … … 3423 3424 set(handles.CheckMask,'Value',0) 3424 3425 end 3425 set(handles. txt_Mask,'String',mask_displ)3426 set(handles.Mask,'String',mask_displ) 3426 3427 end 3427 3428 … … 3676 3677 % stage=4;%default 3677 3678 if strcmp(parent_tag,'Civ1') 3678 set(handles. txt_Mask,'Visible','on')3679 set(handles. txt_Mask,'String',filemask)3679 set(handles.Mask,'Visible','on') 3680 set(handles.Mask,'String',filemask) 3680 3681 set(handles.CheckMask,'Value',1) 3681 3682 end … … 3688 3689 % % stage=4; 3689 3690 % end 3690 % set(handles. txt_Mask(stage:end),'Visible','on')3691 % set(handles. txt_Mask(stage:end),'String',filemask)3691 % set(handles.Mask(stage:end),'Visible','on') 3692 % set(handles.Mask(stage:end),'String',filemask) 3692 3693 % set(handles.CheckMask(stage:end),'Value',1) 3693 3694 else … … 4380 4381 4381 4382 function NomType_Callback(hObject, eventdata, handles) 4382 4383 set(handles.RootPath,'BackgroundColor',[1 1 0])%paint RootName edit box in yellow to indicate that the file input is proceeding 4384 RootPath=get(handles.RootPath,'String'); 4385 RootFile=get(handles.RootFile,'String'); 4386 ref_i=str2num(get(handles.ref_i,'String')); 4387 ref_j=str2num(get(handles.ref_j,'String')); 4388 NomType=get(handles.NomType,'String'); 4389 ImaExt=get(handles.ImaExt,'String'); 4390 fileinput=fullfile_uvmat(RootPath,'',RootFile,ImaExt,NomType,ref_i,[],ref_j); 4391 errormsg=display_file_name(handles,fileinput); 4392 if ~isempty(errormsg) 4393 msgbox_uvmat('ERROR',errormsg) 4394 end 4395 set(handles.RootPath,'BackgroundColor',[1 1 1])%paint RootName back to white to indicate that the file input is finished 4383 4396 4384 4397 % --- Executes on selection change in ListProgram. -
trunk/src/fileparts_uvmat.m
r379 r384 93 93 end 94 94 NomType=[get_type(num3) delim2 get_type(num2) delim1 get_type(num1)]; 95 RootFile=regexprep(FileName,[num3 delim2 num2 delim1 num1 ],'');95 RootFile=regexprep(FileName,[num3 delim2 num2 delim1 num1 '$'],''); 96 96 else 97 97 switch delim1 … … 110 110 i1=str2double(num1); 111 111 NomType=get_type(num1); 112 RootFile=regexprep(FileName, num1,'');112 RootFile=regexprep(FileName,[num1 '$'],''); 113 113 end 114 114 else% FileName ends with a letter -
trunk/src/find_file_series.m
r379 r384 63 63 RootFile=''; 64 64 end 65 else 65 else 66 %% possibly include the first index in the root name, if there exists a corresponding xml file 67 NomTypePref=''; 68 RootFileNew=RootFile; 69 if ~isempty(regexp(NomType,['^_'])) 70 NomTypePref='_'; 71 RootFileNew=[RootFileNew '_']; 72 end 73 r=regexp(NomType,['^' NomTypePref '(?<num1>\d+)'],'names');%look for a number at the beginning of NomTypeSt 74 if ~isempty(r) 75 NomTypePref=[NomTypePref r.num1]; 76 fileinput_end=regexprep(fileinput,['^' RootFileNew],''); 77 r=regexp(fileinput_end,'^(?<num1>\d+)','names'); 78 if ~isempty(r) 79 RootFileNew=[RootFileNew r.num1]; 80 end 81 if exist(fullfile(RootPath,[RootFileNew '.xml']),'file') 82 RootFile=RootFileNew; 83 NomType=regexprep(NomType,['^' NomTypePref],''); 84 i2_input=j2_input; 85 j1_input=[]; 86 j2_input=[]; 87 end 88 end 66 89 %% analyse the list of existing files when relevant 67 90 sep1=''; … … 205 228 else 206 229 [tild,tild,tild,tild,tild,tild,tild,tild,NomType]=fileparts_uvmat(dirpair(ifile_min).name);% update the representation of indices (number of 0 before the number) 230 NomType=regexprep(NomType,['^' NomTypePref],''); 207 231 end 208 232 end -
trunk/src/uvmat.m
r383 r384 1354 1354 MaskName=fullfile_uvmat(RootPath,'',RootFile,'.png',MaskData.NomType,num_i1_mask,[],num_j1); 1355 1355 %MaskName=name_generator(MaskData.Base,num_i1_mask,num_j1,'.png',MaskData.NomType); 1356 huvmat=get(handles.CheckMask,'parent'); 1357 UvData=get(huvmat,'UserData'); 1358 1356 % huvmat=get(handles.CheckMask,'parent'); 1357 UvData=get(handles.uvmat,'UserData'); 1359 1358 %update mask image if the mask is new 1360 1359 if ~ (isfield(UvData,'MaskName') && isequal(UvData.MaskName,MaskName)) 1361 1360 UvData.MaskName=MaskName; %update the recorded name on UvData 1362 set(h uvmat,'UserData',UvData);1361 set(handles.uvmat,'UserData',UvData); 1363 1362 if ~exist(MaskName,'file') 1364 1363 if isfield(MaskData,'maskhandle')&& ishandle(MaskData.maskhandle) … … 1430 1429 function MenuExportFigure_Callback(hObject, eventdata, handles) 1431 1430 %------------------------------------------------------------------------ 1432 huvmat=get(handles.MenuExport,'parent');1431 % huvmat=get(handles.MenuExport,'parent'); 1433 1432 hfig=figure; 1434 1433 copyobj(handles.axes3,hfig); … … 1570 1569 i1=str2num(get(handles.i1,'String'));%read the field indices (for movie, it is not given by the file name) 1571 1570 i2=str2num(get(handles.i2,'String')); 1572 j1=stra2num(get(handles.j1,'String')); 1573 j2=stra2num(get(handles.j2,'String')); 1571 j1=1; 1572 if strcmp(get(handles.j1,'Visible'),'on') 1573 j1=stra2num(get(handles.j1,'String')); 1574 end 1575 j2=j1; 1576 if strcmp(get(handles.j2,'Visible'),'on') 1577 j2=stra2num(get(handles.j2,'String')); 1578 end 1574 1579 sub_value= get(handles.SubField,'Value'); 1575 1580 if sub_value % a second input file has been entered … … 3195 3200 % associate the set_object interface handle to the plotting axes 3196 3201 if isfield(UvData.OpenParam,'SetObjectOrigin') 3197 pos_uvmat=get(h uvmat,'Position');3202 pos_uvmat=get(handles.uvmat,'Position'); 3198 3203 pos_set_object(1:2)=UvData.OpenParam.SetObjectOrigin + pos_uvmat(1:2); 3199 3204 pos_set_object(3:4)=UvData.OpenParam.SetObjectSize .* pos_uvmat(3:4); … … 3205 3210 UvData.MouseAction='none'; 3206 3211 end 3207 set(h uvmat,'UserData',UvData)3212 set(handles.uvmat,'UserData',UvData) 3208 3213 3209 3214 %------------------------------------------------------- … … 3520 3525 %-------------------------------------------- 3521 3526 %plot first histo 3522 huvmat=get(handles.histo1_menu,'parent');3527 %huvmat=get(handles.histo1_menu,'parent'); 3523 3528 histo_menu=get(handles.histo1_menu,'String'); 3524 3529 histo_value=get(handles.histo1_menu,'Value'); 3525 3530 FieldName=histo_menu{histo_value}; 3526 update_histo(handles.histo_u,h uvmat,FieldName)3531 update_histo(handles.histo_u,handles.uvmat,FieldName) 3527 3532 3528 3533 %------------------------------------------------------------------------ … … 3530 3535 %------------------------------------------------------------------------ 3531 3536 %plot second histo 3532 huvmat=get(handles.histo2_menu,'parent');3537 %huvmat=get(handles.histo2_menu,'parent'); 3533 3538 histo_menu=get(handles.histo2_menu,'String'); 3534 3539 histo_value=get(handles.histo2_menu,'Value'); 3535 3540 FieldName=histo_menu{histo_value}; 3536 update_histo(handles.histo_v,h uvmat,FieldName)3541 update_histo(handles.histo_v,handles.uvmat,FieldName) 3537 3542 3538 3543 %------------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.