Legend:
- Unmodified
- Added
- Removed
-
trunk/src/editxml.m
r977 r998 111 111 DataIn=get(heditxml,'UserData'); 112 112 if ~isempty(xs) 113 114 115 116 117 113 xs_node=list.xs_uid(ind);%xs_node of the subelement #ind 114 [nodeup,path,xs_element,xs_subelem]=scan_schema(xs,xs_node); 115 [element,subelem]=get_xml(t,path,xs_element,NewRootUid,xs_subelem); 116 update_list(handles,path,xs_element,element,NewRootUid,xs_subelem,subelem); 117 if xs_element.subtest 118 118 DataIn.CurrentUid=[DataIn.CurrentUid NewRootUid];%record new current uid 119 119 DataIn.xs_CurrentUid=[DataIn.xs_CurrentUid xs_node];%record the new curent schema uid 120 120 end 121 121 122 122 % %update the import file display … … 174 174 else 175 175 [xs_nodeup,path,xs_element,xs_subelem]=scan_schema(xs,xs_nodeup); 176 177 176 [element,subelem]=get_xml(t,path,xs_element,nodeup,xs_subelem); 177 update_list(handles,path,xs_element,element,nodeup,xs_subelem,subelem); 178 178 %update the import file display 179 179 if isfield(DataIn,'h_ref')&ishandle(DataIn.h_ref) … … 369 369 else 370 370 DataIn.xs_CurrentUid=find(xs,'/xs:schema/xs:element');%uid of the root element in the schema 371 372 373 371 [nodeup,path,xs_element,xs_subelem]=scan_schema(xs,DataIn.xs_CurrentUid);%scan the schema at the root level 372 [element,subelem]=get_xml(t,path,xs_element,1,xs_subelem);% read the corresponding xml data 373 update_list(handles,path,xs_element,element,1,xs_subelem,subelem);%update the display of information on the interface 374 374 end 375 375 set(heditxml,'UserData',DataIn);%store the new input xml file name … … 655 655 up=1; 656 656 if node>0 657 658 657 nodeup=node; 658 while up==1; 659 659 nodeup=get(t,nodeup,'parent');%move up to the parent in the tree 660 660 if isempty(nodeup) … … 671 671 end 672 672 end 673 674 673 end 674 element.attrup=attrup; 675 675 end 676 676 %find the subelement properties in the xml file … … 1043 1043 list_element=[]; 1044 1044 % Data.CurrentUid=[Data.CurrentUid root_uid]%record new current uid 1045 1045 for iline=1:length(list_uid) 1046 1046 element=get(t,list_uid(iline)); 1047 1047 if isfield(element,'type')&isequal(element.type,'element') … … 1071 1071 end 1072 1072 end 1073 1073 end 1074 1074 set(handles.list_element,'Value',1)%select the first line of list_element by default 1075 1075 set(handles.list_element,'String',cell2tab(list_element,' ') ) 1076 1076 list.uid=list_uid; 1077 1077 set(handles.list_element,'UserData',list) 1078 1078 end 1079 1079 %--------------------------------------------------------- … … 1415 1415 % up=1 1416 1416 % if node>0 1417 % 1418 % 1417 % nodeup=node; 1418 % while up==1; 1419 1419 % nodeup=get(t,nodeup,'parent');%move up to the parent in the tree 1420 1420 % if isempty(nodeup) … … 1431 1431 % end 1432 1432 % end 1433 % 1434 % 1433 % end 1434 % element.attrup=attrup; 1435 1435 % end 1436 1436 % %find the subelement properties in the xml file -
trunk/src/series.m
r997 r998 3023 3023 if get(handles.EditObject,'Value') 3024 3024 set(handles.ViewObject,'Value',0) 3025 3025 UserData=get(handles.series,'UserData'); 3026 3026 hset_object=set_object(UserData.ProjObject); 3027 3027 set(hset_object,'Name','edit_object_series') -
trunk/src/uvmat.m
r984 r998 1 %'uvmat': function associated with the GUI 'uvmat.fig' for images and data field visualization 1 %'uvmat': function associated with the GUI 'uvmat.fig' for images and data field visualization 2 2 %------------------------------------------------------------------------ 3 3 % function huvmat=uvmat(input) … … 52 52 % 53 53 % 1) Input filenames are determined by MenuBrowse (first field), MenuBrowseCampaign 54 % (second field), or by the stored file name .FileName_1, or as an input of uvmat. 54 % (second field), or by the stored file name .FileName_1, or as an input of uvmat. 55 55 % 2) These functions call 'uvmat/display_file_name.m' which detects the file series, and fills the file index boxes 56 56 % 3) Then 'uvmat/update_rootinfo.m' Updates information about a new field series (indices to scan, timing, calibration from an xml file) … … 61 61 % %%%%%%%% structure of uvmat/refresh_field.m %%%%%%%% 62 62 % 63 % Main input open second input open_1 64 % | | 63 % Main input open second input open_1 64 % | | 65 65 % read_field.m read_field.m 66 66 % | | 67 % Field{1} Field{2} 68 % | | 69 % --->transform fct<--- transform (e.g. phys.m) and combine input fieldname 70 % | 67 % Field{1} Field{2} 68 % | | 69 % --->transform fct<--- transform (e.g. phys.m) and combine input fieldname 70 % | 71 71 % (tps_coeff_field.m) calculate tps coefficients (for filter projection or spatial derivatives). 72 72 % | 73 73 % UvData.Field-------------->Histogram 74 74 % _____________|____________ 75 % | | 76 % proj_field.m proj_field.m project the field on the projection objects (use set_field_list.m) 75 % | | 76 % proj_field.m proj_field.m project the field on the projection objects (use set_field_list.m) 77 77 % | | 78 78 % UvData.PlotAxes ViewData.PlotAxes (on view_field) … … 92 92 % If the scalar exists in an input open (image or scalar stored under its 93 93 % name in a netcdf open), it is directly read at the level of Field{1}or Field{2}. 94 % Else only its name AName is recorded in Field{i}, and its field is then calculated 94 % Else only its name AName is recorded in Field{i}, and its field is then calculated 95 95 %by the fuction calc_scal after the coordinate transform or after projection on an CheckEditObject 96 96 97 97 % Properties attached to plotting figures (standard Matlab properties): 98 98 % 'CurrentAxes'= gca or get(gcf,'CurrentAxes'); … … 100 100 % 'CurrentCharacter'=get(gcf,'CurrentCharacter'): last character typed over the figure where the mouse is positioned 101 101 % 'WindowButtonMotionFcn': function permanently called by mouse motion over the figure 102 % 'KeyPressFcn': function called by pressing a key on the key board 102 % 'KeyPressFcn': function called by pressing a key on the key board 103 103 % 'WindowButtonDownFcn': function called by pressing the mouse over the figure 104 104 % 'WindowButtonUpFcn': function called by releasing the mouse pressure over the figure … … 107 107 % 'CurrentPoint'=get(gca,'CurrentPoint'); (standard Matlab) same as for the figure, but position in plot axes. 108 108 % AxeData:=get(gca,'UserData'); 109 % AxeData.Drawing = create: create a new object 109 % AxeData.Drawing = create: create a new object 110 110 % = deform: modify an existing object by moving its defining create 111 111 % = off: no current drawing action … … 200 200 set(hObject,'WindowButtonMotionFcn',{'mouse_motion',handles})%set mouse action functio 201 201 set(hObject,'WindowButtonDownFcn',{'mouse_down'})%set mouse click action function 202 set(hObject,'WindowButtonUpFcn',{'mouse_up',handles}) 202 set(hObject,'WindowButtonUpFcn',{'mouse_up',handles}) 203 203 set(hObject,'DeleteFcn',{@closefcn})% 204 204 set(hObject,'ResizeFcn',{@ResizeFcn,handles})% … … 260 260 if ishandle(handles.UVMAT_title) 261 261 delete(handles.UVMAT_title) 262 end 262 end 263 263 if isstruct(input) 264 264 if isfield(input,'InputFile') … … 289 289 %% check the path and date of modification of all functions in uvmat 290 290 path_to_uvmat=which ('uvmat');% check the path detected for source file uvmat 291 [infomsg,date_str,svn_info]=check_files;%check the path of the functions called by uvmat.m 291 [infomsg,date_str,svn_info]=check_files;%check the path of the functions called by uvmat.m 292 292 date_str=['last modification: ' date_str]; 293 293 if ishandle(handles.UVMAT_title) … … 312 312 % --- Outputs from this function are returned to the command menuline. 313 313 function varargout = uvmat_OutputFcn(hObject, eventdata, handles) 314 %------------------------------------------------------------------------ 314 %------------------------------------------------------------------------ 315 315 varargout{1} = handles.output;% the only output argument is the handle to the GUI figure 316 316 … … 344 344 %--- activated when resizing the GUI view_field 345 345 function ResizeFcn(gcbo,eventdata,handles) 346 %------------------------------------------------------------------------ 346 %------------------------------------------------------------------------ 347 347 set(handles.uvmat,'Units','pixels') 348 348 size_fig=get(handles.uvmat,'Position'); … … 581 581 % -------------------------------------------------------------------- 582 582 function MenuExportAxis_Callback(hObject, eventdata, handles) 583 % -------------------------------------------------------------------- 583 % -------------------------------------------------------------------- 584 584 ListFig=findobj(allchild(0),'Type','figure'); 585 585 nb_option=0; … … 644 644 FileBase=fullfile(RootPath,RootFile); 645 645 646 %% create a fig and axis for movies 646 %% create a fig and axis for movies 647 647 figure_movie=findobj(allchild(0),'name','figure_movie'); 648 648 … … 659 659 time_str=get(handles.TimeValue,'String'); 660 660 if ~isempty(time_str) 661 htitle=get(newaxes,'Title'); 661 htitle=get(newaxes,'Title'); 662 662 set(htitle,'String',['t=' time_str]) 663 663 end … … 674 674 Position(4)=Position(4)/2; 675 675 hfig=findobj(allchild(0),'Tag','set_movie'); 676 if ~isempty(hfig),delete(hfig), end; %delete existing version of the GUI 676 if ~isempty(hfig),delete(hfig), end; %delete existing version of the GUI 677 677 hfig=figure('name','set_movie','tag','set_movie','MenuBar','none','NumberTitle','off','Units','pixels',... 678 678 'Position',Position); … … 714 714 hMovieSize=findobj(hset_movie,'Tag','MovieSize'); 715 715 nbpix=[640 480; 720 480; 1280 720]; 716 SizeOption=get(hMovieSize,'Value'); 717 nbpix=nbpix(SizeOption,:); 718 719 %% look for movie fig 716 SizeOption=get(hMovieSize,'Value'); 717 nbpix=nbpix(SizeOption,:); 718 719 %% look for movie fig 720 720 figure_movie=findobj(allchild(0),'name','figure_movie'); 721 721 if isempty(figure_movie) … … 726 726 newaxes=copyobj(hhuvmat.PlotAxes,figure_movie);%new plotting axes in the new figure 727 727 set(newaxes,'Tag','movieaxes') 728 728 729 729 %% display time if defined in uvmat 730 730 time_str=get(hhuvmat.TimeValue,'String'); … … 745 745 % function called by pressing APPLY in the GUI set_movie 746 746 function set_movie_START_Callback(hObject,eventdata) 747 %------------------------------------------------------------------------ 747 %------------------------------------------------------------------------ 748 748 %% read info from the GUI set_movie 749 749 hset_movie=get(hObject,'parent'); … … 773 773 while testexist==2 774 774 backup=[backup '~']; 775 testexist=exist(backup,'file'); 775 testexist=exist(backup,'file'); 776 776 end 777 777 [success,message]=copyfile(MovieName,backup);%make backup of the existing file 778 778 if isequal(success,1) 779 delete(MovieName)%delete existing file 779 delete(MovieName)%delete existing file 780 780 else 781 781 msgbox_uvmat('ERROR',message) 782 782 return 783 end 783 end 784 784 end 785 785 %create avi open … … 801 801 for i=1:FrameNumber 802 802 if get(hhuvmat.speed,'Value')~=0 && isequal(get(hhuvmat.MenuExportMovie,'BusyAction'),'queue') % enable STOP command 803 runpm(hObject,eventdata,hhuvmat,increment)% run plus 803 runpm(hObject,eventdata,hhuvmat,increment)% run plus 804 804 drawnow 805 805 time_str=get(hhuvmat.TimeValue,'String'); … … 818 818 % function called by pressing APPLY in the GUI set_slices 819 819 function set_movie_Cancel_Callback(hObject,eventdata) 820 %------------------------------------------------------------------------ 820 %------------------------------------------------------------------------ 821 821 delete(hObject) 822 822 … … 937 937 %% desactivate concurrent tools 938 938 set(handles.MenuRuler,'checked','off')%desactivate ruler 939 hgeometry_calib=findobj(allchild(0),'tag','geometry_calib');% search the GUI geometric calibration 939 hgeometry_calib=findobj(allchild(0),'tag','geometry_calib');% search the GUI geometric calibration 940 940 if ishandle(hgeometry_calib) 941 941 hhgeometry_calib=guidata(hgeometry_calib); … … 1005 1005 end 1006 1006 1007 hset_object=set_object(data,handles);% call the GUI set_object 1007 hset_object=set_object(data,handles);% call the GUI set_object 1008 1008 hchild=get(hset_object,'children'); 1009 1009 set(hchild,'enable','on') … … 1011 1011 if check_plot 1012 1012 hhset_object=guidata(hset_object); 1013 set_object('REFRESH_Callback',1,[],hhset_object);% call the GUI set_object 1013 set_object('REFRESH_Callback',1,[],hhset_object);% call the GUI set_object 1014 1014 end 1015 1015 set(handles.CheckViewField,'Visible','on') … … 1058 1058 SubField_Callback(hObject, eventdata, handles) 1059 1059 end 1060 UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface 1060 UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface 1061 1061 1062 1062 %% suppress competing tools … … 1064 1064 set(handles.CheckZoom,'Value',0) 1065 1065 set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7]) 1066 set(handles.ListObject,'Value',1) 1066 set(handles.ListObject,'Value',1) 1067 1067 1068 1068 %% initiate display of the GUI geometry_calib … … 1074 1074 FileName=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt]; 1075 1075 set(handles.view_xml,'BackgroundColor',[1 1 0])%indicate the reading of the current xml file by geometry_calib 1076 geometry_calib(FileName);% call the geometry_calib interface 1076 geometry_calib(FileName);% call the geometry_calib interface 1077 1077 set(handles.view_xml,'BackgroundColor',[1 1 1])%indicate the end of reading of the current xml file by geometry_calib 1078 1078 set(handles.MenuCalib,'checked','on')% indicate that MenuCalib is activated, test used by mouse action … … 1089 1089 end 1090 1090 1091 UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface 1091 UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface 1092 1092 % check=0; 1093 1093 if isfield(UvData,'XmlData')&&isfield(UvData.XmlData{1},'GeometryCalib')&& isfield(UvData.XmlData{1}.GeometryCalib,'SliceCoord') … … 1096 1096 msgbox_uvmat('ERROR','3D geometric calibration needed before defining slices') 1097 1097 return 1098 end 1098 end 1099 1099 SliceCoord=GeometryCalib.SliceCoord; 1100 1100 InterfaceCoord=min(SliceCoord(:,3)); … … 1106 1106 if isfield(GeometryCalib,'CheckVolumeScan') 1107 1107 CheckVolumeScan=GeometryCalib.CheckVolumeScan; 1108 end 1108 end 1109 1109 RefractionIndex=1.33; 1110 CheckRefraction=0;% default value of the check box refraction 1110 CheckRefraction=0;% default value of the check box refraction 1111 1111 if isfield(GeometryCalib,'RefractionIndex') 1112 1112 RefractionIndex=GeometryCalib.RefractionIndex; 1113 1113 CheckRefraction=1; 1114 end 1114 end 1115 1115 SliceAngle=[0 0 0]; 1116 1116 if isfield(GeometryCalib,'SliceAngle') … … 1126 1126 Bottom=ScreenSize(4)-Height-40; %put fig at top right 1127 1127 hfig=findobj(allchild(0),'Tag','set_slice'); 1128 if ~isempty(hfig),delete(hfig), end; %delete existing version of the GUI 1128 if ~isempty(hfig),delete(hfig), end; %delete existing version of the GUI 1129 1129 hfig=figure('name','set_slices','tag','set_slice','MenuBar','none','NumberTitle','off','Units','pixels','Position',[Left,Bottom,Width,Height],'UserData',GeometryCalib); 1130 1130 BackgroundColor=get(hfig,'Color'); … … 1197 1197 % function called by selecting CheckRefraction in the GUI set_slices 1198 1198 function set_slice_CheckRefraction_Callback(hObject,eventdata) 1199 %------------------------------------------------------------------------ 1199 %------------------------------------------------------------------------ 1200 1200 hset_slice=get(hObject,'parent'); 1201 1201 h_refraction(1)=findobj(hset_slice,'String','surface'); … … 1212 1212 % function called by pressing APPLY in the GUI set_slices 1213 1213 function set_slice_APPLY_Callback(hObject,eventdata) 1214 %------------------------------------------------------------------------ 1214 %------------------------------------------------------------------------ 1215 1215 set(hObject,'BackgroundColor',[1 1 0]);% paint button in yellow to indicate action 1216 1216 drawnow … … 1254 1254 elseif isfield(GeometryCalib,'RefractionIndex') 1255 1255 GeometryCalib=rmfield(GeometryCalib,'RefractionIndex'); 1256 GeometryCalib=rmfield(GeometryCalib,'InterfaceCoord'); 1256 GeometryCalib=rmfield(GeometryCalib,'InterfaceCoord'); 1257 1257 end 1258 1258 … … 1275 1275 % function called by pressing REPLICATE in the GUI set_slices 1276 1276 function set_slice_REPLICATE_Callback(hObject,eventdata) 1277 %------------------------------------------------------------------------ 1277 %------------------------------------------------------------------------ 1278 1278 set(hObject,'BackgroundColor',[1 1 0]) 1279 1279 drawnow … … 1294 1294 SubDirBase=regexprep(OutPut.DataSeries{idevice},'\..+$',''); 1295 1295 XmlFile=fullfile(OutPut.Campaign,OutPut.Experiment{ilist},[SubDirBase '.xml']); 1296 1296 1297 1297 % read the current xml file 1298 1298 if exist(XmlFile,'file') … … 1320 1320 GeometryCalib=rmfield(GeometryCalib,'InterfaceCoord'); 1321 1321 end 1322 1322 1323 1323 % update the current xml file 1324 1324 errormsg=update_imadoc(GeometryCalib,XmlFile,'GeometryCalib');% introduce the calibration data in the xml file … … 1346 1346 function MenuLIFCalib_Callback(hObject, eventdata, handles) 1347 1347 %------------------------------------------------------------------------ 1348 %% read UvData properties stored on the uvmat interface 1348 %% read UvData properties stored on the uvmat interface 1349 1349 UvData=get(handles.uvmat,'UserData'); 1350 1350 if isfield(UvData,'XmlData')&& isfield(UvData.XmlData{1},'GeometryCalib') … … 1394 1394 1395 1395 %% display the current image in polar axes with origin at the illumination source 1396 currentdir=pwd; 1396 currentdir=pwd; 1397 1397 uvmatpath=fileparts(which('uvmat')); 1398 1398 cd(fullfile(uvmatpath,'transform_field')); … … 1464 1464 end 1465 1465 % save the illumination origin 1466 t=struct2xml(XmlData.Illumination,t,uid_illumination); 1466 t=struct2xml(XmlData.Illumination,t,uid_illumination); 1467 1467 save(t,XmlFileName); 1468 1468 end 1469 1469 1470 1470 1471 1471 … … 1473 1473 function MenuMask_Callback(hObject, eventdata, handles) 1474 1474 %------------------------------------------------------------------------ 1475 UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface 1475 UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface 1476 1476 ListObj=UvData.ProjObject; 1477 1477 select=zeros(1,numel(ListObj)); … … 1568 1568 imflag=uint8(255*(0.392+0.608*flag));% =100 for flag=0 (vectors not computed when 20<imflag<200) 1569 1569 imflag=flipdim(imflag,1); 1570 1570 1571 1571 %display the mask 1572 1572 hfigmask=figure; … … 1606 1606 set(handles.edit_vect,'Value',0) 1607 1607 edit_vect_Callback(hObject, eventdata, handles) 1608 set(handles.ListObject,'Value',1) 1608 set(handles.ListObject,'Value',1) 1609 1609 1610 1610 %prepare display of the set_grid GUI … … 1784 1784 set(handles.uvmat,'Pointer','arrow')% set back the mouse pointer to arrow 1785 1785 1786 %------------------------------------------------------------------------ 1786 %------------------------------------------------------------------------ 1787 1787 % --- Fills the edit boxes RootPath, RootFile,NomType...from an input file name 'fileinput' 1788 1788 function errormsg=display_file_name(handles,fileinput,index) … … 1899 1899 i2_s=i2_0; 1900 1900 else 1901 i2_s=i2; 1901 i2_s=i2; 1902 1902 end 1903 1903 j1_0=stra2num(get(handles.j1,'String')); … … 1914 1914 end 1915 1915 end 1916 1916 1917 1917 % synchronise indices of the second input file if it exists 1918 1918 if get(handles.SubField,'Value')==1% if the subfield button is activated, update the field numbers … … 1943 1943 set(handles.FileIndex_1,'String',FileIndex_1) 1944 1944 end 1945 1945 1946 1946 %enable other menus 1947 1947 set(handles.MenuOpenCampaign,'Enable','on') … … 1951 1951 set(handles.MenuTools,'Enable','on') 1952 1952 1953 % initiate input file series and inputfilerefresh the current field view: 1953 % initiate input file series and inputfilerefresh the current field view: 1954 1954 update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileInfo,MovieObject,index); 1955 1955 … … 2017 2017 end 2018 2018 2019 %% read timing and total frame number from the current file (e.g. movie files) 2019 %% read timing and total frame number from the current file (e.g. movie files) 2020 2020 TimeUnit='';%default 2021 2021 TimeName='';%default … … 2190 2190 set(handles.TransformName,'Value',3); % phys transform by default if fixedLimits is off 2191 2191 end 2192 if isfield(GeometryCalib,'SliceCoord') 2192 if isfield(GeometryCalib,'SliceCoord') 2193 2193 siz=size(GeometryCalib.SliceCoord); 2194 2194 if siz(1)>1 … … 2204 2204 end 2205 2205 slices_Callback([],[], handles) 2206 end 2206 end 2207 2207 end 2208 2208 end … … 2257 2257 set(handles.uvmat,'UserData',UvData) 2258 2258 2259 %% set index navigation options 2259 %% set index navigation options 2260 2260 scan_option='i';%default 2261 2261 state_j='off'; %default … … 2269 2269 end 2270 2270 [ref_j,ref_i]=find(squeeze(i1_series(1,:,:))); 2271 if ~isempty(j1_series) 2271 if ~isempty(j1_series) 2272 2272 state_j='on'; 2273 2273 if index==1 2274 2274 if isequal(ref_i,ref_i(1)*ones(size(ref_j)))% if ref_i is always equal to its first value 2275 scan_option='j'; %scan j indext 2276 end 2275 scan_option='j'; %scan j indext 2276 end 2277 2277 end 2278 2278 end … … 2286 2286 end 2287 2287 set(handles.scan_i,'Value',1) 2288 scan_i_Callback([],[], handles); 2288 scan_i_Callback([],[], handles); 2289 2289 else 2290 2290 diff_ref_j=diff(ref_j); … … 2296 2296 end 2297 2297 set(handles.scan_j,'Value',1) 2298 scan_j_Callback([],[], handles); 2298 scan_j_Callback([],[], handles); 2299 2299 end 2300 2300 set(handles.scan_j,'Visible',state_j) … … 2309 2309 end 2310 2310 2311 %% apply the effect of the transform fct and view the field 2311 %% apply the effect of the transform fct and view the field 2312 2312 transform=get(handles.TransformPath,'UserData'); 2313 2313 if index==2 && (~isa(transform,'function_handle')||nargin(transform)<3) … … 2373 2373 %------------------------------------------------------------------------ 2374 2374 function update_ij(handles,index_rank) 2375 2375 2376 2376 NomType=get(handles.NomType,'String'); 2377 2377 … … 2412 2412 set(handles.FileIndex_1,'BackgroundColor',[0.7 0.7 0.7])% mark the edit box in grey, then RUN0 will mark it in white for confirmation 2413 2413 end 2414 2414 2415 2415 %------------------------------------------------------------------------ 2416 2416 … … 2448 2448 for ilist=1:nbslice 2449 2449 list_index{ilist,1}=num2str(ilist); 2450 end 2450 end 2451 2451 set(handles.masklevel,'String',list_index) 2452 2452 set(handles.masklevel,'Value',z) … … 2465 2465 end 2466 2466 option=get(handles.view_xml,'String'); 2467 if isequal(option,'view .xml') 2467 if isequal(option,'view .xml') 2468 2468 FileXml=fullfile(RootPath,[SubDir '.xml']); 2469 2469 if ~exist(FileXml,'file')% case of civ files , removes the extension for subdir … … 2558 2558 2559 2559 %% update mask image if the mask is new 2560 if ~ (isfield(UvData,'MaskName') && isequal(UvData.MaskName,MaskName)) 2560 if ~ (isfield(UvData,'MaskName') && isequal(UvData.MaskName,MaskName)) 2561 2561 UvData.MaskName=MaskName; %update the recorded name on UvData 2562 2562 set(handles.uvmat,'UserData',UvData); 2563 2563 if ~exist(MaskName,'file') 2564 2564 if isfield(Mask,'maskhandle')&& ishandle(Mask.maskhandle) 2565 delete(Mask.maskhandle) 2565 delete(Mask.maskhandle) 2566 2566 end 2567 2567 else … … 2592 2592 end 2593 2593 flagmask=MaskField.A < 200; 2594 2594 2595 2595 %make brown color image 2596 2596 imflag(:,:,1)=0.9*flagmask; 2597 2597 imflag(:,:,2)=0.7*flagmask; 2598 2598 imflag(:,:,3)=zeros(size(flagmask)); 2599 2599 2600 2600 %update mask image 2601 2601 hmask=[]; %default … … 2604 2604 end 2605 2605 if ~isempty(hmask) 2606 set(hmask,'CData',imflag) 2606 set(hmask,'CData',imflag) 2607 2607 set(hmask,'AlphaData',flagmask*0.6) 2608 2608 set(hmask,'XData',MaskField.Coord_x); … … 2611 2611 else 2612 2612 axes(handles.PlotAxes) 2613 hold on 2613 hold on 2614 2614 Mask.maskhandle=image(MaskField.Coord_x,MaskField.Coord_y,imflag,'Tag','mask','HitTest','off','AlphaData',0.6*ones(size(flagmask))); 2615 2615 set(handles.CheckMask,'UserData',Mask) … … 2625 2625 %------------------------------------------------------------------------ 2626 2626 % --- Executes on button press in runplus: make one step forward and call 2627 % --- InputFileREFRESH. The step forward is along the fieldname series 1 or 2 depending on 2627 % --- InputFileREFRESH. The step forward is along the fieldname series 1 or 2 depending on 2628 2628 % --- the scan_i and scan_j check box (exclusive each other) 2629 2629 function runplus_Callback(hObject, eventdata, handles) … … 2634 2634 increment=str2double(get(handles.num_IndexIncrement,'String')); %get the field increment d 2635 2635 if isnan(increment)% case of free increment: move to next available field index 2636 increment='+'; 2636 increment='+'; 2637 2637 end 2638 2638 errormsg=runpm(hObject,eventdata,handles,increment); … … 2644 2644 %------------------------------------------------------------------------ 2645 2645 % --- Executes on button press in runmin: make one step backward and call 2646 % --- InputFileREFRESH. The step backward is along the fieldname series 1 or 2 depending on 2646 % --- InputFileREFRESH. The step backward is along the fieldname series 1 or 2 depending on 2647 2647 % --- the scan_i and scan_j check box (exclusive each other) 2648 2648 function runmin_Callback(hObject, eventdata, handles) … … 2653 2653 increment=-str2double(get(handles.num_IndexIncrement,'String')); %get the field increment d 2654 2654 if isnan(increment)% case of free increment: move to previous available field index 2655 increment='-'; 2655 increment='-'; 2656 2656 end 2657 2657 errormsg=runpm(hObject,eventdata,handles,increment); … … 2670 2670 increment=str2double(get(handles.num_IndexIncrement,'String')); %get the field increment d 2671 2671 if isnan(increment)% case of free increment: move to next available field index 2672 increment='+'; 2672 increment='+'; 2673 2673 end 2674 2674 set(handles.STOP,'Visible','on') … … 2700 2700 increment=-str2double(get(handles.num_IndexIncrement,'String')); %get the field increment d 2701 2701 if isnan(increment)% case of free increment: move to next available field index 2702 increment='-'; 2702 increment='-'; 2703 2703 end 2704 2704 set(handles.STOP,'Visible','on') … … 2799 2799 end 2800 2800 end 2801 2801 2802 2802 % the pair i1-i2 or j1-j2 is free (check box CheckFixPair not selected): the list of existing indices recorded in UvData is used 2803 2803 else … … 2870 2870 j2=UvData.j2_series{1}(ref_indices(end)); 2871 2871 end 2872 2872 2873 2873 % case of a second file series 2874 2874 if sub_value … … 2953 2953 %% update the index counters if the index move is successfull 2954 2954 2955 if isempty(errormsg) 2955 if isempty(errormsg) 2956 2956 set(handles.i1,'String',num2stra(i1,NomType,1)); 2957 2957 if isequal(i2,i1) … … 2967 2967 end 2968 2968 if strcmp(NomType,'level') 2969 indices=num2str(i1); 2969 indices=num2str(i1); 2970 2970 else 2971 2971 indices=fullfile_uvmat('','','','',NomType,i1,i2,j1,j2); … … 2981 2981 else 2982 2982 if isempty(i2), set(handles.i2,'String',''); end % suppress the second index display if not used 2983 if isempty(j2), set(handles.j2,'String',''); end 2983 if isempty(j2), set(handles.j2,'String',''); end 2984 2984 end 2985 2985 end … … 2998 2998 return 2999 2999 end 3000 3000 3001 3001 %% check the input file indexing: 3002 3002 [RootPath,SubDir,RootFile,FileIndex,FileExt]=read_file_boxes(handles); … … 3008 3008 filename=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt];% build the input file name (first line) 3009 3009 3010 set(handles.movie_pair,'BusyAction','queue')% 3010 set(handles.movie_pair,'BusyAction','queue')% 3011 3011 set(handles.CheckFixPair,'Value',1)% impose fixed pair (needed for function runpm) 3012 3012 set(handles.REFRESH,'BackgroundColor',[1 1 0])%paint the command button in yellow to indicate its activity … … 3209 3209 %------------------------------------------------------------------------ 3210 3210 % --- read the input files and inputfilerefresh all the plots, including projection. 3211 % OUTPUT: 3211 % OUTPUT: 3212 3212 % errormsg: error message char string =[] by default 3213 3213 % INPUT: 3214 3214 % FileName: first input file (=[] in the absence of input file) 3215 % FileName_1: second input file (=[] in the asbsence of second input file) 3215 % FileName_1: second input file (=[] in the asbsence of second input file) 3216 3216 % num_i1,num_i2,num_j1,num_j2; frame indices 3217 3217 % i1_1,i2_1,j1_1,j2_1: frame indices for the second input file (needed if FileName_1 is not empty) … … 3273 3273 end 3274 3274 3275 %% read the first input field 3275 %% read the first input field 3276 3276 ParamIn.ColorVar='';%default variable name for vector color 3277 3277 frame_index=1;%default … … 3299 3299 end 3300 3300 case {'video','mmreader','rdvision','cine_phantom'} 3301 ParamIn=UvData.MovieObject{1}; % movie object 3301 ParamIn=UvData.MovieObject{1}; % movie object 3302 3302 if strcmp(NomType,'*') 3303 3303 frame_index=num_i1;%frame index from a single movies or multimage … … 3327 3327 ParamIn.Npy=UvData.XmlData.Npy; 3328 3328 ParamIn.Npx=UvData.XmlData.Npx; 3329 else 3329 else 3330 3330 errormsg='Npx and Npy need to be defined in the xml file for volume images .vol'; 3331 3331 return … … 3348 3348 ParamIn.TimeVarName=TimeName(5:end); 3349 3349 end 3350 end 3350 end 3351 3351 end 3352 3352 … … 3355 3355 errormsg=['uvmat / refresh_field / read_field( ' FileName ') / ' errormsg]; 3356 3356 return 3357 end 3357 end 3358 3358 if isfield(ParamOut,'Npx')&& isfield(ParamOut,'Npy') 3359 3359 set(handles.num_Npx,'String',num2str(ParamOut.Npx));% display image size on the interface … … 3393 3393 list_code=get(handles.ColorScalar,'String');% list menu fields 3394 3394 index_code=get(handles.ColorScalar,'Value');% selected string index 3395 ParamIn_1.ColorVar= list_code{index_code}; % selected field for vector color display 3395 ParamIn_1.ColorVar= list_code{index_code}; % selected field for vector color display 3396 3396 end 3397 3397 end … … 3402 3402 else 3403 3403 frame_index_1=i1_1; 3404 end 3404 end 3405 3405 case 'multimage' 3406 3406 if strcmp(NomType_1,'*')%frame index for movies or multimage … … 3408 3408 else 3409 3409 frame_index_1=j1_1; 3410 end 3410 end 3411 3411 case 'vol' %TODO: update 3412 3412 if isfield(UvData.XmlData,'Npy') && isfield(UvData.XmlData,'Npx') … … 3436 3436 ParamIn_1.Coord_x=get(handles.Coord_x,'String'); 3437 3437 ParamIn_1.Coord_y=get(handles.Coord_y,'String'); 3438 end 3438 end 3439 3439 [Field{2},ParamOut_1,errormsg] = read_field(FileName_1,UvData.FileType{2},ParamIn_1,frame_index_1); 3440 3440 if ~isempty(errormsg) … … 3514 3514 set(handles.FixVelType,'Visible','off') 3515 3515 end 3516 3516 3517 3517 %% introduce w as background image by default for a new series (only for nbdim=2) 3518 3518 if ~isfield(UvData,'NewSeries') … … 3537 3537 % set(handles.FieldName_1,'Visible','on'); 3538 3538 % Field{1}.AName='w'; 3539 % end 3539 % end 3540 3540 3541 3541 %% display time value of the current file … … 3575 3575 abstime=Field{1}.Time; 3576 3576 elseif ~isempty(regexp(TimeName,'^att:', 'once')) 3577 abstime=Field{1}.(TimeName(5:end));%the time is an attribute selected by get_file 3577 abstime=Field{1}.(TimeName(5:end));%the time is an attribute selected by get_file 3578 3578 if isfield(Field{1},[TimeName(5:end) 'Unit']) 3579 3579 TimeUnit=Field{1}.([TimeName(5:end) 'Unit']); … … 3593 3593 dt=Field{2}.Dt;%dt read from the netcdf input file 3594 3594 end 3595 end 3595 end 3596 3596 set(handles.TimeValue,'String',num2str(abstime)) 3597 3597 … … 3619 3619 end 3620 3620 end 3621 3621 3622 3622 % get time in the input file of the second series, not defined in a xml file or movie 3623 if isempty(abstime_1) && numel(Field)==2 3623 if isempty(abstime_1) && numel(Field)==2 3624 3624 if strcmp(TimeName_1,'civdata')||strcmp(TimeName_1,'civx') 3625 3625 abstime_1=Field{2}.Time; … … 3652 3652 set(handles.Time_title,'String',Time_title) 3653 3653 3654 %% store the current open names, fieldname and vel types in uvmat interface 3654 %% store the current open names, fieldname and vel types in uvmat interface 3655 3655 UvData.FileName_1=FileName_1; 3656 3656 UvData.ParamOut_1=ParamOut_1; … … 3734 3734 else 3735 3735 set(handles.Objects,'Visible','on') 3736 3736 3737 3737 %% Plot the projections on the selected projection objects 3738 3738 %if no projection object exists, create a default one … … 3798 3798 PlotParam{1}.Vectors.ColorCode= {'rgb'}; 3799 3799 end 3800 3800 3801 3801 %% second projection object (view_field display) 3802 3802 if length( IndexObj)==2 … … 3808 3808 end 3809 3809 end 3810 3811 %% loop on the projection objects: one or two 3810 3811 %% loop on the projection objects: one or two 3812 3812 for imap=1:numel(IndexObj) 3813 3813 iobj=IndexObj(imap); … … 3822 3822 if iobj==1 && ~(isfield(UvData.ProjObject{iobj},'Coord') && size(UvData.ProjObject{iobj}.Coord,2)>=3 && UvData.ProjObject{iobj}.Coord(1,3)<UvData.Field.ZMax && UvData.ProjObject{iobj}.Coord(1,3)>UvData.Field.ZMin) 3823 3823 UvData.ProjObject{iobj}.Coord(1,3)=(UvData.Field.ZMin+UvData.Field.ZMax)/2;%section at a middle plane chosen 3824 end 3824 end 3825 3825 end 3826 3826 [ObjectData,errormsg]=proj_field(UvData.Field,UvData.ProjObject{iobj});% project field on the object 3827 3827 if ~isempty(errormsg) 3828 errormsg=['projection on ' UvData.ProjObject{iobj}.Type ': ' errormsg ]; 3828 errormsg=['projection on ' UvData.ProjObject{iobj}.Type ': ' errormsg ]; 3829 3829 return 3830 3830 end … … 3861 3861 ObjectData.A=flag_mask.*double(ObjectData.A); 3862 3862 ObjectData.A=feval(AClass,ObjectData.A); 3863 end 3863 end 3864 3864 set(handles.uvmat,'UserData',UvData) 3865 3865 if ~isempty(ObjectData) … … 3875 3875 hhset_object=guidata(hset_object);% 3876 3876 set(hhset_object.ProjMode,'Value',2); 3877 set_object('ProjMode_Callback',hset_object,[],hhset_object); 3877 set_object('ProjMode_Callback',hset_object,[],hhset_object); 3878 3878 end 3879 3879 return … … 3895 3895 end 3896 3896 end 3897 3897 3898 3898 %% update the mask 3899 3899 if isequal(get(handles.CheckMask,'Value'),1)%if the mask option is on 3900 3900 update_mask(handles); 3901 3901 end 3902 3902 3903 3903 %% prepare the menus of histograms and plot them (Histogram of the whole volume in 3D case) 3904 3904 menu_histo=(UvData.Field.ListVarName)';%list of field variables to be displayed for the menu of histogram display … … 3937 3937 menu_histo=[{[Ustring ',' Vstring]};menu_histo];% add U, V at the beginning if they exist 3938 3938 end 3939 3939 3940 3940 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3941 3941 % display menus and plot histograms … … 3954 3954 set(handles.CheckEditObject,'Value',1) 3955 3955 CheckEditObject_Callback(handles.uvmat, [], handles) 3956 end 3956 end 3957 3957 %ResizeFcn(handles.uvmat,[],handles) 3958 3958 set(handles.uvmat,'Pointer',pointer) … … 4082 4082 %------------------------------------------------------------------------ 4083 4083 function [indx,indy]=pos2ind(x0,rangx0,nxy) 4084 indx=1+round((nxy(2)-1)*(x0-rangx0(1))/(rangx0(2)-rangx0(1)));% index x of pixel 4084 indx=1+round((nxy(2)-1)*(x0-rangx0(1))/(rangx0(2)-rangx0(1)));% index x of pixel 4085 4085 indy=1+round((nxy(1)-1)*(y12-rangy0(1))/(rangy0(2)-rangy0(1)));% index y of pixel 4086 4086 … … 4144 4144 if ~test_civ2 && ~test_civ1 4145 4145 msgbox_uvmat('ERROR','manual correction only possible for CIV1 or CIV2 velocity fields') 4146 end 4146 end 4147 4147 if test_civ2 4148 4148 nbname='nb_vec_2'; … … 4159 4159 hhh=which('netcdf.open');% look for built-in matlab netcdf library 4160 4160 if ~isequal(hhh,'')% case of builtin Matlab netcdf library 4161 nc=netcdf.open(FileName,'NC_WRITE'); 4161 nc=netcdf.open(FileName,'NC_WRITE'); 4162 4162 netcdf.reDef(nc); 4163 4163 netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'CivStage',CivStage); 4164 dimid = netcdf.inqDimID(nc,nbname); 4164 dimid = netcdf.inqDimID(nc,nbname); 4165 4165 try 4166 4166 varid = netcdf.inqVarID(nc,flagname);% look for already existing fixflag variable … … 4170 4170 netcdf.endDef(nc); 4171 4171 netcdf.putVar(nc,varid,UvData.PlotAxes.FF); 4172 netcdf.close(nc); 4172 netcdf.close(nc); 4173 4173 else %old netcdf library 4174 4174 netcdf_toolbox(FileName,AxeData,attrname,nbname,flagname) … … 4185 4185 nb_vectors=size(theDim); 4186 4186 var_FixFlag=ncvar(flagname,nc);% var_FixFlag will be written as the netcdf variable vec_FixFlag 4187 var_FixFlag(1:nb_vectors)=AxeData.FF;% 4187 var_FixFlag(1:nb_vectors)=AxeData.FF;% 4188 4188 fin=close(nc); 4189 4189 … … 4193 4193 function SubField_Callback(hObject, eventdata, handles) 4194 4194 4195 if get(handles.SubField,'Value')==0% if the subfield button is desactivated 4195 if get(handles.SubField,'Value')==0% if the subfield button is desactivated 4196 4196 desable_subfield(handles) 4197 4197 transform_fct_list=get(handles.TransformName,'String'); … … 4199 4199 if strcmp(transform_fct,'sub_field') 4200 4200 set(handles.TransformName,'Value',1)%suppress the sub_field transform 4201 TransformName_Callback(hObject, eventdata, handles); 4201 TransformName_Callback(hObject, eventdata, handles); 4202 4202 else 4203 4203 REFRESH_Callback(hObject, eventdata, handles) 4204 end 4204 end 4205 4205 else 4206 4206 fileinput_1=uigetfile_uvmat('select a second input file:',get(handles.RootPath,'String')); 4207 4207 if isempty(fileinput_1) 4208 4208 set(handles.SubField,'Value',0) 4209 else 4209 else 4210 4210 % refresh the current displayed field 4211 4211 display_file_name(handles,fileinput_1,2) 4212 4212 4213 4213 %update list of recent files in the menubar 4214 4214 MenuFile_1=fileinput_1; … … 4229 4229 %----------------------------------------------------------------------- 4230 4230 function desable_subfield(handles) 4231 4231 4232 4232 set(handles.RootPath_1,'String','') 4233 4233 set(handles.RootFile_1,'String','') … … 4293 4293 RootFile_1=get(handles.RootFile_1,'String'); 4294 4294 if isequal(get(handles.RootFile_1,'Visible'),'off') || isequal(RootFile_1,'"') 4295 RootFile_1=get(handles.RootFile,'String'); 4295 RootFile_1=get(handles.RootFile,'String'); 4296 4296 end 4297 4297 RootFile_1=regexprep(RootFile_1,'\<[\\/]|[\\/]\>','');%suppress possible / or \ separator at the beginning or the end of the string … … 4323 4323 [tild,tild,tild,i1,i2,j1,j2,tild,NomType]=fileparts_uvmat(['xxx' get(handles.FileIndex,'String') FileExt]); 4324 4324 4325 switch field 4325 switch field 4326 4326 case 'get_field...' 4327 4327 %% fill the axes and variables from selections in get_field … … 4353 4353 end 4354 4354 end 4355 4355 4356 4356 % VelType menu desactivated 4357 4357 set(handles.FixVelType,'visible','off') 4358 4358 set(handles.VelType,'Visible','off') 4359 4359 4360 4360 %read selection from get_field 4361 4361 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles); … … 4376 4376 ZName=GetFieldData.Coordinates.Coord_z; 4377 4377 end 4378 end 4378 end 4379 4379 CName=GetFieldData.PanelVectors.vec_color; 4380 4380 FieldList={['vec(' UName ',' VName ')'];... … … 4430 4430 set(handles.TimeName,'String',['dim:' GetFieldData.Time.TimeName]); 4431 4431 set(handles.NomType,'String','*') 4432 set(handles.RootFile,'String',[get(handles.RootFile,'String') get(handles.FileIndex,'String')]) 4432 set(handles.RootFile,'String',[get(handles.RootFile,'String') get(handles.FileIndex,'String')]) 4433 4433 set(handles.i1,'String','1')% set counter to 1 (now the time index in the input matrix) 4434 4434 MaxIndex_i=get(handles.MaxIndex_i,'String'); … … 4455 4455 REFRESH_Callback(hObject, eventdata, handles) 4456 4456 end 4457 4457 4458 4458 case 'image' 4459 4459 %% look for image corresponding to civ data … … 4540 4540 end 4541 4541 end 4542 4542 4543 4543 % VelType menu desactivated 4544 4544 set(handles.FixVelType,'visible','off') 4545 4545 set(handles.VelType,'Visible','off') 4546 4546 4547 4547 %read selection from get_field 4548 4548 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes_1(handles); … … 4621 4621 if ~exist(imagename,'file') 4622 4622 imagename=uigetfile_uvmat('Pick an image file',imagename,'image'); 4623 4623 4624 4624 end 4625 4625 if isempty(imagename) … … 4634 4634 set(handles.FileIndex_1,'String',get(handles.FileIndex,'String')) 4635 4635 set(handles.FileExt_1,'String',get(handles.FileExt,'String')) 4636 4636 4637 4637 UvData.FileType{2}=UvData.FileType{1}; 4638 4638 UvData.XmlData{2}= UvData.XmlData{1}; … … 4643 4643 TransformName_Callback(hObject, eventdata, handles)% activate transform_fct_Callback and refresh current plot 4644 4644 check_refresh=0; 4645 end 4645 end 4646 4646 end 4647 4647 if ~isequal(field,'image') … … 4651 4651 end 4652 4652 set(handles.uvmat,'UserData',UvData) 4653 4653 4654 4654 if check_refresh && ~(isfield(UvData,'NewSeries')&&isequal(UvData.NewSeries,1)) 4655 4655 REFRESH_Callback(hObject, eventdata, handles) … … 4658 4658 4659 4659 %------------------------------------------------------------------------ 4660 % --- set the visibility of relevant velocity type menus: 4660 % --- set the visibility of relevant velocity type menus: 4661 4661 function menu=set_veltype_display(Civ,FileType) 4662 4662 %------------------------------------------------------------------------ … … 4720 4720 UvData=get(handles.uvmat,'UserData'); 4721 4721 set(handles.InputFileREFRESH,'BackgroundColor',[1 1 0])%paint REFRESH button in yellow to indicate its activation 4722 drawnow 4722 drawnow 4723 4723 InputFile=read_GUI(handles.InputFile);% read the input file parameters 4724 4724 [RootPath,SubDir,RootFile,FileIndex,FileExt]=read_file_boxes(handles); … … 4735 4735 check_refresh=1;%will refresh the current plot 4736 4736 else% we introduce the same file (with a different field) for the second series 4737 FileName_1=FileName;% we compare two fields in the same file 4737 FileName_1=FileName;% we compare two fields in the same file 4738 4738 UvData.FileType{2}=UvData.FileType{1}; 4739 4739 UvData.XmlData{2}= UvData.XmlData{1}; … … 4746 4746 else 4747 4747 check_refresh=1; 4748 end 4748 end 4749 4749 end 4750 4750 … … 4782 4782 end 4783 4783 if exist('handle1','var')%handles of selected button 4784 set(handle1,'BackgroundColor',[1 1 0]) 4784 set(handle1,'BackgroundColor',[1 1 0]) 4785 4785 end 4786 4786 … … 4793 4793 delete(handles.UVMAT_title) 4794 4794 end 4795 UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface 4795 UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface 4796 4796 if isequal(get(handles.VOLUME,'Value'),1) 4797 4797 set(handles.CheckZoom,'Value',0) … … 4822 4822 data.RangeX=max(meshx,meshy); 4823 4823 data.DX=max(meshx,meshy); 4824 end 4824 end 4825 4825 data.ParentButton=handles.VOLUME; 4826 4826 PlotHandles=get_plot_handles(handles);%get the handles of the interface elements setting the plotting parameters … … 4837 4837 function edit_vect_Callback(hObject, eventdata, handles) 4838 4838 %------------------------------------------------------- 4839 % 4839 % 4840 4840 if isequal(get(handles.edit_vect,'Value'),1) 4841 4841 VelTypeMenu=get(handles.VelType,'String'); … … 4843 4843 if ~strcmp(VelType,'civ2') && ~strcmp(VelType,'civ1') 4844 4844 msgbox_uvmat('ERROR','manual correction only possible for CIV1 or CIV2 velocity fields') 4845 end 4845 end 4846 4846 set(handles.record,'Visible','on') 4847 4847 set(handles.edit_vect,'BackgroundColor',[1 1 0]) … … 4877 4877 end 4878 4878 end 4879 if isfield(ObjectData,'Coord')& isfield(ObjectData,'Style') 4880 if isequal(ObjectData.Type,'polygon') 4879 if isfield(ObjectData,'Coord')& isfield(ObjectData,'Style') 4880 if isequal(ObjectData.Type,'polygon') 4881 4881 X=ObjectData.Coord(:,1); 4882 4882 Y=ObjectData.Coord(:,2); … … 4884 4884 [X,Y]=px_XYZ(Calib,X,Y,0);% to generalise with 3D cases 4885 4885 end 4886 flagobj=~inpolygon(Xi,Yi,X',Y');%=0 inside the polygon, 1 outside 4886 flagobj=~inpolygon(Xi,Yi,X',Y');%=0 inside the polygon, 1 outside 4887 4887 elseif isequal(ObjectData.Type,'ellipse') 4888 4888 if testphys … … 4927 4927 % imflag=uint8(255*flag);% =0 for flag=0 (vectors=0 when 20<imflag<200) 4928 4928 msgbox_uvmat('CONFIRMATION',[mask_name ' saved']) 4929 imwrite(imflag,mask_name,'BitDepth',8); 4929 imwrite(imflag,mask_name,'BitDepth',8); 4930 4930 4931 4931 %display the mask … … 4979 4979 set(handles.TransformName,'String',menu) 4980 4980 set(handles.TransformName,'Value',ichoice) 4981 4981 4982 4982 % save the new menu in the personal file 'uvmat_perso.mat' 4983 4983 dir_perso=prefdir;%personal Matalb directory … … 5359 5359 % --- Execute on return carriage on the edit box corresponding to slider 1 5360 5360 %---------------------------------------------------------------- 5361 function num_ColCode1_Callback(hObject, eventdata, handles) 5361 function num_ColCode1_Callback(hObject, eventdata, handles) 5362 5362 set_vec_col_bar(handles) 5363 5363 update_plot(handles); … … 5491 5491 objectcolor='b'; 5492 5492 end 5493 UvData.ProjObject{IndexObj}.DisplayHandle.uvmat=plot_object(UvData.ProjObject{IndexObj},ObjectData,hobject,objectcolor);%draw the object in uvmat 5493 UvData.ProjObject{IndexObj}.DisplayHandle.uvmat=plot_object(UvData.ProjObject{IndexObj},ObjectData,hobject,objectcolor);%draw the object in uvmat 5494 5494 end 5495 5495 set(handles.uvmat,'UserData',UvData) … … 5509 5509 5510 5510 % desactivate the edit object mode 5511 set(handles.CheckEditObject,'Value',0) 5512 % set(handles.CheckEditObject,'BackgroundColor',[0.7,0.7,0.7]) 5511 set(handles.CheckEditObject,'Value',0) 5512 % set(handles.CheckEditObject,'BackgroundColor',[0.7,0.7,0.7]) 5513 5513 5514 5514 %------------------------------------------------------------------------ … … 5535 5535 end 5536 5536 5537 %% desactivate the edit object mode for security 5538 set(handles.CheckEditObject,'Value',0) 5537 %% desactivate the edit object mode for security 5538 set(handles.CheckEditObject,'Value',0) 5539 5539 5540 5540 %% update the plot on view_field if view_field is already openened … … 5552 5552 [PlotType,PlotParam]=plot_field(ProjData,hhview_field.PlotAxes,read_GUI(hview_field));%read plotting parameters on the uvmat interface 5553 5553 haxes=findobj(hview_field,'tag','axes3'); 5554 pos=get(hview_field,'Position'); 5554 pos=get(hview_field,'Position'); 5555 5555 if strcmp(get(haxes,'Visible'),'off')%sempty(PlotParam.Axes)% case of no plot display (pure text table) 5556 5556 h_TableDisplay=findobj(hview_field,'tag','TableDisplay'); … … 5626 5626 %------------------------------------------------------------------- 5627 5627 hset_object=findobj(allchild(0),'Tag','set_object'); 5628 if get(handles.CheckEditObject,'Value') 5629 %suppress the other options 5628 if get(handles.CheckEditObject,'Value') 5629 %suppress the other options 5630 5630 set(handles.MenuObject,'checked','off') 5631 5631 set(handles.CheckZoom,'Value',0) … … 5640 5640 CheckViewObject_Callback(hObject, eventdata, handles) 5641 5641 else % desactivate object edit mode 5642 if ~isempty(hset_object)% open the 5642 if ~isempty(hset_object)% open the 5643 5643 set(get(hset_object,'children'),'Enable','off') 5644 5644 hSAVE=findobj(hset_object,'Tag','SAVE'); … … 5654 5654 check_view=get(handles.CheckViewObject,'Value'); 5655 5655 5656 if check_view %activate set_object 5656 if check_view %activate set_object 5657 5657 IndexObj=get(handles.ListObject,'Value'); 5658 5658 list_object=get(handles.ListObject,'String'); … … 5676 5676 data.Type='plane'; 5677 5677 end 5678 5678 5679 5679 %% initiate the new projection object 5680 5680 hset_object=set_object(data,[],ZBounds); … … 5693 5693 end 5694 5694 end 5695 5695 5696 5696 5697 5697 %------------------------------------------------------------------------ … … 5719 5719 list_object=get(handles.ListObject,'String'); 5720 5720 UvData.ProjObject{IndexObj(end)}.Name=list_object{IndexObj(end)}; 5721 5721 5722 5722 %% show the projection of the selected object on view_field 5723 5723 [ProjData,errormsg]= proj_field(UvData.Field,UvData.ProjObject{IndexObj});%project the current field on ObjectData … … 5772 5772 % INPUT: 5773 5773 % hObject: object index (if integer) or handle of the graphic object. If 5774 % hObject is a subobject, the parent object is detected and deleted. 5774 % hObject is a subobject, the parent object is detected and deleted. 5775 5775 5776 5776 function delete_object(IndexObj) … … 5847 5847 else 5848 5848 set(handles.CheckFixAspectRatio,'Value',0) 5849 5849 5850 5850 end 5851 5851 end … … 5874 5874 if isfield(PlotParam.Scalar,'MinA') 5875 5875 set(handles.num_MinA,'String',num2str(PlotParam.Scalar.MinA,3)); 5876 end 5876 end 5877 5877 if isfield(PlotParam.Scalar,'IncrA') 5878 5878 set(handles.num_IncrA,'String',num2str(PlotParam.Scalar.IncrA,3)) … … 5880 5880 set(handles.CheckBW,'Value',PlotParam.Scalar.CheckBW) 5881 5881 if isfield(PlotParam.Scalar,'Opacity')&&isfield(handles,'num_Opacity') 5882 set(handles.num_Opacity,'String',num2str(PlotParam.Scalar.Opacity)) 5882 set(handles.num_Opacity,'String',num2str(PlotParam.Scalar.Opacity)) 5883 5883 end 5884 5884 else
Note: See TracChangeset
for help on using the changeset viewer.