Changeset 710 for trunk/src/uvmat.m
- Timestamp:
- Feb 16, 2014, 5:35:45 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r709 r710 210 210 set(hObject,'DeleteFcn',{@closefcn})% 211 211 set(hObject,'ResizeFcn',{@ResizeFcn,handles})% 212 % set(handles.RootPath,'ButtonDownFcn',{'@mouse_down_control'})%set mouse click action function 212 213 213 214 %% initialisation … … 319 320 % --- Outputs from this function are returned to the command menuline. 320 321 function varargout = uvmat_OutputFcn(hObject, eventdata, handles) 322 %------------------------------------------------------------------------ 321 323 varargout{1} = handles.output;% the only output argument is the handle to the GUI figure 322 324 … … 325 327 function closefcn(gcbo,eventdata) 326 328 %------------------------------------------------------------------------ 329 % delete GUI 'view_field' if detected 327 330 hh=findobj(allchild(0),'tag','view_field'); 328 331 if ~isempty(hh) 329 332 delete(hh) 330 333 end 334 % delete GUI 'geometry_calib' if detected 331 335 hh=findobj(allchild(0),'tag','geometry_calib'); 332 336 if ~isempty(hh) 333 337 delete(hh) 334 338 end 339 % desable set_object editing action if detected 335 340 hh=findobj(allchild(0),'tag','set_object'); 336 341 if ~isempty(hh) 337 342 hhh=findobj(hh,'tag','PLOT'); 338 343 set(hhh,'enable','off') 344 end 345 %delete the bowser if detected 346 hh=findobj(allchild(0),'tag','browser'); 347 if ~isempty(hh) 348 delete(hh) 339 349 end 340 350 … … 450 460 else 451 461 452 %% display the selected field and related information453 if ~isempty(fileinput)454 set(handles.SubField,'Value',0)455 desable_subfield(handles)456 display_file_name(handles,fileinput)457 end462 %% display the selected field and related information 463 if ~isempty(fileinput) 464 set(handles.SubField,'Value',0) 465 desable_subfield(handles) 466 display_file_name(handles,fileinput) 467 end 458 468 end 459 469 … … 564 574 565 575 %------------------------------------------------------------------------ 566 % --- Called by action in RootPath edit box567 function RootPath_Callback(hObject,eventdata,handles)568 %------------------------------------------------------------------------569 % read the current input file name:570 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles);571 if ~exist(fullfile(RootPath,SubDir),'dir')572 msgbox_uvmat('ERROR',['directory ' fullfile(RootPath,SubDir) ' does not exist'])573 return574 end575 % detect the file type, get the movie object if relevant, and look for the corresponding file series:576 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileType,FileInfo,MovieObject]=find_file_series(fullfile(RootPath,SubDir),[RootFile FileIndices FileExt]);577 % initiate the input file series and refresh the current field view:578 update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,MovieObject,1);579 580 %-----------------------------------------------------------------------581 % --- Called by action in RootPath_1 edit box582 function RootPath_1_Callback(hObject,eventdata,handles)583 % -----------------------------------------------------------------------584 % update_rootinfo_1(hObject,eventdata,handles)585 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes_1(handles);586 if ~exist(fullfile(RootPath,SubDir),'dir')587 msgbox_uvmat('ERROR',['directory ' fullfile(RootPath,SubDir) ' does not exist'])588 return589 end590 % detect the file type, get the movie object if relevant, and look for the corresponding file series:591 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileType,MovieObject]=find_file_series(fullfile(RootPath,SubDir),[RootFile FileIndices FileExt]);592 % initiate the input file series and refresh the current field view:593 update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,MovieObject,2);594 595 %------------------------------------------------------------------------596 % --- Called by action in RootFile edit box597 function SubDir_Callback(hObject, eventdata, handles)598 %------------------------------------------------------------------------599 %refresh the menu of input fieldname600 FieldName_Callback(hObject, eventdata, handles);601 % refresh the current field view602 run0_Callback(hObject, eventdata, handles);603 604 %------------------------------------------------------------------------605 % --- Called by action in RootFile edit box606 function RootFile_Callback(hObject, eventdata, handles)607 %------------------------------------------------------------------------608 RootPath_Callback(hObject,eventdata,handles)609 610 %-----------------------------------------------------------------------611 % --- Called by action in RootFile_1 edit box612 function RootFile_1_Callback(hObject, eventdata, handles)613 % -----------------------------------------------------------------------614 RootPath_1_Callback(hObject,eventdata,handles)615 616 %------------------------------------------------------------------------617 576 % --- Called by action in FileIndex edit box 618 577 function FileIndex_Callback(hObject, eventdata, handles) … … 624 583 set(handles.j2,'String',num2str(j2)); 625 584 626 % refresh the current field view627 run0_Callback(hObject, eventdata, handles)628 629 %------------------------------------------------------------------------630 % --- Called by action in FileIndex_1 edit box631 function FileIndex_1_Callback(hObject, eventdata, handles)632 %------------------------------------------------------------------------633 run0_Callback(hObject, eventdata, handles)634 585 635 586 %------------------------------------------------------------------------ … … 658 609 % refresh the current settings and refresh the field view 659 610 RootPath_1_Callback(hObject,eventdata,handles) 611 612 %------------------------------------------------------------------------ 613 % --- Executes on button press in REFRESH. 614 function REFRESH_Callback(hObject, eventdata, handles) 615 %------------------------------------------------------------------------ 616 set(handles.REFRESH,'BackgroundColor',[1 1 0])% set button color to yellow to indicate that refresh is under action 617 % read the current input file name: 618 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles); 619 % if ~exist(fullfile(RootPath,SubDir),'dir') 620 % msgbox_uvmat('ERROR',['directory ' fullfile(RootPath,SubDir) ' does not exist']) 621 % return 622 % end 623 % detect the file type, get the movie object if relevant, and look for the corresponding file series: 624 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileType,FileInfo,MovieObject]=find_file_series(fullfile(RootPath,SubDir),[RootFile FileIndices FileExt]); 625 % initiate the input file series and refresh the current field view: 626 errormsg=update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,MovieObject,1); 627 % refresh the second series if selected 628 if get(handles.SubField,'Value') 629 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes_1(handles); 630 if ~exist(fullfile(RootPath,SubDir),'dir') 631 msgbox_uvmat('ERROR',['directory ' fullfile(RootPath,SubDir) ' does not exist']) 632 return 633 end 634 % detect the file type, get the movie object if relevant, and look for the corresponding file series: 635 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileType,MovieObject]=find_file_series(fullfile(RootPath,SubDir),[RootFile FileIndices FileExt]); 636 % initiate the input file series and refresh the current field view: 637 errormsg=update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,MovieObject,2); 638 end 639 640 if isempty(errormsg) 641 set(handles.REFRESH,'BackgroundColor',[1 0 0])% set button color to red to indicate that refresh has been updated 642 else 643 set(handles.REFRESH,'BackgroundColor',[1 0 1])% keep button color magenta, input not succesfull 644 end 660 645 661 646 %------------------------------------------------------------------------ … … 696 681 set(handles.TimeValue_1,'Visible','on') 697 682 end 698 set(handles _RootPath,'BackgroundColor',[1 1 0])% paint edit boxto yellow to visualise root file input683 set(handles.REFRESH,'BackgroundColor',[1 1 0])% paint REFRESH button to yellow to visualise root file input 699 684 set(handles.uvmat,'Pointer','watch') % set the mouse pointer to 'watch' 700 685 drawnow … … 840 825 end 841 826 842 set(handles _RootPath,'BackgroundColor',[1 1 1])% paint back edit box to white to visualise end of root file input827 set(handles.REFRESH,'BackgroundColor',[1 0 0])% paint back button to red to indicate update is finished 843 828 set(handles.uvmat,'Pointer','arrow')% set back the mouse pointer to arrow 844 829 … … 847 832 % --- Update information about a new field series (indices to scan, timing, 848 833 % calibration from an xml file, then refresh current plots 849 850 function update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,VideoObject,index) 851 %------------------------------------------------------------------------ 834 function errormsg=update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,VideoObject,index) 835 %------------------------------------------------------------------------ 836 errormsg=''; %default error msg 852 837 %% define the relevant handles depending on the index (1=first file series, 2= second file series) 853 838 if ~exist('index','var') … … 878 863 FileBase=fullfile(RootPath,RootFile); 879 864 if ~exist(FileName,'file') 880 msgbox_uvmat('ERROR',['input file ' FileName ' not found']); 865 errormsg=['input file ' FileName ' not found']; 866 msgbox_uvmat('ERROR',errormsg); 881 867 return 882 868 end … … 930 916 NbSlice=1;%default 931 917 ImaDoc_str=''; 932 set(handles.R ootPath,'BackgroundColor',[1 1 1])918 set(handles.REFRESH,'BackgroundColor',[1 1 0]) 933 919 if ~isempty(XmlFileName) 934 920 set(handles.view_xml,'Visible','on') … … 1370 1356 end 1371 1357 Mask.Path=MaskPath; 1372 Mask.File=MaskFile{1}; 1358 if isempty(MaskFile) 1359 Mask.File=''; 1360 else 1361 Mask.File=MaskFile{1}; 1362 end 1373 1363 Mask.Ext=MaskExt; 1374 1364 Mask.NomType=MaskNomType; … … 1980 1970 set(handles.j2,'BackgroundColor',[1 1 1])% mark the edit box in white to indicate its use as input 1981 1971 set(handles.FileIndex,'BackgroundColor',[1 1 1])% mark the edit box in white to indicate its use as input 1982 while get(handles.speed,'Value')~=0 && isequal(get(handles.movie_pair,'BusyAction'),'queue') %isequal(get(handles.run0,'BusyAction'),'queue');% enable STOP command1972 while get(handles.speed,'Value')~=0 && isequal(get(handles.movie_pair,'BusyAction'),'queue') % enable STOP command 1983 1973 % read and plot the series of images in non erase mode 1984 1974 set(hima,'CData',Field_b.A); … … 4841 4831 [RootPath,SubDir,RootFile,FileIndex,FileExt]=read_file_boxes(handles); 4842 4832 FileName=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt]; 4843 set(handles.view_xml,'Backgroundcolor',[1 1 0])%indicate the reading of the current xml file by geometry_calib 4844 % pos_uvmat=get(handles.uvmat,'Position'); 4845 % pos_cal(1)=pos_uvmat(1)+UvData.OpenParam.PosGeometryCalib(1)*pos_uvmat(3); 4846 % pos_cal(2)=pos_uvmat(2)+UvData.OpenParam.PosGeometryCalib(2)*pos_uvmat(4); 4847 % pos_cal(3:4)=UvData.OpenParam.PosGeometryCalib(3:4).* pos_uvmat(3:4); 4833 set(handles.view_xml,'BackgroundColor',[1 1 0])%indicate the reading of the current xml file by geometry_calib 4848 4834 geometry_calib(FileName);% call the geometry_calib interface 4849 set(handles.view_xml,'Background color',[1 1 1])%indicate the end of reading of the current xml file by geometry_calib4835 set(handles.view_xml,'BackgroundColor',[1 1 1])%indicate the end of reading of the current xml file by geometry_calib 4850 4836 set(handles.MenuCalib,'checked','on')% indicate that MenuCalib is activated, test used by mouse action 4851 4837 … … 4879 4865 ObjectData=UvData.ProjObject(val); 4880 4866 for iobj=1:length(ObjectData) 4881 % if isfield(ObjectData{iobj},'Coord')4882 4867 xA(iobj)=ObjectData{iobj}.Coord(1,1); 4883 4868 yA(iobj)=ObjectData{iobj}.Coord(1,2); 4884 4869 xB(iobj)=ObjectData{iobj}.Coord(2,1); 4885 4870 yB(iobj)=ObjectData{iobj}.Coord(2,2); 4886 % end4887 4871 end 4888 4872 end … … 5065 5049 end 5066 5050 end 5067 % end5068 5051 %mask name 5069 5052 RootPath=get(handles.RootPath,'String'); … … 5076 5059 masknumber=num2str(length(list)); 5077 5060 maskindex=get(handles.masklevel,'Value'); 5078 % mask_name=fullfile_uvmat(RootPath,'',[RootFile '_' masknumber 'mask'],'.png','_1',maskindex);5079 5061 mask_name=fullfile_uvmat(RootPath,[SubDir '.mask'],'mask','.png','_1',maskindex); 5080 5062 imflag=uint8(255*(0.392+0.608*flag));% =100 for flag=0 (vectors not computed when 20<imflag<200) … … 5110 5092 set(handles.edit_vect,'Value',0) 5111 5093 edit_vect_Callback(hObject, eventdata, handles) 5112 % set(handles.CheckEditObject,'BackgroundColor',[0.7 0.7 0.7])5113 5094 set(handles.ListObject,'Value',1) 5114 5095
Note: See TracChangeset
for help on using the changeset viewer.