- Timestamp:
- Dec 20, 2011, 5:14:43 PM (13 years ago)
- Location:
- trunk/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/find_file_series.m
r339 r342 143 143 break 144 144 end 145 else 146 ref_j=j1; 147 if isempty(j2_input) 148 if ~isempty(j2)% invalid file name if j2 does not exist in the input file 149 break 145 else %j1_input is not empty 146 if isempty(j1)% the detected name does not fit with the input 147 break 148 else 149 ref_j=j1; 150 if isempty(j2_input) 151 if ~isempty(j2)% invalid file name if j2 does not exist in the input file 152 break 153 end 154 else 155 ref_j=floor((j1+j2)/2); 150 156 end 151 else152 ref_j=floor((j1+j2)/2);153 157 end 154 158 end -
trunk/src/keyboard_callback.m
r192 r342 33 33 elseif isfield(AxeData,'LimEditBox')&& isequal(AxeData.LimEditBox,1)% update display of the GUI containing the axis (uvmat or view_field) 34 34 hh=guidata(hfig); 35 if isfield(hh,' MinX')36 set(hh. MinX,'String',num2str(xlimit(1)))37 set(hh. MaxX,'String',num2str(xlimit(2)))38 set(hh. MinY,'String',num2str(ylimit(1)))39 set(hh. MaxY,'String',num2str(ylimit(2)))35 if isfield(hh,'num_MinX') 36 set(hh.num_MinX,'String',num2str(xlimit(1))) 37 set(hh.num_MaxX,'String',num2str(xlimit(2))) 38 set(hh.num_MinY,'String',num2str(ylimit(1))) 39 set(hh.num_MaxY,'String',num2str(ylimit(2))) 40 40 end 41 41 end -
trunk/src/mouse_down.m
r332 r342 353 353 set(hhuvmat.transform_fct,'Value',1) 354 354 uvmat('transform_fct_Callback',hObject,eventdata,hhuvmat); %file input with xml reading in uvmat 355 set(hhuvmat. FixedLimits,'Value',0)% put FixedLimits option to 'off'356 set(hhuvmat. FixedLimits,'BackgroundColor',[0.7 0.7 0.7])355 set(hhuvmat.CheckFixedLimits,'Value',0)% put FixedLimits option to 'off' 356 set(hhuvmat.CheckFixedLimits,'BackgroundColor',[0.7 0.7 0.7]) 357 357 return 358 358 end -
trunk/src/series.m
r341 r342 490 490 CData=zeros([size(XIma) 3]); 491 491 file_ima=double((i1_series(:,:,1)>0)'); 492 if numel(file_ima)>=2 492 493 if size(file_ima,1)==1 493 494 CLine=interp1(ind_i,file_ima,xima,'nearest'); … … 499 500 end 500 501 set(handles.waitbar_frame,'CData',CData) 502 end 501 503 set(handles.waitbar_frame,'Units','normalized') 504 502 505 % CData(:,1:floor(advance_ratio*size(CData,2)),1:2)=1; 503 506 % set(hwaitbar,'CData',CData) … … 1673 1676 function num_first_i_Callback(hObject, eventdata, handles) 1674 1677 %------------------------------------------------------------------------ 1675 last_i_Callback(hObject, eventdata, handles)1678 num_last_i_Callback(hObject, eventdata, handles) 1676 1679 1677 1680 %------------------------------------------------------------------------ … … 1687 1690 function num_first_j_Callback(hObject, eventdata, handles) 1688 1691 %------------------------------------------------------------------------ 1689 last_j_Callback(hObject, eventdata, handles)1692 num_last_j_Callback(hObject, eventdata, handles) 1690 1693 1691 1694 %------------------------------------------------------------------------ -
trunk/src/set_grid.m
r315 r342 264 264 textout=char(textgrid); 265 265 imageA=get(handles.image_1,'String'); 266 [Pathsub]=name2display(imageA); 267 Answer = msgbox_uvmat('INPUT_TXT','grid file name (*.grid)',fullfile(Pathsub,'gridA.grid')); 266 RootPath=fileparts_uvmat(imageA); 267 %[Pathsub]=name2display(imageA); 268 Answer = msgbox_uvmat('INPUT_TXT','grid file name (*.grid)',fullfile(RootPath,'gridA.grid')); 268 269 % Answer = inputdlg('grid file name (*.grid)',' ',1,{fullfile(Pathsub,'gridA.grid')},'on'); 269 270 dlmwrite(Answer,textout,''); … … 281 282 textgrid={tete;txt}; 282 283 textout=char(textgrid); 283 Answer = msgbox_uvmat('INPUT_TXT','grid file name (*.grid)',fullfile( Pathsub,'gridB.grid'));284 Answer = msgbox_uvmat('INPUT_TXT','grid file name (*.grid)',fullfile(RootPath,'gridB.grid')); 284 285 dlmwrite(Answer,textout,''); 285 286 msgbox_uvmat('CONFIRMATION',[Answer ' written as ASCII text file']); … … 287 288 288 289 %------------------------- 289 function [grid_pix_A,grid_pix_B]=get_grid(handles) ;290 function [grid_pix_A,grid_pix_B]=get_grid(handles) 290 291 %Object=read_set_object(handles);%read the set_grid interface; 291 292 grid_pix_B=[];%default … … 296 297 YMin=str2num(get(handles.YMin,'String')); 297 298 YMax=str2num(get(handles.YMax,'String')); 298 array_realx= [XMin:DX:XMax];299 array_realy= [YMin:DY:YMax];299 array_realx=XMin:DX:XMax; 300 array_realy=YMin:DY:YMax; 300 301 nx_patch=length(array_realx); 301 302 ny_patch=length(array_realy); … … 325 326 return 326 327 end 327 [Pathsub,RootFile,field_count,str2,str_a,str_b,ext,nom_type,subdir]=name2display(imageA); 328 form=imformats(ext(2:end)); 328 %[Pathsub,RootFile,field_count,str2,str_a,str_b,FileExt,NomType,SubDir]=name2display(imageA); 329 [RootPath,~,RootFile,~,~,~,~,FileExt]=fileparts_uvmat(imageA); 330 form=imformats(FileExt(2:end)); 329 331 if isempty(form)% if the extension corresponds to an image format recognized by Matlab 330 332 msgbox_uvmat('ERROR',['error: ' imageA ' is not an image name recognized by Matlab ']) 331 333 return 332 334 end 333 fileAxml=[fullfile( Pathsub,RootFile) '.xml'];335 fileAxml=[fullfile(RootPath,RootFile) '.xml']; 334 336 [XmlDataA,error]=imadoc2struct(fileAxml); 335 337 if isfield(XmlDataA,'GeometryCalib') … … 360 362 return 361 363 end 362 [Pathsub,RootFile,field_count,str2,str_a,str_b,ext,nom_type,subdir]=name2display(imageB); 363 form=imformats(ext([2:end])); 364 %[RootPath,RootFile,field_count,str2,str_a,str_b,FileExt,NomType,SubDir]=name2display(imageB); 365 [RootPath,~,RootFile,~,~,~,~,FileExt]=fileparts_uvmat(imageB); 366 form=imformats(FileExt(2:end)); 364 367 if isempty(form)% if the extension corresponds to an image format recognized by Matlab 365 366 367 end 368 fileBxml=[fullfile( Pathsub,RootFile) '.xml'];369 [XmlDataB,error]=imadoc2struct(fileBxml); 368 msgbox_uvmat('ERROR',['error: ' imageB ' is not an image name recognized by Matlab ']) 369 return 370 end 371 fileBxml=[fullfile(RootPath,RootFile) '.xml']; 372 [XmlDataB,error]=imadoc2struct(fileBxml); 370 373 if isfield(XmlDataB,'GeometryCalib') 371 tsaiB=XmlDataB.GeometryCalib;374 tsaiB=XmlDataB.GeometryCalib; 372 375 else 373 msgbox_uvmat('WARNING','no geometric calibration available for image B')374 tsaiB=[];375 end376 %[error,Heading, nom_type_read,ext_ima_read,time,TimeUnit,mode,NbSlice,...376 msgbox_uvmat('WARNING','no geometric calibration available for image B') 377 tsaiB=[]; 378 end 379 %[error,Heading,NomType_read,ext_ima_read,time,TimeUnit,mode,NbSlice,... 377 380 % npxB,npyB,tsaiB]=read_imadoc(fileBxml,0); 378 381 [grid_imaB(:,1),grid_imaB(:,2)]=px_XYZ(tsaiB,grid_real(:,1),grid_real(:,2),0); 379 % if isempty(npxB)|isempty(npyB)380 381 382 383 384 % end385 flagB=grid_imaB(:,1)>0 & grid_imaB(:,1)<npxB & grid_imaB(:,2)>0 & grid_imaB(:,2)<npyB; 382 % if isempty(npxB)|isempty(npyB) 383 B=imread(imageB); 384 siz=size(B); 385 npxB=siz(2); 386 npyB=siz(1); 387 % end 388 flagB=grid_imaB(:,1)>0 & grid_imaB(:,1)<npxB & grid_imaB(:,2)>0 & grid_imaB(:,2)<npyB; 386 389 end 387 390 if testB -
trunk/src/set_object.m
r341 r342 672 672 hhuvmat=guidata(huvmat);%handles in the uvmat GUI 673 673 ListObject=get(hhuvmat.ListObject,'String');%position in the objet list 674 IndexObj=get(hhuvmat.ListObject,'Value') 674 IndexObj=get(hhuvmat.ListObject,'Value'); 675 675 676 676 %% read the object on the GUI set_object 677 ObjectData=read_set_object(handles);%read the input parameters defining the object in the GUI set_object 677 678 ObjectName=get(handles.TITLE,'String');%name of the current object defiend in set_object 678 ObjectData=read_set_object(handles);%read the input parameters defining the object in the GUI set_object679 679 if isempty(ObjectName) 680 680 if get(hhuvmat.edit_object,'Value')% edit mode 681 681 ObjectName=ListObject{IndexObj(end)};%take the name of the last (second) selected item 682 else %new object 683 StyleList=get(handles.ObjectStyle,'String'); 684 StyleVal=get(handles.ObjectStyle,'Value'); 685 ObjectName=StyleList{StyleVal}; 686 %ObjectName=[num2str(numel(ListObject)+1) '-' StyleList{StyleVal}];% take the object style as default name 682 687 end 683 688 end … … 700 705 end 701 706 ObjectName=ObjectNameNew; 702 ObjectName=[num2str(IndexObj(end)) '-' ObjectData.Style];%default name 707 % ObjectName=[num2str(IndexObj(end)) '-' ObjectData.Style];%default name 708 set(handles.TITLE,'String',ObjectName)% display the default name in set_object 709 IndexObj(2)=numel(ListObject)+1;% append an object to the list in uvmat 710 set(hhuvmat.ListObject,'String',[ListObject;{ObjectName}]);%complement the object list 711 set(hhuvmat.ListObject,'Value',IndexObj) 712 UvData.Object{IndexObj(2)}=[];%initiate a new object (empty yet) 703 713 end 704 714 % IndexObj_1=IndexObj(1); -
trunk/src/uvmat.m
r341 r342 1986 1986 1987 1987 %% determine the input file type 1988 if (test_1 && isfield(UvData,'MovieObject_1'))||(~test_1 && isfield(UvData,'MovieObject'))1988 if (test_1 && isfield(UvData,'MovieObject_1'))||(~test_1 && ~isempty(UvData.MovieObject)) 1989 1989 FileType='movie'; 1990 1990 elseif isequal(lower(Ext),'.avi') … … 4249 4249 list_str=get(handles.ListObject,'String'); 4250 4250 IndexObj_old=get(handles.ListObject,'UserData');%retrieve previous selection 4251 IndexObj=get(handles.ListObject,'Value'); 4251 IndexObj=get(handles.ListObject,'Value');%present object selection 4252 4253 %% we select two objects or more at once (using the Ctrl key), keep only the last two items: the first is projected on uvmat, the second on view_field 4252 4254 if length(IndexObj)>2 4253 4255 IndexObj=[IndexObj(end-1) IndexObj(end)];%keeps only the last two selected items at most 4254 4256 end 4255 if length(IndexObj)==1 4256 if length(IndexObj_old)>=2 && isequal(IndexObj_old(1),IndexObj) 4257 IndexObj=IndexObj_old(2); 4258 elseif length(IndexObj_old)>=2 && isequal(IndexObj_old(2),IndexObj) 4259 IndexObj=IndexObj_old(1); 4260 else 4261 IndexObj=[IndexObj_old(1) IndexObj]; 4262 end 4263 end 4264 set(handles.ListObject,'Value',IndexObj); %keeps only the two first selected objects 4265 set(handles.ListObject,'UserData',IndexObj) 4266 %desactivate the edit object mode 4267 set(handles.edit_object,'Value',0) 4257 4258 %% we select one object 4259 if length(IndexObj)==1% 4260 if length(IndexObj_old)>=2 && isequal(IndexObj_old(1),IndexObj) % we select the first previously selected object-> 4261 IndexObj=[1 IndexObj_old(2)];% it desactivates this object and selects the first object for uvmat 4262 elseif length(IndexObj_old)>=2 && isequal(IndexObj_old(2),IndexObj) % we select the second previously selected object-> 4263 IndexObj=IndexObj_old(1);% it desactivates this object and keeps only the first previously selected object (uvmat) 4264 else % 4265 IndexObj=[IndexObj_old(1) IndexObj];% activates a second object while keeping the first previously selected one 4266 end 4267 end 4268 set(handles.ListObject,'Value',IndexObj); % marks the selected objects in the list 4269 set(handles.ListObject,'UserData',IndexObj)% keep the current object selection in memory for next time 4270 4271 %% update the object representation 4272 set(handles.edit_object,'Value',0) % desactivate the edit object mode 4268 4273 edit_object_Callback(hObject, eventdata, handles) 4269 4274 UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface … … 4272 4277 return 4273 4278 end 4274 UvData.Object=update_obj(UvData,IndexObj(1),IndexObj(2)); 4275 set(handles.uvmat,'UserData',UvData) 4276 4277 %project on the selected object and update the corresponding plot 4279 if numel(IndexObj)>=2 4280 UvData.Object=update_obj(UvData,IndexObj(1),IndexObj(2));%update the current object graphic representation 4281 set(handles.uvmat,'UserData',UvData) 4282 end 4283 4284 %% project on the selected object and update the corresponding plot 4285 % hview_field=findobj(allchild(0),'tag','view_field'); 4286 % ViewObjectAxes=[];%default 4287 if ~isequal(IndexObj(1),IndexObj_old(1)) 4288 update_object(handles,IndexObj(1),handles.axes3,list_str{IndexObj(1)})%plot the projection in uvmat 4289 end 4278 4290 hview_field=findobj(allchild(0),'tag','view_field'); 4279 ViewObjectAxes=[];%default4280 if ~isequal(IndexObj(1),IndexObj_old(1))4281 update_object(handles,IndexObj(1),handles.axes3,list_str{IndexObj(1)})%plot the projection in uvmat4282 end4283 4291 if length(IndexObj)==2 && (length(IndexObj_old)==1 || ~isequal(IndexObj(2),IndexObj_old(2))) 4284 hview_field=findobj(allchild(0),'tag','view_field');4285 4292 if isempty(hview_field) 4286 4293 hview_field=view_field; … … 4288 4295 PlotHandles=guidata(hview_field); 4289 4296 update_object(handles,IndexObj(2),PlotHandles.axes3,list_str{IndexObj(2)})%plot the projection in view_field 4290 end 4291 update_object_color(handles.axes3,PlotHandles.axes3,UvData.Object{IndexObj(2)}.DisplayHandle_uvmat) 4297 update_object_color(handles.axes3,PlotHandles.axes3,UvData.Object{IndexObj(2)}.DisplayHandle_uvmat) 4298 else 4299 if ~isempty(hview_field) 4300 delete(hview_field) 4301 end 4302 hset_object=findobj(allchild(0),'tag','set_object'); 4303 if ~isempty(hset_object) 4304 delete(hset_object) 4305 end 4306 update_object_color(handles.axes3,handles.axes3,[]) 4307 end 4308 4309 %% update the color of the gfraphic object representation: the selected object in magenta, others in blue 4310 % update_object_color(handles.axes3,PlotHandles.axes3,UvData.Object{IndexObj(2)}.DisplayHandle_uvmat) 4292 4311 4293 4312 %------------------------------------------------------------------------ … … 4308 4327 if ~isempty(hset_object) 4309 4328 delete(hset_object)% delete existing version of set_object 4329 end 4310 4330 hset_object=set_object(ObjectData,[],ZBounds); 4311 end4331 % end 4312 4332 edit_test=get(handles.edit_object,'Value'); 4313 4333 if edit_test … … 4347 4367 set(hother(iobj),'Selected','off') 4348 4368 end 4369 if ~isempty(DisplayHandle) 4349 4370 linetype=get(DisplayHandle,'Type'); 4350 4371 if isequal(linetype,'line') … … 4372 4393 if isfield(SubObjectData,'DeformPoint') & ishandle(SubObjectData.DeformPoint) 4373 4394 set(SubObjectData.DeformPoint,'Color','m') 4395 end 4374 4396 end 4375 4397
Note: See TracChangeset
for help on using the changeset viewer.