Changeset 415 for trunk/src/civ.m
- Timestamp:
- May 9, 2012, 2:20:26 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r414 r415 23 23 %TODO: search range 24 24 25 % Last Modified by GUIDE v2.5 10-Mar-2012 22:32:1025 % Last Modified by GUIDE v2.5 08-May-2012 22:14:39 26 26 % Begin initialization code - DO NOT EDIT 27 27 gui_Singleton = 1; … … 496 496 TimeUnit=XmlData.TimeUnit; 497 497 end 498 pxcmx_search=1; 499 pxcmy_search=1; 498 pxcm_search=1; 500 499 if isfield(XmlData,'GeometryCalib') 501 500 tsai=XmlData.GeometryCalib; 502 if isfield(tsai,'f') && isfield(tsai,'Tz') && isfield(tsai,'dpx') && isfield(tsai,'dpy')&& isfield(tsai,'R') 503 rot2D=tsai.R(1:2,[1,2]); 504 pxcmx_search=tsai.f * sqrt(det(rot2D))/(tsai.Tz*tsai.dpx); 505 pxcmy_search=tsai.f * sqrt(det(rot2D))/(tsai.Tz*tsai.dpy); 501 if isfield(tsai,'fx_fy') 502 pxcm_search=max(tsai.fx_fy(1),tsai.fx_fy(2));%pixels:cm estimated for the search range 506 503 end 507 504 if isfield(tsai,'CoordUnit') … … 569 566 set(handles.nb_field2,'String',num2str(MaxIndex_j)); 570 567 set(handles.CoordUnit,'String',CoordUnit) 571 set(handles.SearchRange,'UserData', [pxcmx_search pxcmy_search]);568 set(handles.SearchRange,'UserData', pxcm_search); 572 569 set(handles.ImaExt,'String',ImaExt) 573 570 set(handles.NomType,'String',NomTypeIma) … … 3197 3194 set(gcf,'Pointer','arrow') 3198 3195 3199 %------------------------------------------------------------------- 3200 % --- 3201 function closeview_field(gcbo,eventdata) 3202 hview_field=findobj(allchild(0),'tag','view_field');% look for view_field 3203 if ~isempty(hview_field) 3204 delete(hview_field) 3205 end 3196 3206 3197 3207 3208 %------------------------------------------------------------------------ 3209 % call 'view_field.fig' to display the field selected in the list of 'status' 3210 function open_view_field(hObject, eventdata) 3211 %------------------------------------------------------------------------ 3212 list=get(hObject,'String'); 3213 index=get(hObject,'Value'); 3214 rootroot=get(hObject,'UserData'); 3215 filename=list{index}; 3216 ind_dot=strfind(filename,'...'); 3217 filename=filename(1:ind_dot-1); 3218 filename=fullfile(rootroot,filename); 3219 delete(get(hObject,'parent'))%delete the display figure to stop the check process 3220 if exist(filename,'file')%visualise the vel field if it exists 3221 uvmat(filename) 3222 set(gcbo,'Value',1) 3223 end 3198 % %------------------------------------------------------------------------ 3199 % % call 'view_field.fig' to display the field selected in the list of 'status' 3200 % function open_view_field(hObject, eventdata) 3201 % %------------------------------------------------------------------------ 3202 % list=get(hObject,'String'); 3203 % index=get(hObject,'Value'); 3204 % rootroot=get(hObject,'UserData'); 3205 % filename=list{index}; 3206 % ind_dot=strfind(filename,'...'); 3207 % filename=filename(1:ind_dot-1); 3208 % filename=fullfile(rootroot,filename); 3209 % delete(get(hObject,'parent'))%delete the display figure to stop the check process 3210 % if exist(filename,'file')%visualise the vel field if it exists 3211 % uvmat(filename) 3212 % set(gcbo,'Value',1) 3213 % end 3224 3214 3225 3215 %------------------------------------------------------------------------ … … 3264 3254 %------------------------------------------------------------------------ 3265 3255 %determine pair numbers 3266 if strcmp(get(handles. umin,'Visible'),'off')3256 if strcmp(get(handles.num_UMin,'Visible'),'off') 3267 3257 set(handles.u_title,'Visible','on') 3268 3258 set(handles.v_title,'Visible','on') 3269 set(handles. umin,'Visible','on')3270 set(handles. umax,'Visible','on')3271 set(handles. vmin,'Visible','on')3272 set(handles. vmax,'Visible','on')3259 set(handles.num_UMin,'Visible','on') 3260 set(handles.num_UMax,'Visible','on') 3261 set(handles.num_VMin,'Visible','on') 3262 set(handles.num_VMax,'Visible','on') 3273 3263 set(handles.CoordUnit,'Visible','on') 3274 3264 set(handles.TimeUnit,'Visible','on') … … 3284 3274 % --- determine the search range num_Searchx,num_Searchy and shift 3285 3275 function get_search_range(hObject, eventdata, handles) 3286 umin=str2double(get(handles.umin,'String')); 3287 umax=str2double(get(handles.umax,'String')); 3288 vmin=str2double(get(handles.umin,'String')); 3289 vmax=str2double(get(handles.vmax,'String')); 3276 %------------------------------------------------------------------------ 3277 param_civ1=read_GUI(handles.Civ1); 3278 umin=param_civ1.UMin; 3279 umax=param_civ1.UMax; 3280 vmin=param_civ1.VMin; 3281 vmax=param_civ1.VMax; 3290 3282 %switch min_title and max_title in case of error 3291 3283 if umax<=umin … … 3293 3285 umin=umax; 3294 3286 umax=umin_old; 3295 set(handles. umin,'String', num2str(umin))3296 set(handles. umax,'String', num2str(umax))3287 set(handles.num_UMin,'String', num2str(umin)) 3288 set(handles.num_UMax,'String', num2str(umax)) 3297 3289 end 3298 3290 if vmax<=vmin … … 3300 3292 vmin=vmax; 3301 3293 vmax=vmin_old; 3302 set(handles. vmin,'String', num2str(vmin))3303 set(handles. vmax,'String', num2str(vmax))3294 set(handles.num_VMin,'String', num2str(vmin)) 3295 set(handles.num_VMax,'String', num2str(vmax)) 3304 3296 end 3305 if ~(is nan(umin)||isnan(umax)||isnan(vmin)||isnan(vmax))3297 if ~(isempty(umin)||isempty(umax)||isempty(vmin)||isempty(vmax)) 3306 3298 list_pair=get(handles.ListPairCiv1,'String');%get the menu of image pairs 3307 3299 index=get(handles.ListPairCiv1,'Value'); 3308 displ_num=get(handles.ListPairCiv1,'UserData');3300 pair_string=list_pair{index}; 3309 3301 time=get(handles.ImaDoc,'UserData'); %get the set of times 3310 pxcm_xy=get(handles.SearchRange,'UserData'); 3311 pxcmx=pxcm_xy(1); 3312 pxcmy=pxcm_xy(2); 3302 pxcm=get(handles.SearchRange,'UserData'); 3313 3303 mode_list=get(handles.ListPairMode,'String'); 3314 3304 mode_value=get(handles.ListPairMode,'Value'); 3315 mode=mode_list{mode_value}; 3305 mode=mode_list{mode_value}; 3316 3306 if isequal (mode, 'series(Di)' ) 3317 3307 ref_i=str2double(get(handles.ref_i,'String')); … … 3326 3316 num_a=ref_j-floor(index/2);% first image numbers 3327 3317 num_b=ref_j+ceil(index/2); 3328 elseif isequal(mode,'pair j1-j2') %case of bursts (png_old or png_2D) 3318 elseif isequal(mode,'pair j1-j2') %case of bursts (png_old or png_2D) 3329 3319 ref_i=str2double(get(handles.ref_i,'String')); 3330 3320 num1=ref_i; 3331 3321 num2=ref_i; 3332 num_a=displ_num(1,index); 3333 num_b=displ_num(2,index); 3334 end 3335 dt=time(num2,num_b)-time(num1,num_a); 3322 r=regexp(pair_string,'(?<mode>(Di=)|(Dj=)) -*(?<num1>\d+)\|(?<num2>\d+)','names'); 3323 if isempty(r) 3324 r=regexp(pair_string,'(?<num1>\d+)(?<mode>-)(?<num2>\d+)','names'); 3325 end 3326 num_a=str2num(r.num1); 3327 num_b=str2num(r.num2); 3328 end 3329 dt=time(num2+1,num_b+1)-time(num1+1,num_a+1); 3336 3330 ibx=str2double(get(handles.num_Bx,'String')); 3337 3331 iby=str2double(get(handles.num_By,'String')); 3338 umin=dt*pxcm x*umin;3339 umax=dt*pxcm x*umax;3340 vmin=dt*pxcm y*vmin;3341 vmax=dt*pxcm y*vmax;3332 umin=dt*pxcm*umin; 3333 umax=dt*pxcm*umax; 3334 vmin=dt*pxcm*vmin; 3335 vmax=dt*pxcm*vmax; 3342 3336 shiftx=round((umin+umax)/2); 3343 3337 shifty=round((vmin+vmax)/2); 3344 isx=(umax+2-shiftx)*2+ ibx;3338 isx=(umax+2-shiftx)*2+param_civ1.Bx; 3345 3339 isx=2*ceil(isx/2)+1; 3346 isy=(vmax+2-shifty)*2+ iby;3340 isy=(vmax+2-shifty)*2+param_civ1.Bx; 3347 3341 isy=2*ceil(isy/2)+1; 3348 3342 set(handles.num_Shiftx,'String',num2str(shiftx)); … … 4002 3996 end 4003 3997 3998 %------------------------------------------------------------------------ 3999 %----function introduced for the correlation window figure, activated by deleting this window 4000 function closeview_field(gcbo,eventdata) 4001 %------------------------------------------------------------------------ 4002 hview_field=findobj(allchild(0),'tag','view_field');% look for view_field 4003 if ~isempty(hview_field) 4004 delete(hview_field) 4005 end 4004 4006 4005 4007 %------------------------------------------------------------------------ … … 4461 4463 set(handles.num_Rho,'String','1') 4462 4464 set(handles.BATCH,'Enable','on') 4465 set(handles.CheckThreshold,'Visible','off') 4466 set(handles.CheckDeformation,'Value',1) 4467 set(handles.CheckDecimal,'Value',1) 4463 4468 case 'Matlab' 4464 4469 set(handles.num_MaxDiff,'Visible','on') … … 4471 4476 set(handles.num_Rho,'Value',1) 4472 4477 set(handles.num_Rho,'String',{'1';'2'}) 4478 set(handles.CheckThreshold,'Visible','on') 4479 set(handles.CheckDeformation,'Value',0)% desactivate (work in progress) 4480 set(handles.CheckDecimal,'Value',0)% desactivate (work in progress) 4473 4481 end 4474 4482
Note: See TracChangeset
for help on using the changeset viewer.