Changeset 224 for trunk/src/mouse_motion.m
- Timestamp:
- Mar 18, 2011, 10:41:48 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mouse_motion.m
r213 r224 220 220 isx2=floor((str2double(par.isx)-1)/2); 221 221 isy2=floor((str2double(par.isy)-1)/2); 222 shiftx=str2double(par.shiftx); 223 shifty=str2double(par.shifty); 222 224 hhh=findobj(haxes,'Tag','PIV_box_marker'); 223 225 hhhh=findobj(haxes,'Tag','PIV_search_marker'); 224 226 if isempty(hhh) 225 %hstack=findobj(allchild(0),'Type','figure');%current stack order of figures in matlab226 227 set(0,'CurrentFigure',currentfig) 227 228 set(currentfig,'CurrentAxes',haxes) … … 230 231 'LineStyle','-','Tag','PIV_box_marker'); 231 232 rectangle('Curvature',[0 0],... 232 'Position',[xround-isx2 yround-isy22*isx2 2*isy2],'EdgeColor','m',...233 'Position',[xround-isx2+shiftx yround-isy2+shifty 2*isx2 2*isy2],'EdgeColor','m',... 233 234 'LineStyle','- -','Tag','PIV_search_marker'); 234 % set(0,'Children',hstack);%put back the initial figure stack after plot creation235 235 else 236 236 % set(hhh,'Visible','on') 237 237 set(hhh,'Position',[xround-ibx2 yround-iby2 2*ibx2 2*iby2]) 238 set(hhhh,'Position',[xround-isx2 yround-isy2 2*isx2 2*isy2]) 239 end 240 Asub=Field.A(xround-ibx2:xround+ibx2,yround-iby2:yround+iby2); 241 Asub=reshape(Asub,[],1); 242 rangx(1)=-(isx2-ibx2); 243 rangx(2)=isx2-ibx2; 244 rangy(1)=isy2-iby2; 245 rangy(2)=-(isy2-iby2); 238 set(hhhh,'Position',[xround-isx2+shiftx yround-isy2+shifty 2*isx2 2*isy2]) 239 end 240 Asub=Field.A(yround-iby2:yround+iby2,xround-ibx2:xround+ibx2);%first sub-image 241 Asub=reshape(Asub,[],1);%first sub-image reshaped as matlab vector 242 rangx(1)=-(isx2-ibx2)+shiftx; 243 rangx(2)=isx2-ibx2+shiftx 244 rangy(1)=-(isy2-iby2)-shifty; 245 rangy(2)=(isy2-iby2)-shifty 246 correl=zeros(rangy(2)-rangy(1)+1,rangx(2)-rangx(1)+1); 246 247 for id=rangx(1):rangx(2) 247 for jd=rangy( 2):rangy(1)248 Bsub=Field.B( xround-ibx2+id:xround+ibx2+id,yround-iby2+jd:yround+iby2+jd);248 for jd=rangy(1):rangy(2) 249 Bsub=Field.B(yround-iby2+jd:yround+iby2+jd,xround-ibx2+id:xround+ibx2+id); 249 250 Bsub=reshape(Bsub,[],1); 250 correl(jd-rangy( 2)+1,id-rangx(1)+1)=corr(double(Asub),double(Bsub));251 correl(jd-rangy(1)+1,id-rangx(1)+1)=corr(double(Asub),double(Bsub)); 251 252 end 252 253 end … … 261 262 if isempty(hcorr) 262 263 corrfig=findobj(allchild(0),'tag','corrfig'); 263 if isempty(corrfig) 264 corrfig=figure; 265 set(corrfig,'tag','corrfig') 266 end 267 set(0,'CurrentFigure',corrfig) 268 AxeData.CurrentCorrImage=imagesc(rangx,rangy,correl,[0 1]); 269 colorbar 270 % map_r=ones(42,1)*[1 0 0]; 271 % map_g=ones(11,1)*[0 1 0]; 272 % map_b=ones(11,1)*[0 0 1]; 273 % map=[map_r;map_g;map_b]; 274 % set(corrfig,'colormap',map) 275 set(haxes,'UserData',AxeData) 264 if ~isempty(corrfig) 265 set(0,'CurrentFigure',corrfig(1)) 266 AxeData.CurrentCorrImage=imagesc(rangx,-rangy,correl,[0 1]); 267 colorbar 268 set(haxes,'UserData',AxeData) 269 set(get(AxeData.CurrentCorrImage,'parent'),'YDir','normal') 270 end 276 271 else 277 272 set(AxeData.CurrentCorrImage,'CData',correl) 273 set(AxeData.CurrentCorrImage,'XData',rangx) 274 set(AxeData.CurrentCorrImage,'YData',-rangy) 278 275 end 279 276 end
Note: See TracChangeset
for help on using the changeset viewer.