Changeset 1200
- Timestamp:
- Mar 20, 2026, 4:42:36 PM (21 hours ago)
- Location:
- trunk/src
- Files:
-
- 10 edited
-
mouse_motion.m (modified) (1 diff)
-
mouse_up.m (modified) (4 diffs)
-
plot_field.m (modified) (19 diffs)
-
series.m (modified) (41 diffs)
-
series.xml.default (modified) (1 diff)
-
series/civ_input.fig (modified) (previous)
-
series/civ_input.m (modified) (1 diff)
-
series/civ_series.m (modified) (12 diffs)
-
uvmat.fig (modified) (previous)
-
uvmat.m (modified) (22 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mouse_motion.m
r1195 r1200 37 37 end 38 38 hhCurrentFig=guidata(hCurrentFig);%handles of the elements in the GUI containing the current figure (uvmat or view_field) 39 if isempty(hhCurrentFig) 40 return 41 end 39 42 CheckZoom=get(hhCurrentFig.CheckZoom,'Value');% check for zoom on mode 40 43 CheckZoomFig=get(hhCurrentFig.CheckZoomFig,'Value');% check for zoom sub fig creation mode -
trunk/src/mouse_up.m
r1180 r1200 151 151 else 152 152 hhview_field=guidata(hview_field); 153 [ PlotType,PlotParam]=plot_field(ProjData,hhview_field.PlotAxes,read_GUI(hview_field));%update an existing plot in view_field153 [~,PlotParam]=plot_field(ProjData,hhview_field.PlotAxes,read_GUI(hview_field));%update an existing plot in view_field 154 154 errormsg=fill_GUI(PlotParam,hview_field); 155 155 end … … 168 168 else 169 169 UvData.PlotAxes=ProjData; 170 [ PlotType,PlotParam]=plot_field(ProjData,hhuvmat.PlotAxes,read_GUI(huvmat));%update an existing field plot170 [~,PlotParam]=plot_field(ProjData,hhuvmat.PlotAxes,read_GUI(huvmat));%update an existing field plot 171 171 errormsg=fill_GUI(PlotParam,huvmat); 172 172 end … … 201 201 202 202 %% creation or update of a zoom sub-plot 203 if CheckZoomFig && isequal(get(hcurrentfig,'SelectionType'),'normal')&&...%if left button has been pressed203 CheckZoomFigActivate=CheckZoomFig && strcmp(get(hcurrentfig,'SelectionType'),'normal')&&...%if left button has been pressed 204 204 ~isempty(CurrentOrigin) && ~isequal(CurrentOrigin(1),xy(1,1)) && ~isequal(CurrentOrigin(2),xy(1,2))%if mouse moved in x and y since presed down 205 if CheckZoomFigActivate 205 206 hparentfig=hcurrentfig; 206 207 %open or update a new zoom figure if a rectangle has been drawn 207 208 if ishandle(hcurrentaxes) 208 209 if isfield(AxeData,'CurrentRectZoom') && ~isempty(AxeData.CurrentRectZoom) && ishandle(AxeData.CurrentRectZoom) 209 %PosRect=get(AxeData.CurrentRectZoom,'Position');210 210 if isfield(AxeData,'CurrentVec') && ~isempty(AxeData.CurrentVec) && ishandle(AxeData.CurrentVec) 211 211 delete(AxeData.CurrentVec) … … 391 391 %------------------------------------------------------------------------ 392 392 function close_fig(ggg,eventdata,hparent) 393 394 hfig=get(get(hparent,'parent'),'parent'); 395 hbutton=findobj(hfig,'Tag','CheckZoomFig'); 396 if ~isempty(hbutton) 397 set(hbutton,'Value',0)% desactivate the zoom fig option 398 end 399 delete(hparent) % delete the rectangle showing the zoom graph in the parent fig 400 393 if isvalid(hparent) 394 figparent=get(hparent,'parent'); 395 if ~isempty(figparent) 396 hfig=get(figparent,'parent'); 397 hbutton=findobj(hfig,'Tag','CheckZoomFig'); 398 if ~isempty(hbutton) 399 set(hbutton,'Value',0)% desactivate the zoom fig option 400 end 401 delete(hparent) % delete the rectangle showing the zoom graph in the parent fig 402 end 403 end -
trunk/src/plot_field.m
r1195 r1200 178 178 AxeData=get(haxes,'UserData'); 179 179 180 %% 2D plots 181 if isempty(index_2D) 182 plot_plane([],[],haxes,[]);%removes images or vector plots in the absence of 2D field plot 180 %% 2D plots 181 if isempty(index_2D) %removes images or vector plots in the absence of 2D field plot 182 hima=findobj(haxes,'Tag','ima');% search existing image in the current axes 183 if ishandle(hima) 184 delete(hima) 185 end 186 hvec=findobj(haxes,'Tag','vel');% search existing vectors in the current axes 187 if ~isempty(hvec) 188 delete(hvec); 189 end 183 190 else %plot 2D field 184 % if ~exist('PosColorbar','var'),PosColorbar=[];end;191 % if ~exist('PosColorbar','var'),PosColorbar=[];end; 185 192 [~,PlotParamOut,PlotType,errormsg]=plot_plane(Data,CellInfo(index_2D),haxes,PlotParamOut); 186 193 AxeData.NbDim=2; 187 if testzoomaxes && isempty(errormsg) 188 [zoomaxes,PlotParamOut,~,errormsg]=plot_plane(Data,CellInfo(index_2D),zoomaxes,PlotParamOut); 194 if testzoomaxes && isempty(errormsg)% updater the plot on the attached axis 195 PlotParamZoom=PlotParamOut; 196 PlotParamZoom.Axes.CheckFixLimits=1; 197 XLim=get(zoomaxes,'XLim'); 198 YLim=get(zoomaxes,'YLim'); 199 PlotParamZoom.Axes.MinX=XLim(1); 200 PlotParamZoom.Axes.MaxX=XLim(2); 201 PlotParamZoom.Axes.MinY=YLim(1); 202 PlotParamZoom.Axes.MaxY=YLim(2); 203 PlotParamZoom.Axes.CheckZoomFig=0; 204 [zoomaxes,~,~,errormsg]=plot_plane(Data,CellInfo(index_2D),zoomaxes,PlotParamZoom); 189 205 AxeData.ZoomAxes=zoomaxes; 190 206 end … … 275 291 % --- plot 0D fields: display data values without plot 276 292 %------------------------------------------------------------------ 277 function errormsg=plot_text(FieldData,CellInfo, htext)293 function errormsg=plot_text(FieldData,CellInfo,~) 278 294 279 295 errormsg=''; 280 txt_cell={};281 Data={};282 296 VarIndex=[]; 283 for icell=1:length(CellInfo) 284 297 for icell=1:length(CellInfo) 285 298 % select types of variables to be projected 286 299 ListProj={'VarIndex_scalar','VarIndex_image','VarIndex_color','VarIndex_vector_x','VarIndex_vector_y'}; … … 617 630 end 618 631 Val=pdf2stat(x,pdf_val); 619 Column= mat2cell(Val,ones(13,1),ones(1,size(Val,2)));632 Column=num2cell(Val,ones(13,1),ones(1,size(Val,2))); 620 633 if size(Val,2)==1%single component 621 634 TitleBar={VarName}; … … 665 678 test_ima=0; %default: test for image or map plot 666 679 test_vec=0; %default: test for vector plots 667 test_black=0;668 680 test_false=0; 669 681 test_C=0; … … 681 693 ivar_Y=CellInfo{icell}.CoordIndex(end-1); % defines (unique)index for the variable representing unstructured y coordinate (default =[]) 682 694 ivar_C=[]; 683 if isfield(CellInfo{icell},'VarIndex_scalar') 684 ivar_C=[ivar_C CellInfo{icell}.VarIndex_scalar]; 685 end 686 if isfield(CellInfo{icell},'VarIndex_image') 687 ivar_C=[ivar_C CellInfo{icell}.VarIndex_image]; 688 end 689 if isfield(CellInfo{icell},'VarIndex_color') 690 ivar_C=[ivar_C CellInfo{icell}.VarIndex_color]; 691 end 692 if isfield(CellInfo{icell},'VarIndex_ancillary') 693 ivar_C=[ivar_C CellInfo{icell}.VarIndex_ancillary]; 694 end 695 if numel(ivar_C)>1 696 errormsg= 'error in plot_field: too many scalar inputs'; 697 return 698 end 695 ListFields=fields(CellInfo{icell}); 696 for ilist=1:numel(ListFields) 697 if ismember(ListFields{ilist},{'VarIndex_scalar','VarIndex_image','VarIndex_color','VarIndex_ancillary'}) 698 ivar_C=CellInfo{icell}.(ListFields{ilist}); 699 break % do not allow more than one scalar 700 end 701 end 699 702 ivar_F=[]; 700 703 if isfield(CellInfo{icell},'VarIndex_warnflag') … … 734 737 end 735 738 if isfield(PlotParam.Vectors,'ColorScalar') && ~isempty(PlotParam.Vectors.ColorScalar) 736 [VarVal, ListVarName,VarAttribute,errormsg]=calc_field_interp([],Data,PlotParam.Vectors.ColorScalar);739 [VarVal,~,~,errormsg]=calc_field_interp([],Data,PlotParam.Vectors.ColorScalar); 737 740 if ~isempty(VarVal) 738 741 vec_C=reshape(VarVal{1},1,numel(VarVal{1})); … … 745 748 if ~isempty(ivar_F)%~(isfield(PlotParam.Vectors,'HideWarning')&& isequal(PlotParam.Vectors.HideWarning,1)) 746 749 vec_F=Data.(Data.ListVarName{ivar_F}); % warning flags for dubious vectors 747 vec_FF( find(vec_F==-2))=1;%setalseFlag to 1(edge of the search box)750 vec_FF(vec_F==-2)=1;%set FalseFlag to 1(edge of the search box) 748 751 end 749 752 end … … 790 793 DCoord_y_min=min(DCoord_y); 791 794 DCoord_y_max=max(DCoord_y); 792 if sign(DCoord_y_min)~=sign(DCoord_y_max) ;% =1 for increasing values, 0 otherwise795 if sign(DCoord_y_min)~=sign(DCoord_y_max)% =1 for increasing values, 0 otherwise 793 796 errormsg=['errror in plot_field.m: non monotonic dimension variable ' YName ]; 794 797 return … … 877 880 if isfield(PlotParam.Scalar,'CheckBW') && ~isempty(PlotParam.Scalar.CheckBW) 878 881 ColorMap=PlotParam.Scalar.CheckBW;%PlotParam.Scalar.CheckBW is char string indicating the colormap type 879 elseif ((siz==2) && (isa(A,'uint8')|| isa(A,'uint16')))% non color images represented in gray scale by default882 elseif siz==2 && (isa(A,'uint8')||isa(A,'uint16'))% non color images represented in gray scale by default 880 883 ColorMap='grayscale'; 881 884 end … … 962 965 % fill the space between contours if opacity is undefined or =1 963 966 if isequal(Opacity,1) 964 [ var,hcontour]=contour(haxes,x_cont,y_cont,A,cont_pos);% determine all contours967 [~,hcontour]=contour(haxes,x_cont,y_cont,A,cont_pos);% determine all contours 965 968 set(hcontour,'Fill','on')% fill the space between contours 966 969 set(hcontour,'LineStyle','none') 967 970 hold on 968 971 end 969 [ var_p,hcontour_p]=contour(haxes,x_cont,y_cont,A,cont_pos_plus,'k-');% draw the contours for positive values as solid lines972 [~,~]=contour(haxes,x_cont,y_cont,A,cont_pos_plus,'k-');% draw the contours for positive values as solid lines 970 973 hold on 971 [ var_m,hcontour_m]=contour(haxes,x_cont,y_cont,A,cont_pos_min,'--');% draw the contours for negative values as dashed lines974 [~,hcontour_m]=contour(haxes,x_cont,y_cont,A,cont_pos_min,'--');% draw the contours for negative values as dashed lines 972 975 if isequal(Opacity,1) 973 976 set(hcontour_m,'LineColor',[1 1 1])% draw negative contours in white (better visibility in dark background) … … 977 980 978 981 %determine the color scale and map 979 c axis([abscontmin abscontmax])982 clim([abscontmin abscontmax]) 980 983 if strcmp(ColorMap,'grayscale') 981 984 vec=linspace(0,1,(abscontmax-abscontmin)/interval);%define a greyscale colormap with steps interval … … 1005 1008 A=uint8(255*double(A)/double(MaxA)); 1006 1009 end 1007 %otherwise1008 %colormap(ColorMap);1010 otherwise 1011 colormap(ColorMap); 1009 1012 end 1010 1013 … … 1088 1091 end 1089 1092 if length(PosColorbar)==4 1090 set(hcol,'Position',PosColorbar) 1093 % set(hcol,'Units','pixel') 1094 set(hcol,'Position',PosColorbar) 1091 1095 end 1092 1096 %YTick=0;%default … … 1126 1130 end 1127 1131 else%no scalar plot 1128 if ~isempty(hima) &&ishandle(hima)1132 if ishandle(hima) 1129 1133 delete(hima) 1130 1134 end 1131 if ~isempty(PosColorbar) && ~isempty(hcol) && ishandle(hcol)1135 if ~isempty(PosColorbar) && ~isempty(hcol) && ishandle(hcol) 1132 1136 delete(hcol) 1133 1137 end … … 1217 1221 % take flags into account: add flag colors to the list of colors 1218 1222 nbcolor=size(colorlist,1); 1219 % % % if test_black1220 % % % nbcolor=nbcolor+1;1221 % % % colorlist(nbcolor,:)=[0 0 0]; %add black to the list of colors1222 % % % if ~isempty(ivar_FF_vec)1223 % % % col_vec(vec_F~=1 & vec_F~=0 & vec_FF==0)=nbcolor;1224 % % % else1225 % % % col_vec(vec_F~=1 & vec_F~=0)=nbcolor;1226 % % % end1227 % % % end1228 1223 nbcolor=nbcolor+1; 1229 1224 if ~isempty(ivar_FF_vec) … … 1349 1344 arrowplus=rot*[uc;vc]; 1350 1345 arrowmoins=rot'*[uc;vc]; 1351 % x1=xc+uc/2-arrowplus(1,:);1352 % x2=xc+uc/2;1353 % x3=xc+uc/2-arrowmoins(1,:);1354 % y1=yc+vc/2-arrowplus(2,:);1355 % y2=yc+vc/2;1356 % y3=yc+vc/2-arrowmoins(2,:);1357 1346 x1=xc+uc-arrowplus(1,:); 1358 1347 x2=xc+uc; … … 1366 1355 matyar=reshape(matyar,1,4*n(2)); 1367 1356 %draw the line or modify the existing ones 1368 % tri=reshape(1:3*length(uc),3,[])';1369 1357 isn=isnan(colorlist(icolor,:));%test if color NaN 1370 1358 if 2*icolor > sizh(1) %if icolor exceeds the number of existing ones … … 1432 1420 diffy=diff(vec_Y); %difference dy=vec_Y(i+1)-vec_Y(i) 1433 1421 index=find(diffy);% find the indices of vec_Y after wich a change of horizontal line occurs(diffy non zero) 1434 if isempty(index); msgbox_uvmat('ERROR','points aligned along abscissa in proj_grid.m'); return; end ;%points aligned% A FAIRE: switch to line plot.1422 if isempty(index); msgbox_uvmat('ERROR','points aligned along abscissa in proj_grid.m'); return; end%points aligned% A FAIRE: switch to line plot. 1435 1423 diff2=diff(diffy(index));% diff2 = fluctuations of the detected vertical grid mesh dy 1436 1424 if max(abs(diff2))>0.001*abs(diffy(index(1))) % if max(diff2) is larger than 1/1000 of the first mesh dy … … 1489 1477 end 1490 1478 if test_interp==1%if we interpolate 1491 xi= [rangx(1):(rangx(2)-rangx(1))/(npxy(2)-1):rangx(2)];1492 yi= [rangy(1):(rangy(2)-rangy(1))/(npxy(1)-1):rangy(2)];1479 xi=rangx(1):(rangx(2)-rangx(1))/(npxy(2)-1):rangx(2); 1480 yi=rangy(1):(rangy(2)-rangy(1))/(npxy(1)-1):rangy(2); 1493 1481 [XI,YI]=meshgrid(xi,yi); 1494 1482 A = interp2(X,Y,B,XI,YI); -
trunk/src/series.m
r1199 r1200 165 165 RunModeList={'local';'background'}; % default choice of extensions (Matlab fct .m or compiled version .sh) 166 166 if isfield(SeriesData.ClusterParam, 'ExistenceTest') 167 oarcommand=SeriesData.ClusterParam.ExistenceTest; 168 s=system(oarcommand); % look for cluster system presence 167 ClusterExistenceTest=SeriesData.ClusterParam.ExistenceTest; 168 disp('look for cluster command available') 169 s=system(ClusterExistenceTest); % look for cluster system presence 169 170 if isequal(s,0)% cluster detected 170 171 RunModeList=[RunModeList;{'cluster'}]; … … 568 569 %------------------------------------------------------------------------ 569 570 CheckRelabel=get(handles.Relabel,'Value'); 570 check_input_file_series(handles,CheckRelabel) 571 572 %% enable field and veltype menus, in accordance with the current action 571 errormsg=check_input_file_series(handles,CheckRelabel); 572 if ~isempty(errormsg) 573 msgbox_uvmat('ERROR',errormsg);% no input files entered 574 set(handles.REFRESH,'BackgroundColor',[1 0 0])% set REFRESH back to red color 575 return 576 end 577 578 %% enable field and veltype menus, in accordance with the current action function 573 579 ActionInput_Callback([],[], handles) 574 580 575 581 %------------------------------------------------------------------------ 576 582 % --- check the input file series. 577 function check_input_file_series(handles,CheckRelabel)583 function errormsg=check_input_file_series(handles,CheckRelabel) 578 584 %------------------------------------------------------------------------ 579 585 InputTable=get(handles.InputTable,'Data');%read the table of input file series 580 586 set(handles.series,'Pointer','watch') % set the mouse pointer to 'watch' 581 587 set(handles.REFRESH,'BackgroundColor',[1 1 0])% set REFRESH button to yellow color (indicate activation) 582 set(handles.Relabel,'BackgroundColor',[0 1 0])583 588 drawnow 584 empty_line=false(size(InputTable,1),1); 589 errormsg='';%default 590 591 %% removes possible empty lines in the tables documenting the files index series 592 check_empty_line=false(size(InputTable,1),1); 585 593 for iline=1:size(InputTable,1) 586 empty_line(iline)= isempty(cell2mat(InputTable(iline,1:3)));%check the empty lines in the input table 587 end 588 if ~isempty(find(empty_line,1))%removes the empty lines in the table 589 InputTable(empty_line,:)=[]; % remove empty lines 594 check_empty_line(iline)= isempty(cell2mat(InputTable(iline,1:3)));%check the empty lines in the input table 595 end 596 empty_lines=find(check_empty_line);%line indices which are empty 597 if numel(empty_lines)==size(InputTable,1) 598 errormsg='input files needed';% no input files 599 return 600 end 601 if ~isempty(empty_lines) 602 InputTable(empty_lines,:)=[]; % remove empty lines 590 603 set(handles.InputTable,'Data',InputTable) 591 604 ListTable={'MinIndex_i','MaxIndex_i','MinIndex_j','MaxIndex_j','PairString','TimeTable'}; 592 605 for ilist=1:numel(ListTable) 593 606 Table=get(handles.(ListTable{ilist}),'Data'); 594 Table(empty_line ,:)=[]; % remove empty lines607 Table(empty_lines,:)=[]; % remove empty lines 595 608 set(handles.(ListTable{ilist}),'Data',Table); 596 609 end 597 610 set(handles.series,'UserData',[])%refresh the stored info 598 611 end 599 nbview=size(InputTable,1); 600 CheckRelabelQuest=false; 612 nbview=size(InputTable,1);% number of lines filled in the Input file table after this cleaning of empty lines 613 614 %% get info on each line of the input table 615 CheckRelabelQuest=true;% will ask for relabeling if relevant 601 616 for iview=1:nbview 602 RootPath=fullfile(InputTable{iview,1},InputTable{iview,2}); 603 Param.Relabel=false; 617 RootPath=fullfile(InputTable{iview,1},InputTable{iview,2});% path of the input file series 618 Param.Relabel=false;% no relabeling by default 604 619 MovieObject=[]; 605 620 Param.FileInfo=[]; 606 621 if ~exist(RootPath,'dir') 607 622 Param.i1_series=[]; 608 RootFile=''; 623 RootFile='';% input folder does not exist, will ask by browser 609 624 else 610 [XmlFileName,Rank]=find_imadoc(InputTable{iview,1},InputTable{iview,2}); 625 [XmlFileName,Rank]=find_imadoc(InputTable{iview,1},InputTable{iview,2});%look for ImaDoc file 611 626 if ~isempty(XmlFileName) 612 XmlData=read_imadoc(XmlFileName); 613 if Rank==0 && ~isempty(XmlData.FileSeries) 614 set(handles.Relabel,'Visible','on') 627 XmlData=read_imadoc(XmlFileName);%read the imadoc file through the local fct read_imadoc 628 if Rank==0 && ~isempty(XmlData.FileSeries)% file relabeling proposed in the xml file 629 set(handles.Relabel,'Visible','on')% make the relabel check box visible 615 630 answer='Yes'; 616 if ~CheckRelabel && ~CheckRelabelQuest% propose to relabel if not selected yet631 if ~CheckRelabel && CheckRelabelQuest% propose to relabel if not selected yet 617 632 answer=msgbox_uvmat('INPUT_Y-N','relabel the frame indices according to the xml info?'); 618 CheckRelabelQuest= true;633 CheckRelabelQuest=false;% will validate the answer for all lines 619 634 end 620 if strcmp(answer,'Yes') 621 set(handles.Relabel,'Value',1) 635 if strcmp(answer,'Yes')% relabel option activated 636 set(handles.Relabel,'Value',1)% activate the relabel option 637 CheckRelabel=true; 622 638 NomType='*'; 623 639 i1=1;i2=[];j1=1;j2=[]; … … 633 649 FirstFile=fullfile(InputTable{iview,1},InputTable{iview,2},XmlData.FileSeries.FileName{1}); 634 650 if ~exist(FirstFile,'file') 635 msgbox_uvmat('ERROR',[FirstFile ' does not exist']);651 errormsg=[FirstFile ' set by the xml file does not exist']; 636 652 return 637 653 end 638 [Param.FileInfo,VideoObject]=get_file_info(FirstFile);654 Param.FileInfo=get_file_info(FirstFile); 639 655 else 640 set(handles.Relabel,'Value',0) 656 set(handles.Relabel,'Value',0) % suppress the relabel option 641 657 end 642 658 end … … 647 663 %scan the input folder 648 664 InputTable{iview,3}=regexprep(InputTable{iview,3},'^/','');%suppress '/' at the beginning of the input name 649 i1=str2double(get(handles.num_first_i,'String')); 650 j1=str2double(get(handles.num_first_j,'String')); 651 j2=[];%default 652 % PairString=get(handles.PairString,'Data'); 653 % if numel(PairString)>=iview 654 % r=regexp(PairString{iview},'(?<num1>\d+)-(?<num2>\d+)' ,'names'); 655 % if ~isempty(r) 656 % j1=str2double(r.num1); 657 % j2=str2double(r.num2); 658 % end 659 % end 660 InputFile=[InputTable{iview,3} InputTable{iview,4} InputTable{iview,5}]; 661 %InputFile=fullfile_uvmat('','',InputTable{iview,3},InputTable{iview,5},InputTable{iview,4},i1,[],j1,j2); 665 InputFile=[InputTable{iview,3} InputTable{iview,4} InputTable{iview,5}]; 662 666 [RootPath,~,RootFile,Param.i1_series,Param.i2_series,Param.j1_series,Param.j2_series,~,Param.FileInfo,MovieObject]=... 663 667 find_file_series(fullfile(InputTable{iview,1},InputTable{iview,2}),InputFile); 664 668 end 665 669 666 % if no file is found on line #iv ew, open a browser670 % if no file is found on line #iview, open a browser 667 671 if ~Param.Relabel && isempty(RootFile)&& isempty(Param.i1_series) 668 672 fileinput=uigetfile_uvmat(['wrong input at line ' num2str(iview) ':pick a new input file'],RootPath); 669 673 if isempty(fileinput) 670 set(handles.REFRESH,'BackgroundColor',[1 0 0])% set REFRESH back to red color674 errormsg='no input file entered'; 671 675 return 672 676 else 673 display_file_name(handles,fileinput,iview)% update the table of input file series , thencall update_rootinfo677 display_file_name(handles,fileinput,iview)% update the table of input file series #iview, then will call update_rootinfo 674 678 end 675 679 else … … 678 682 end 679 683 680 %% update MinIndex_i and MaxIndex_i if the input table content has been reduced in line nbre684 %% suppress possible remaining data beyond nbview lines in MinIndex_i, MaxIndex_i ,MinIndex_j, MaxIndex_j,PairString,TimeTable 681 685 MinIndex_i_table=get(handles.MinIndex_i,'Data'); % retrieve the min indices in the table MinIndex 682 set(handles.MinIndex_i,'Data',MinIndex_i_table(1:nbview,:)); 686 set(handles.MinIndex_i,'Data',MinIndex_i_table(1:nbview)); % save only the nbviews values, remove possible values beyond 687 683 688 MinIndex_j_table=get(handles.MinIndex_j,'Data'); % retrieve the min indices in the table MinIndex 684 set(handles.MinIndex_j,'Data',MinIndex_j_table(1:nbview,:)); 685 MaxIndex_i_table=get(handles.MaxIndex_i,'Data'); % retrieve the min indices in the table MinIndex 686 687 set(handles.MaxIndex_i,'Data',MaxIndex_i_table(1:nbview,:)); 689 set(handles.MinIndex_j,'Data',MinIndex_j_table(1:nbview)); 690 691 MaxIndex_i_table=get(handles.MaxIndex_i,'Data'); % retrieve the max indices in the table MinIndex 692 set(handles.MaxIndex_i,'Data',MaxIndex_i_table(1:nbview)); 693 688 694 MaxIndex_j_table=get(handles.MaxIndex_j,'Data'); % retrieve the min indices in the table MinIndex 689 set(handles.MaxIndex_j,'Data',MaxIndex_j_table(1:nbview,:)); 695 set(handles.MaxIndex_j,'Data',MaxIndex_j_table(1:nbview)); 696 690 697 PairString=get(handles.PairString,'Data'); % retrieve the min indices in the table MinIndex 691 set(handles.PairString,'Data',PairString(1:nbview,:)); 698 set(handles.PairString,'Data',PairString(1:nbview)); 699 692 700 TimeTable=get(handles.TimeTable,'Data'); % retrieve the min indices in the table MinIndex 693 701 set(handles.TimeTable,'Data',TimeTable(1:nbview,:)); 694 702 695 696 703 set(handles.REFRESH,'BackgroundColor',[1 0 0])% set REFRESH button to red color (indicate activation finished) 697 704 set(handles.series,'Pointer','arrow') % set the mouse pointer to 'watch' 698 699 705 700 706 … … 750 756 XmlData=[]; 751 757 if ~isempty(XmlFileName) 752 XmlData=read_imadoc(XmlFileName); 758 XmlData=read_imadoc(XmlFileName);%read the imadoc file through the local fct read_imadoc 753 759 if isfield(XmlData,'FileSeries') && Rank==0 754 760 set(handles.Relabel,'Visible','on') … … 925 931 SeriesData.InputPath=InputPath; 926 932 end 927 928 929 933 set(handles.series,'UserData',SeriesData) 930 931 934 set(handles.InputTable,'BackgroundColor',[1 1 1]) 932 933 934 935 935 936 %% initiate input file series and refresh the current field view: … … 947 948 % --- get info from the xml file XmlFileName 948 949 function XmlData=read_imadoc(XmlFileName) 949 950 %------------------------------------------------------------------------ 950 951 [XmlData,errormsg]=imadoc2struct(XmlFileName); 951 952 if ~isempty(errormsg) … … 1011 1012 if isempty(i1_series) 1012 1013 MinIndex_j=1;MaxIndex_j=1;MinIndex_i=1;MaxIndex_i=1; 1013 elseif size(i1_series,2)==2 && min(min(i1_series(:,1,:)))==0 1014 elseif size(i1_series,2)==2 && min(min(i1_series(:,1,:)))==0 % file series with a single index i 1014 1015 MinIndex_j=1; % index j set to 1 by default 1015 1016 MaxIndex_j=1; … … 1026 1027 diff_i_max=diff(ref_i); 1027 1028 if ~isempty(diff_i_max) && isequal (diff_i_max,diff_i_max(1)*ones(size(diff_i_max))) 1028 set(handles.num_incr_i,'String',num2str(diff_i_max(1)))% detect an increment to disp aly by default1029 set(handles.num_incr_i,'String',num2str(diff_i_max(1)))% detect an increment to display by default 1029 1030 end 1030 1031 if ~isempty(diff_j_max) && isequal (diff_j_max,diff_j_max(1)*ones(size(diff_j_max))) … … 1078 1079 InputTable=get(handles.InputTable,'Data'); 1079 1080 [XmlFileName,Rank]=find_imadoc(InputTable{iview,1},InputTable{iview,2}); 1080 if isempty(XmlFileName) 1081 return 1082 else 1081 if ~isempty(XmlFileName) 1083 1082 Param.XmlData=read_imadoc(XmlFileName); 1084 end 1085 [nbfield,nbfield_j]=size(Param.XmlData.Time); 1086 nbfield=nbfield-1; %remove the possible index 0 1087 nbfield_j=nbfield_j-1; %remove the possible index 0 1088 % MaxIndex_i=get(handles.MaxIndex_i,'Data'); 1089 % MaxIndex_j=get(handles.MaxIndex_j,'Data'); 1090 % MaxIndex_i(1,:)=nbfield; 1091 % MaxIndex_j(1,:)=nbfield_j; 1092 % MinIndex_i(1,:)=1; 1093 % MinIndex_j(1,:)=1; 1094 MaxIndex_i=nbfield; 1095 MaxIndex_j=nbfield_j; 1096 MinIndex_i=1; 1097 MinIndex_j=1; 1098 1083 [nbfield,nbfield_j]=size(Param.XmlData.Time); 1084 nbfield=nbfield-1; %remove the possible index 0 1085 nbfield_j=nbfield_j-1; %remove the possible index 0 1086 MaxIndex_i=nbfield; 1087 MaxIndex_j=nbfield_j; 1088 MinIndex_i=1; 1089 MinIndex_j=1; 1090 end 1099 1091 1100 1092 first_i=str2double(get(handles.num_first_i,'String')); … … 1115 1107 1116 1108 %% determine the min and max times: case of Netcdf files will be treated later in FieldName_Callback 1117 if ~isempty(TimeName) 1109 if isempty(TimeName) 1110 TimeMin=NaN; TimeMax=NaN; TimeFirst=NaN; TimeLast=NaN; 1111 else 1118 1112 if size(Time)<[MaxIndex_i+1 MaxIndex_j+1] 1119 msgbox_uvmat('WARNING', ['incomplete time info in xml file']);1113 msgbox_uvmat('WARNING','incomplete time info in xml file'); 1120 1114 end 1121 1115 TimeMin=Time(MinIndex_i+1,MinIndex_j+1); … … 1143 1137 set(handles.MaxIndex_j,'Data',MaxIndex_j_table)%display the max indices in the table MaxIndex 1144 1138 1145 if isfield(Param .XmlData,'NbSlice') && ~isempty(Param.XmlData.NbSlice)1139 if isfield(Param,'XmlData') && isfield(Param.XmlData,'NbSlice') && ~isempty(Param.XmlData.NbSlice) 1146 1140 set(handles.num_NbSlice,'String',num2str(Param.XmlData.NbSlice)) 1147 1141 set(handles.num_NbSlice,'Visible','on') … … 1223 1217 SeriesData.j1_series{iview}=j1_series; 1224 1218 SeriesData.j2_series{iview}=j2_series; 1225 % SeriesData.FileType{iview}=FileInfo.FileType;1226 1219 SeriesData.FileInfo{iview}=Param.FileInfo; 1227 1220 SeriesData.Time{iview}=Time; … … 1882 1875 drawnow 1883 1876 end 1884 if get(handles.Replicate,'Value') 1877 if get(handles.Replicate,'Value')%resset the input file settings in case of replicated processing 1885 1878 set(handles.InputTable,'Data',Param.InputTable) 1886 1879 set(handles.OutputPath,'String',OutputPath) … … 2416 2409 %------------------------------------------------------------------------ 2417 2410 % --- read parameters from the GUI series 2418 %------------------------------------------------------------------------2419 2411 function Param=read_GUI_series(handles) 2420 2421 %% read raw parameters from the GUI series 2412 %------------------------------------------------------------------------ 2413 2414 % read raw parameters from the GUI series 2422 2415 Param=read_GUI(handles.series); 2423 2416 … … 2559 2552 set(handles.num_CPUTime,'String','') 2560 2553 2554 %------------------------------------------------------------------------ 2561 2555 % --- Executes on button press in ActionInput. 2562 2556 function ActionInput_Callback(hObject, eventdata, handles) 2557 %------------------------------------------------------------------------ 2563 2558 2564 2559 set(handles.ActionInput,'BackgroundColor',[1 1 0]) … … 3093 3088 end 3094 3089 3095 3090 %------------------------------------------------------------------------ 3096 3091 function [TimeValue,DtValue]=get_time(ref_i,ref_j,PairString,InputTable,FileInfo,TimeName,DtName) 3092 %------------------------------------------------------------------------ 3097 3093 [i1,i2,j1,j2] = get_file_index(ref_i,ref_j,PairString); 3098 3094 FileName=fullfile_uvmat(InputTable{1},InputTable{2},InputTable{3},InputTable{5},InputTable{4},i1,i2,j1,j2); … … 3182 3178 end 3183 3179 3184 3185 %%%%%%%%%%%%% 3180 %------------------------------------------------------------------------ 3186 3181 function [ind_remove]=find_pairs(dirpair,ind_i,last_i) 3182 %------------------------------------------------------------------------ 3187 3183 indsel=ind_i; 3188 3184 indiff=diff(ind_i); % test index increment to detect multiplets (several pairs with the same index ind_i) and holes in the series … … 3307 3303 %------------------------------------------------------------------------ 3308 3304 % --- Executes on button press in ViewObject. 3309 %------------------------------------------------------------------------3310 3305 function ViewObject_Callback(hObject, eventdata, handles) 3306 %------------------------------------------------------------------------ 3311 3307 3312 3308 UserData=get(handles.series,'UserData'); … … 3360 3356 %------------------------------------------------------------------------ 3361 3357 % --- Executed when CheckMask is activated 3362 %------------------------------------------------------------------------3363 3358 function CheckMask_Callback(hObject, eventdata, handles) 3359 %------------------------------------------------------------------------ 3364 3360 % SeriesData=get(handles.series,'UserData'); 3365 3361 … … 3484 3480 %------------------------------------------------------------------------ 3485 3481 % --- Executes when selected cell(s) is changed in MaskTable. 3486 %------------------------------------------------------------------------3487 3482 function MaskTable_CellSelectionCallback(hObject, eventdata, handles) 3488 3483 %------------------------------------------------------------------------ 3489 3484 if numel(eventdata.Indices)>=1 3490 3485 set(handles.ListMask,'Value',eventdata.Indices(1)) … … 3494 3489 function MenuHelp_Callback(hObject, eventdata, handles) 3495 3490 %------------------------------------------------------------------- 3496 3497 3498 % path_to_uvmat=which ('uvmat'); % check the path of uvmat 3499 % pathelp=fileparts(path_to_uvmat); 3500 % helpfile=fullfile(pathelp,'uvmat_doc','uvmat_doc.html'); 3501 % if isempty(dir(helpfile)), msgbox_uvmat('ERROR','Please put the help file uvmat_doc.html in the sub-directory /uvmat_doc of the UVMAT package') 3502 % else 3503 % addpath (fullfile(pathelp,'uvmat_doc')) 3504 % web([helpfile '#series']) 3505 % end 3491 web('https://legi.gricad-pages.univ-grenoble-alpes.fr/soft/uvmat-doc/help') 3506 3492 3507 3493 %------------------------------------------------------------------- … … 3580 3566 %------------------------------------------------------------------------ 3581 3567 % --- fct activated by the upper bar menu ExportConfig 3582 %------------------------------------------------------------------------3583 3568 function MenuDisplayConfig_Callback(hObject, eventdata, handles) 3584 3569 %------------------------------------------------------------------------ 3585 3570 global Param 3586 3571 Param=read_GUI_series(handles); 3587 3572 evalin('base','global Param')%make CurData global in the workspace 3588 disp lay('current series config :')3573 disp('current series config :') 3589 3574 evalin('base','Param') %display CurData in the workspace 3590 3575 commandwindow; % brings the Matlab command window to the front … … 3595 3580 %------------------------------------------------------------------------ 3596 3581 function MenuImportConfig_Callback(hObject, eventdata, handles) 3582 %------------------------------------------------------------------------ 3597 3583 3598 3584 %% use a browser to choose the xml file containing the processing config … … 3668 3654 3669 3655 %------------------------------------------------------------------------ 3670 % --- Executes when the GUI series is resized. 3671 %------------------------------------------------------------------------ 3656 % --- Executes when the GUI series is resized.- 3672 3657 function series_ResizeFcn(hObject, eventdata, handles) 3673 3674 %% input table 3658 %------------------------------------------------------------------------ 3659 3660 % input table 3675 3661 set(handles.InputTable,'Unit','pixel') 3676 3662 Pos=get(handles.InputTable,'Position'); … … 3713 3699 set(handles.PairString,'ColumnWidth',{Pos(3)-5}) 3714 3700 3715 %% MaskTable 3716 % % set(handles.MaskTable,'Unit','pixel') 3717 % % Pos=get(handles.MaskTable,'Position'); 3718 % % set(handles.MaskTable,'Unit','normalized') 3719 % % set(handles.MaskTable,'ColumnWidth',{Pos(3)-5}) 3720 3721 %------------------------------------------------------------------------ 3722 % --- Executes on button press in status. 3723 %------------------------------------------------------------------------ 3701 %------------------------------------------------------------------------ 3702 % --- Executes on button press in status.- 3724 3703 function status_Callback(hObject, eventdata, handles) 3725 3704 %------------------------------------------------------------------------ 3726 3705 if get(handles.status,'Value') 3727 3706 set(handles.status,'BackgroundColor',[1 1 0]) … … 3752 3731 end 3753 3732 3754 3755 3733 %------------------------------------------------------------------------ 3756 3734 % launched by selecting a file on the list 3757 %------------------------------------------------------------------------3758 3735 function view_file(hObject, eventdata) 3759 3736 %------------------------------------------------------------------------ 3760 3737 list=get(hObject,'String'); 3761 3738 index=get(hObject,'Value'); … … 3794 3771 end 3795 3772 3796 3797 3773 %------------------------------------------------------------------------ 3798 3774 % launched by refreshing the status figure 3799 %------------------------------------------------------------------------3800 3775 function refresh_GUI(hfig) 3801 3776 %------------------------------------------------------------------------ 3802 3777 htitlebox=findobj(hfig,'tag','titlebox'); 3803 3778 hlist=findobj(hfig,'tag','list'); … … 3858 3833 %------------------------------------------------------------------------ 3859 3834 % --- Executes on selection change in ActionExt. 3860 %------------------------------------------------------------------------3861 3835 function ActionExt_Callback(hObject, eventdata, handles) 3862 3836 %------------------------------------------------------------------------ 3863 3837 ActionExtList=get(handles.ActionExt,'String'); 3864 3838 ActionExt=ActionExtList{get(handles.ActionExt,'Value')}; … … 3912 3886 menu=menu(imin:imax); 3913 3887 3914 3915 % --- Executes on mouse motion over figure - except title and menu. 3916 % function series_WindowButtonMotionFcn(hObject, eventdata, handles) 3917 % set(hObject,'Pointer','arrow'); 3918 3919 3888 %------------------------------------------------------------------------ 3920 3889 % --- Executes on button press in SetPairs. 3921 3890 function SetPairs_Callback(hObject, eventdata, handles) 3922 3891 %------------------------------------------------------------------------ 3923 3892 %% delete previous occurrence of 'set_pairs' 3924 3893 hfig=findobj(allchild(0),'Tag','set_pairs'); … … 4006 3975 %------------------------------------------------------------------------ 4007 3976 function ListView_Callback(hObject,eventdata) 3977 %------------------------------------------------------------------------ 4008 3978 Mode_Callback(hObject,eventdata) 4009 3979 4010 3980 %------------------------------------------------------------------------ 4011 3981 function Mode_Callback(hObject,eventdata) 3982 %------------------------------------------------------------------------ 4012 3983 %% get input info 4013 3984 hseries=findobj(allchild(0),'tag','series'); % handles of the GUI series … … 4025 3996 4026 3997 %% enable j index visibility after the new choice 4027 4028 3998 if strcmp(mode,'series(Dj)') 4029 3999 status_j='on'; % default … … 4073 4043 set(hPairString,'Data',PairString) 4074 4044 4075 4076 4045 %------------------------------------------------------------------------ 4077 4046 function num_ref_i_Callback(hObject, eventdata) … … 4089 4058 delete(get(hObject,'parent')) 4090 4059 4091 4092 4060 %------------------------------------------------------------------------ 4093 4061 % --- Executes on button press in ClearLine. 4094 %------------------------------------------------------------------------4095 4062 function ClearLine_Callback(hObject, eventdata, handles) 4063 %------------------------------------------------------------------------ 4096 4064 InputTable=get(handles.InputTable,'Data'); 4097 4065 iline=str2double(get(handles.InputLine,'String')); … … 4102 4070 set(handles.REFRESH,'BackgroundColor',[1 0 1])% set REFRESH button to magenta color to indicate that input refr 4103 4071 4104 4072 %------------------------------------------------------------------------ 4105 4073 % --- Executes on button press in MonitorCluster. 4106 4074 function MonitorCluster_Callback(hObject, eventdata, handles) 4107 4075 %------------------------------------------------------------------------ 4108 4076 [rr,ss]=system('oarstat |grep N=UVmat');% check the list of jobs launched with uvmat 4109 4077 if isempty(ss) … … 4114 4082 end 4115 4083 4116 4084 %------------------------------------------------------------------------ 4117 4085 function OutputSubDir_Callback(hObject, eventdata, handles) 4086 %------------------------------------------------------------------------ 4118 4087 set(handles.OutputSubDir,'BackgroundColor',[1 1 1]) 4119 4088 … … 4124 4093 % --- Executes on button press in TestCPUTime. 4125 4094 function TestCPUTime_Callback(hObject, eventdata, handles) 4126 % hObject handle to TestCPUTime (see GCBO) 4127 % eventdata reserved - to be defined in a future version of MATLAB 4128 % handles structure with handles and user data (see GUIDATA) 4129 4130 4095 4096 %------------------------------------------------------------------------ 4131 4097 % --- Executes on button press in DiskQuota. 4132 4098 function DiskQuota_Callback(hObject, eventdata, handles) 4099 %------------------------------------------------------------------------ 4133 4100 SeriesData=get(handles.series,'UserData'); 4134 4101 system(SeriesData.DiskQuotaCmd) 4135 4102 4136 4103 %------------------------------------------------------------------------ 4137 4104 % --- Executes on button press in Replicate. 4138 4105 function Replicate_Callback(hObject, eventdata, handles) 4106 %------------------------------------------------------------------------ 4139 4107 if get(handles.Replicate,'Value') 4140 4108 InputTable=get(handles.InputTable,'Data'); … … 4159 4127 function Device_Callback(hObject, eventdata, handles) 4160 4128 4161 4129 %------------------------------------------------------------------------ 4162 4130 % --- Executes on button press in OutputPathBrowse. 4163 4131 function OutputPathBrowse_Callback(hObject, eventdata, handles) 4132 %------------------------------------------------------------------------ 4164 4133 CheckValue=get(handles.OutputPathBrowse,'Value'); 4165 4134 if CheckValue … … 4171 4140 end 4172 4141 4173 4142 %------------------------------------------------------------------------ 4174 4143 % --- Executes on button press in DeleteMask. 4175 4144 function DeleteMask_Callback(hObject, eventdata, handles) 4145 %------------------------------------------------------------------------ 4176 4146 set(handles.MaskTable,'Data',{}) 4177 4147 4178 4148 %------------------------------------------------------------------------ 4179 4149 % --- Executes on button press in Relabel. 4180 4150 function Relabel_Callback(hObject, eventdata, handles) 4151 %------------------------------------------------------------------------ 4181 4152 CheckRelabel=get(hObject,'Value'); 4182 4153 if CheckRelabel … … 4195 4166 end 4196 4167 end 4197 check_input_file_series(handles,CheckRelabel) 4198 ActionInput_Callback([],[], handles) 4199 4200 4168 check_input_file_series(handles,CheckRelabel)% check the min and max relabeled indices, or original ones if CheckRelabel=false 4169 ActionInput_Callback([],[], handles)% %% enable menus (field, vel type,...), in accordance with the current action function 4170 4171 -
trunk/src/series.xml.default
r1171 r1200 6 6 <NbCoreAdvised>16</NbCoreAdvised> <!-- proposed default number of parallel cores attributed for the computations --> 7 7 <NbCoreMax>36</NbCoreMax> <!-- maximum number of cores allowed for the computations --> 8 <JobCPUTimeAdvised unit="minute"> 20</JobCPUTimeAdvised> <!-- used to group the iterations into jobs of sufficient CPU time -->8 <JobCPUTimeAdvised unit="minute">60</JobCPUTimeAdvised> <!-- used to group the iterations into jobs of sufficient CPU time --> 9 9 <JobNumberMax>500</JobNumberMax> <!-- maximum number of jobs allowed (will group the iterations to fit in) --> 10 10 <WallTimeMax unit="hour">23</WallTimeMax> <!-- maximum allowed time for a job --> -
trunk/src/series/civ_input.m
r1199 r1200 89 89 FileType='image';%fdefault 90 90 FileInfo=[]; 91 if isfield(SeriesData,'FileInfo') 91 if isfield(SeriesData,'FileInfo') && ~isempty(SeriesData.FileInfo) 92 92 FileType=SeriesData.FileInfo{1}.FileType;% info on the first input file series 93 93 else -
trunk/src/series/civ_series.m
r1199 r1200 392 392 [par_civ1.ImageB,VideoObject_B] = read_image(ImageName_B,FileType_B,VideoObject_B,FrameIndex_B); 393 393 394 % catch ME % display errors in reading input images395 % if ~isempty(ME.message)396 % disp_uvmat('ERROR', ['error reading input image: ' ME.message],checkrun)397 % continue398 % end399 % end400 394 401 395 % case of background image to subtract 402 396 if par_civ1.CheckBackground &&~isempty(par_civ1.Background) 403 397 [RootPath_background,SubDir_background,RootFile_background,~,~,~,~,Ext_background]=fileparts_uvmat(Param.ActionInput.Civ1.Background); 404 if ~isempty(i2_series_Civ1)% case of volume,backgrounds act on different j levels398 if strcmp(NomTypeNc,'_1-2_1')% case of volume,backgrounds act on different j levels 405 399 backgroundname=fullfile_uvmat(RootPath_background,SubDir_background,RootFile_background,Ext_background,'_1',j1_series_Civ1(ifield)); 406 elseif isfield(par_civ1,'NbSlice') 400 elseif isfield(par_civ1,'NbSlice')&& ~isequal(par_civ1.NbSlice,1) 407 401 i1_background=mod(i1-1,par_civ1.NbSlice)+1; 408 402 backgroundname=fullfile_uvmat(RootPath_background,SubDir_background,RootFile_background,Ext_background,'_1',i1_background); … … 418 412 if ~isempty(regexp(backgroundname,'(^http://)|(^https://)', 'once'))|| exist(backgroundname,'file') 419 413 try 420 par_civ1.Background= imread(backgroundname);%update the background, an store it for future use414 par_civ1.Background=uint16(imread(backgroundname));%update the background, an store it for future use 421 415 catch ME 422 416 if ~isempty(ME.message) … … 432 426 backgroundoldname=backgroundname; 433 427 end 434 par_civ1.ImageA= par_civ1.ImageA-par_civ1.Background;435 par_civ1.ImageB= par_civ1.ImageB-par_civ1.Background;428 par_civ1.ImageA=uint16(par_civ1.ImageA)-par_civ1.Background; 429 par_civ1.ImageB=uint16(par_civ1.ImageB)-par_civ1.Background; 436 430 end 437 431 … … 496 490 if ~isempty(i2_series_Civ1)&& ~isequal(i1_series_Civ1,i2_series_Civ1)% case of volume,masks act on different j levels 497 491 maskname=fullfile_uvmat(RootPath_mask,SubDir_mask,RootFile_mask,Ext_mask,'_1',j1); 498 elseif isfield(par_civ1,'NbSlice') 492 elseif isfield(par_civ1,'NbSlice')&& ~isequal(par_civ1.NbSlice,1) 499 493 i1_mask=mod(i1-1,par_civ1.NbSlice)+1; 500 494 maskname=fullfile_uvmat(RootPath_mask,SubDir_mask,RootFile_mask,Ext_mask,'_1',i1_mask); … … 638 632 if strcmp(ImageName_A_Civ2,ImageName_A) && isequal(FrameIndex_A,FrameIndex_A_2) 639 633 par_civ2.ImageA=par_civ1.ImageA; 634 CheckDuplicate_1to2A=true; 640 635 else 641 636 [par_civ2.ImageA,VideoObject_A] = read_image(ImageName_A_Civ2,FileType_A,VideoObject_A,FrameIndex_A_2); 637 CheckDuplicate_1to2A=false; 642 638 end 643 639 if CheckRelabel … … 650 646 if strcmp(ImageName_B_Civ2,ImageName_B) && isequal(FrameIndex_B_2,FrameIndex_B) 651 647 par_civ2.ImageB=par_civ1.ImageB; 648 CheckDuplicate_1to2B=true; 652 649 else 653 650 [par_civ2.ImageB,VideoObject_B] = read_image(ImageName_B_Civ2,FileType_B,VideoObject_B,FrameIndex_B_2); 651 CheckDuplicate_1to2B=false; 654 652 end 655 653 % [FileInfo_A,VideoObject_A]=get_file_info(ImageName_A_Civ2); … … 673 671 end 674 672 675 % %% user defined image transform 676 % if ~isempty(transform_fct) 677 % par_civ2 =transform_fct(par_civ2,Param); 678 % end 673 %% case of background image to subtract, if images civ2 different from civ1 674 if (~CheckDuplicate_1to2A || ~CheckDuplicate_1to2B) && par_civ2.CheckBackground &&~isempty(par_civ2.Background) 675 [RootPath_background,SubDir_background,RootFile_background,~,~,~,~,Ext_background]=fileparts_uvmat(Param.ActionInput.Civ2.Background); 676 j1=1; 677 if ~isempty(j1_series_Civ2) 678 j1=j1_series_Civ2(ifield); 679 end 680 if ~isempty(i2_series_Civ2)% case of volume,backgrounds act on different j levels 681 backgroundname=fullfile_uvmat(RootPath_background,SubDir_background,RootFile_background,Ext_background,'_1',j1); 682 elseif isfield(par_civ2,'NbSlice') && ~isequal(par_civ2.NbSlice,1) 683 i1_background=mod(i1-1,par_civ2.NbSlice)+1; 684 backgroundname=fullfile_uvmat(RootPath_background,SubDir_background,RootFile_background,Ext_background,'_1',i1_background); 685 if strcmp(Param.ActionInput.PairIndices.ListPairMode,'series(Di)')% case of volume, background index refers to j index 686 par_civ2.NbSlice_j=par_civ2.NbSlice; 687 end 688 else 689 backgroundname=Param.ActionInput.Civ2.Background; 690 end 691 if strcmp(backgroundoldname,backgroundname)% background exist, not already read in civ2 692 par_civ2.Background=background; %use background already opened 693 else 694 if ~isempty(regexp(backgroundname,'(^http://)|(^https://)', 'once'))|| exist(backgroundname,'file') 695 try 696 par_civ2.Background=uint16(imread(backgroundname));%update the background, an store it for future use 697 catch ME 698 if ~isempty(ME.message) 699 errormsg=['error reading input image: ' ME.message]; 700 disp_uvmat('ERROR',errormsg,checkrun) 701 return 702 end 703 end 704 else 705 par_civ2.Background=[]; 706 end 707 background=par_civ2.Background; 708 backgroundoldname=backgroundname; 709 end 710 if ~CheckDuplicate_1to2A 711 par_civ2.ImageA=uint16(par_civ2.ImageA)-par_civ2.Background; 712 end 713 if ~CheckDuplicate_1to2B 714 par_civ2.ImageB=uint16(par_civ2.ImageB)-par_civ2.Background; 715 end 716 end 717 679 718 %% case of image luminosity rescaling 680 if par_civ2.CheckRescale &&~isempty(par_civ2.Maxtanh) 681 par_civ2.ImageA =par_civ2.Maxtanh*tanh(double(par_civ2.ImageA)/par_civ2.Maxtanh); 682 par_civ2.ImageB=par_civ2.Maxtanh*tanh(double(par_civ2.ImageB)/par_civ2.Maxtanh); 719 if par_civ2.CheckRescale && ~isempty(par_civ2.Maxtanh) 720 if ~CheckDuplicate_1to2A %if the image A is different from civ1 721 par_civ2.ImageA =par_civ2.Maxtanh*tanh(double(par_civ2.ImageA)/par_civ2.Maxtanh); 722 end 723 if ~CheckDuplicate_1to2B % if the image B is different from civ1 724 par_civ2.ImageB=par_civ2.Maxtanh*tanh(double(par_civ2.ImageB)/par_civ2.Maxtanh); 725 end 683 726 end 684 727 … … 761 804 end 762 805 maskname=fullfile_uvmat(RootPath_mask,SubDir_mask,RootFile_mask,Ext_mask,'_1',j1); 763 elseif isfield(par_civ2,'NbSlice') 806 elseif isfield(par_civ2,'NbSlice')&& ~isequal(par_civ2.NbSlice,1) 764 807 i1=i1_series_Civ2(ifield); 765 808 i1_mask=mod(i1-1,par_civ2.NbSlice)+1; … … 794 837 end 795 838 796 % case of background image to subtract 797 if par_civ2.CheckBackground &&~isempty(par_civ2.Background) 798 [RootPath_background,SubDir_background,RootFile_background,~,~,~,~,Ext_background]=fileparts_uvmat(Param.ActionInput.Civ1.Background); 799 j1=1; 800 if ~isempty(j1_series_Civ1) 801 j1=j1_series_Civ1(ifield); 802 end 803 if ~isempty(i2_series_Civ1)% case of volume,backgrounds act on different j levels 804 backgroundname=fullfile_uvmat(RootPath_background,SubDir_background,RootFile_background,Ext_background,'_1',j1); 805 elseif isfield(par_civ2,'NbSlice') 806 i1_background=mod(i1-1,par_civ2.NbSlice)+1; 807 backgroundname=fullfile_uvmat(RootPath_background,SubDir_background,RootFile_background,Ext_background,'_1',i1_background); 808 if strcmp(Param.ActionInput.PairIndices.ListPairMode,'series(Di)')% case of volume, background index refers to j index 809 par_civ2.NbSlice_j=par_civ2.NbSlice; 810 end 811 else 812 backgroundname=Param.ActionInput.Civ1.Background; 813 end 814 if strcmp(backgroundoldname,backgroundname)% background exist, not already read in civ2 815 par_civ2.Background=background; %use background already opened 816 else 817 if ~isempty(regexp(backgroundname,'(^http://)|(^https://)', 'once'))|| exist(backgroundname,'file') 818 try 819 par_civ2.Background=imread(backgroundname);%update the background, an store it for future use 820 catch ME 821 if ~isempty(ME.message) 822 errormsg=['error reading input image: ' ME.message]; 823 disp_uvmat('ERROR',errormsg,checkrun) 824 return 825 end 826 end 827 else 828 par_civ2.Background=[]; 829 end 830 background=par_civ2.Background; 831 backgroundoldname=backgroundname; 832 end 833 par_civ2.ImageA=par_civ2.ImageA-par_civ2.Background; 834 par_civ2.ImageB=par_civ2.ImageB-par_civ2.Background; 835 end 836 839 %% get civ2 correlation parameters 837 840 if strcmp(Param.ActionInput.ListCompareMode,'displacement') 838 841 Civ1_Dt=1; … … 852 855 end 853 856 854 % calculate velocity data (y and v in image indices, reverse to y component) 855 857 % calculate velocity data 856 858 [Civ_X,Civ_Y,Civ_U,Civ_V,Civ_C,Civ_FF,~, errormsg] = civ (par_civ2); 857 859 Civ_X_shifted=Civ_X-0.5+Civ_U/2;% get the exact positions … … 878 880 Data.ListGlobalAttribute=[Data.ListGlobalAttribute Civ2_param]; 879 881 880 % nbvar=numel(Data.ListVarName);881 % define the Civ2 variable (if Civ2 data are not replaced from previous calculation)882 % if isempty(find(strcmp('Civ2_X',Data.ListVarName),1))883 % Data.ListVarName=[Data.ListVarName {'Civ2_X','Civ2_Y','Civ2_U','Civ2_V','Civ2_C','Civ2_FF'}];% cell array containing the names of the fields to record884 % Data.VarDimName=[Data.VarDimName {'nb_vec_2','nb_vec_2','nb_vec_2','nb_vec_2','nb_vec_2','nb_vec_2'}];885 % Data.VarAttribute{nbvar+1}.Role='coord_x';886 % Data.VarAttribute{nbvar+2}.Role='coord_y';887 % Data.VarAttribute{nbvar+3}.Role='vector_x';888 % Data.VarAttribute{nbvar+4}.Role='vector_y';889 % Data.VarAttribute{nbvar+5}.Role='ancillary';890 % Data.VarAttribute{nbvar+6}.Role='errorflag';891 % end892 882 disp('civ2 performed') 893 883 time_civ2=toc(tstart_civ2); … … 930 920 end 931 921 Data.ListGlobalAttribute=[Data.ListGlobalAttribute Patch2_param]; 932 933 % nbvar=length(Data.ListVarName);934 % Data.ListVarName=[Data.ListVarName {'Civ2_U_smooth','Civ2_V_smooth','Civ2_SubRange','Civ2_NbCentres','Civ2_Coord_tps','Civ2_U_tps','Civ2_V_tps'}];935 % Data.VarDimName=[Data.VarDimName {'nb_vec_2','nb_vec_2',{'nb_coord','nb_bounds','nb_subdomain_2'},{'nb_subdomain_2'},...936 % {'nb_tps_2','nb_coord','nb_subdomain_2'},{'nb_tps_2','nb_subdomain_2'},{'nb_tps_2','nb_subdomain_2'}}];937 938 % Data.VarAttribute{nbvar+1}.Role='vector_x';939 % Data.VarAttribute{nbvar+2}.Role='vector_y';940 % Data.VarAttribute{nbvar+5}.Role='coord_tps';941 % Data.VarAttribute{nbvar+6}.Role='vector_x';942 % Data.VarAttribute{nbvar+7}.Role='vector_y';943 922 944 923 if isempty(Civ_FF) -
trunk/src/uvmat.m
r1199 r1200 192 192 LowY=round(ScreenSize(4)/2-Height/2); % put at the middle height on the screen 193 193 set(hObject,'Position',[LeftX LowY Width Height]) 194 UvData.PosColorbar=[0.80 0.02 0.018 0.445];194 %UvData.PosColorbar=[0.80 0.02 0.018 0.445]; 195 195 AxeData.LimEditBox=1; %initialise AxeData 196 196 set(handles.PlotAxes,'UserData',AxeData) … … 221 221 %% EXPORT menu 222 222 export_menu={'as field in workspace';'in new figure';'on existing axis';'make movie';'more...'}; 223 %export_path=fullfile(path_uvmat,'export_fct');224 223 225 224 %% load the list of previously browsed files in menus Open, Open_1 and TransformName … … 264 263 set(handles.TransformPath,'String','') 265 264 set(handles.TransformPath,'UserData',[]) 266 export_menu=[export_menu;{'more...'}];%append the option more.. to the menu265 %export_menu=[export_menu;{'more...'}];%append the option more.. to the menu 267 266 268 267 %% case of an input argument for uvmat … … 295 294 UvData.Field.coord_x=[0.5 size(input,2)-0.5]; 296 295 UvData.Field.coord_y=[size(input,1)-0.5 0.5]; 297 %testinputfield=1;298 296 end 299 297 else 300 298 %% check the path and date of modification of all functions in uvmat 301 299 path_to_uvmat=which ('uvmat');% check the path detected for source file uvmat 302 [infomsg,date_str ,svn_info]=check_files;%check the path of the functions called by uvmat.m300 [infomsg,date_str]=check_files;%check the path of the functions called by uvmat.m 303 301 date_str=['last modification: ' date_str]; 304 302 if ishandle(handles.UVMAT_title) … … 357 355 %------------------------------------------------------------------------ 358 356 set(handles.uvmat,'Units','pixels') 359 size_ fig=get(handles.uvmat,'Position');360 ColumnWidth=max(150,0.18*size_ fig(3)); %width of the right side display column equal to 0.18 *uvmat_GUI, in the range between 150 px and 250 px357 size_uvmat=get(handles.uvmat,'Position'); 358 ColumnWidth=max(150,0.18*size_uvmat(3)); %width of the right side display column equal to 0.18 *uvmat_GUI, in the range between 150 px and 250 px 361 359 ColumnWidth=min(ColumnWidth,250); 362 363 %% position of panel InputFile 360 InputFilePanelHeight=80; 361 TextDisplayPanelHeight=100; 362 CheckTablePanelHeight=100; 363 CoordinatesPanelHeight=100; 364 ScalarPanelHeight=150; 365 Interval=2; 366 367 %% reset position of panel InputFile 364 368 set(handles.InputFile,'Units','pixels') 365 369 %pos_InputFile=get(handles.InputFile,'Position')% [lower x lower y width height] for text_display 366 pos_InputFile(1)= 0; % set frame InputFile to the left of uvmat GUI367 pos_InputFile(2)=size_ fig(4)-60; % set frame InputFile to the top of uvmat GUI368 pos_InputFile(3)=size_ fig(3); %width of the GUI uvmat369 pos_InputFile(4)= 60; %set the height of the panel to 60 px370 pos_InputFile(1)=Interval; % set frame InputFile to the left of uvmat GUI 371 pos_InputFile(2)=size_uvmat(4)-InputFilePanelHeight-Interval; % set frame InputFile to the top of uvmat GUI 372 pos_InputFile(3)=size_uvmat(3)-2*Interval; %width of the GUI uvmat 373 pos_InputFile(4)=InputFilePanelHeight; %set the height of the panel 370 374 set(handles.InputFile,'Position',pos_InputFile);% [lower x lower y width height] 371 375 … … 373 377 set(handles.text_display,'Units','pixels') 374 378 set(handles.TableDisplay,'Units','pixels') 375 pos_1 =get(handles.text_display,'Position');% [lower x lower y width height] for text_display376 pos_1( 3)=1.2*ColumnWidth;377 pos_1( 1)=size_fig(3)-pos_1(3); % set text display to the right of the fig378 pos_1( 2)=size_fig(4)-pos_InputFile(4)-pos_1(4); % set text display to the top of the fig379 pos_1(1)=size_uvmat(3)-ColumnWidth-Interval; 380 pos_1(2)=pos_InputFile(2)-TextDisplayPanelHeight-Interval; % set text display to the top of the fig 381 pos_1(3)=ColumnWidth; 382 pos_1(4)=TextDisplayPanelHeight; 379 383 set(handles.text_display,'Position',pos_1) 380 384 set(handles.TableDisplay,'Position',[pos_1(1) 10 pos_1(3) 5*pos_1(4)]) 381 % reset position of CheckTable 385 386 %% reset position of CheckTable 382 387 set(handles.CheckTable,'Units','pixels') 383 pos_CheckTable=get(handles.CheckTable,'Position');% [lower x lower y width height] for CheckHold 384 pos_CheckTable(1)=pos_1(1)-pos_CheckTable(3); % set 'CheckHold' to the right of the fig 385 pos_CheckTable(2)=pos_InputFile(2)-pos_CheckTable(4); % set 'CheckHold' to the lower edge of text display 388 pos_CheckTable(1)=size_uvmat(3)-ColumnWidth-Interval; % set 'CheckHold' to the right of the fig 389 pos_CheckTable(2)=pos_InputFile(2)-CheckTablePanelHeight-Interval; % set 'CheckHold' to the lower edge of text display 390 pos_CheckTable(3)=ColumnWidth; 391 pos_CheckTable(4)=CheckTablePanelHeight; 386 392 set(handles.CheckTable,'Position',pos_CheckTable) 387 388 %% reset position of CheckHold389 % pos_CheckHold=get(handles.CheckHold,'Position');% [lower x lower y width height] for CheckHold390 % pos_CheckHold(1)=size_fig(3)-pos_CheckHold(3); % set 'CheckHold' to the right of the fig391 % pos_CheckHold(2)=pos_1(2)-pos_CheckHold(4); % set 'CheckHold' to the lower edge of text display392 % set(handles.CheckHold,'Position',pos_CheckHold)393 393 394 394 %% reset position of Coordinates panel 395 395 set(handles.Coordinates,'Units','pixels') 396 %pos_2=get(handles.Coordinates,'Position')% [lower x lower y width height] for frame 'Coordinates' 397 pos_2(1)=size_fig(3)-ColumnWidth; % set 'Coordinates' to the right of the fig 398 pos_2(2)=pos_1(2)-80; % set 'Coordinates' to the lower edge of text display 396 pos_2(1)=size_uvmat(3)-ColumnWidth-Interval; % set 'Coordinates' to the right of the fig 397 pos_2(2)=pos_1(2)-CoordinatesPanelHeight-Interval; % set 'Coordinates' to the lower edge of text display 399 398 pos_2(3)=ColumnWidth; 400 pos_2(4)= 80;%keep height to 80 px399 pos_2(4)=CoordinatesPanelHeight;%keep height to 80 px 401 400 set(handles.Coordinates,'Position',pos_2) 402 401 403 402 %% reset position of Axes panel 404 403 set(handles.Axes,'Units','pixels') 405 %pos_3=get(handles.Axes,'Position')% [lower x lower y width height] for frame 'Coordinates' 406 pos_3(1)=size_fig(3)-ColumnWidth; % set 'Coordinates' to the right of the fig 407 pos_3(2)=pos_2(2)-140; 404 pos_3(1)=size_uvmat(3)-ColumnWidth-Interval; % set 'Coordinates' to the right of the fig 405 pos_3(2)=pos_2(2)-140-Interval; 408 406 pos_3(3)=ColumnWidth; 409 407 pos_3(4)=140;%keep height to 140 px … … 412 410 %% reset position of Scalar 413 411 set(handles.Scalar,'Units','pixels') 414 %pos_4=get(handles.Scalar,'Position') % [lower x lower y width height] for frame 'Scalar' 415 pos_4(1)=size_fig(3)-ColumnWidth; % set 'Scalar' to the right of the fig 412 pos_4(1)=size_uvmat(3)-ColumnWidth-Interval; % set 'Scalar' to the right of the fig 416 413 if strcmp(get(handles.Scalar,'Visible'),'on') 417 pos_4(2)=pos_3(2)- 140; % set 'Scalar' to the lower edge of frame 'Coordinates' if visible418 else 419 pos_4(2)=pos_3(2) ;% set 'Scalar' to the lower edge of frame 'text display' if unvisible414 pos_4(2)=pos_3(2)-ScalarPanelHeight-Interval; % set 'Scalar' to the lower edge of frame 'Coordinates' if visible 415 else 416 pos_4(2)=pos_3(2)-Interval;% set 'Scalar' to the lower edge of frame 'text display' if unvisible 420 417 end 421 418 pos_4(3)=ColumnWidth; 422 pos_4(4)= 140;419 pos_4(4)=ScalarPanelHeight; 423 420 set(handles.Scalar,'Position',pos_4) 424 421 425 422 %% reset position of Vectors 426 423 set(handles.Vectors,'Units','pixels') 427 %pos_5=get(handles.Vectors,'Position') 428 pos_5(1)=size_fig(3)-ColumnWidth; 424 pos_5(1)=size_uvmat(3)-ColumnWidth-Interval; 429 425 if strcmp(get(handles.Vectors,'visible'),'on') 430 pos_5(2)=pos_4(2)-240 ;431 else 432 pos_5(2)=pos_4(2) ;426 pos_5(2)=pos_4(2)-240-Interval; 427 else 428 pos_5(2)=pos_4(2)-Interval; 433 429 end 434 430 pos_5(3)=ColumnWidth; … … 437 433 438 434 %% reset position and scale of axis 439 pos(1)=0.2*size_ fig(3)+35;435 pos(1)=0.2*size_uvmat(3)+35; 440 436 pos(2)=50; 441 pos(3)=0.77*size_ fig(3)-1.2*ColumnWidth;442 pos(4)= size_fig(4)-100;437 pos(3)=0.77*size_uvmat(3)-1.2*ColumnWidth; 438 pos(4)=pos_InputFile(2)-50-Interval; 443 439 set(handles.PlotAxes,'Units','pixels') 444 440 set(handles.PlotAxes,'Position',pos) 445 set(handles.PlotAxes,'Units','normalized') 446 447 441 %set(handles.PlotAxes,'Units','normalized') 442 UvData=get(handles.uvmat,'UserData'); 443 UvData.PosColorbar([1 3])=[pos(1)+pos(3)+10 10]/size_uvmat(3); 444 UvData.PosColorbar([2 4])=[pos(2)+pos(3)/4 pos(3)/2]/size_uvmat(4); 445 set(handles.uvmat,'UserData',UvData) 446 447 %% reset position of Field Indices TODO 448 % set(handles.FieldIndices,'Units','pixels') 449 % pos_4(1)=size_uvmat(3)-ColumnWidth; % set 'Scalar' to the right of the fig 450 % if strcmp(get(handles.Scalar,'Visible'),'on') 451 % pos_4(2)=pos_3(2)-ScalarPanelHeight-Interval; % set 'Scalar' to the lower edge of frame 'Coordinates' if visible 452 % else 453 % pos_4(2)=pos_3(2)-Interval;% set 'Scalar' to the lower edge of frame 'text display' if unvisible 454 % end 455 % pos_4(3)=ColumnWidth; 456 % pos_4(4)=ScalarPanelHeight; 457 % set(handles.Scalar,'Position',pos_4) 448 458 449 459 %------------------------------------------------------------------------ … … 2119 2129 function MenuHelp_Callback(hObject, eventdata, handles) 2120 2130 % -------------------------------------------------------------------- 2121 web('https:// gricad-gitlab.univ-grenoble-alpes.fr/legi/soft/uvmat-doc/-/blob/master/help/README.md')2131 web('https://legi.gricad-pages.univ-grenoble-alpes.fr/soft/uvmat-doc/help') 2122 2132 2123 2133 … … 3015 3025 end 3016 3026 FileInfo=get_file_info(fileinput); 3017 if isfield(FileInfo,'MaskFile') %&& exist(FileInfo.MaskFile,'file')3027 if isfield(FileInfo,'MaskFile') % if a Mask has been documented in the input file (civ data) 3018 3028 Mask.MaskFile=FileInfo.MaskFile; 3019 3029 if isfield(FileInfo,'MaskNbSlice') 3020 3030 Mask.MaskNbSlice=FileInfo.MaskNbSlice; 3021 3031 end 3022 else 3032 else % look for an apporpriate mask with the browser 3023 3033 filemask= uigetfile_uvmat('pick a mask image file:',fileinput,'image'); 3024 3034 if ~isempty(filemask) 3025 3035 [FilePath,FileName,FileExt]=fileparts(filemask); 3026 [RootPath,SubDir,RootFile,i1_series, i2,j1,j2,NomType]=find_file_series(FilePath,[FileName FileExt]);3036 [RootPath,SubDir,RootFile,i1_series,~,~,~,NomType]=find_file_series(FilePath,[FileName FileExt]); 3027 3037 if strcmp(NomType,'_1') 3028 3038 Mask.MaskFile=fullfile(RootPath,SubDir,RootFile); 3029 3039 Mask.MaskExt=FileExt; 3030 3040 Mask.MaskNbSlice=i1_series(1,2,end); 3031 elseif ~strcmp(NomType,'*') 3041 elseif strcmp(NomType,'*') 3042 Mask.MaskFile=fullfile(RootPath,SubDir,RootFile); 3043 Mask.MaskExt=FileExt; 3044 else 3032 3045 msgbox_uvmat('ERROR','multilevel masks must be labeled with a single index as _1,_2,...'); 3033 3046 set(handles.CheckMask,'Value',0) … … 3036 3049 end 3037 3050 end 3038 % i1=str2double(get(handles.num_i1,'String'));3039 % filemask=FileInfo.MaskFile;3040 % if isfield(FileInfo,'MaskNbSlice')3041 % i1=str2double(get(handles.num_i1,'String'));3042 % MaskIndex=mod(i1,FileInfo.MaskNbSlice)3043 % filemask=[filemask '_' num2str(MaskIndex) FileInfo.MaskExt]3044 % % else3045 % % filemask= uigetfile_uvmat('pick a mask image file:',RootPath,'image');3046 % end3047 % if ~isempty(filemask)3048 % [MaskPath,FileName,FileExt]=fileparts(filemask);3049 % Mask.File=filemask;3050 % [~,~,~,i1_series,~,~,~,NomType]=find_file_series(MaskPath,[FileName FileExt]);3051 % Mask.NbSlice=[];%default3052 % Mask.VolumeScan=0;% TO UPDATE ***3053 % if strcmp(NomType,'_1')3054 % Mask.NbSlice=i1_series(1,2,end);3055 % set(handles.num_NbSlice,'String',num2str(Mask.NbSlice))3056 % elseif ~strcmp(NomType,'*')3057 % msgbox_uvmat('ERROR','multilevel masks must be labeled with a single index as _1,_2,...');3058 % return3059 % end3060 %set(hObject,'UserData',filemask);%store for future use3061 3051 set(handles.CheckMask,'UserData',Mask); 3062 3052 errormsg=update_mask(handles); … … 3083 3073 %------------------------------------------------------------------------ 3084 3074 errormsg=[];%default 3085 MaskName='';3075 %MaskName=''; 3086 3076 3087 3077 %% get the current mask name recorded in CheckMask/UserData, possibly indexed with file index … … 3089 3079 if isfield(MaskInfo,'MaskFile') 3090 3080 if isfield(MaskInfo,'MaskNbSlice')&& ~isempty(MaskInfo.MaskNbSlice) 3091 if isfield(MaskInfo,'VolumeScan') && MaskInfo.VolumeScan 3081 if isfield(MaskInfo,'VolumeScan') && MaskInfo.VolumeScanTransformMenu 3092 3082 MaskIndex_i=str2double(get(handles.num_j1,'String')); 3093 3083 else … … 3097 3087 else 3098 3088 MaskIndex_i=1; 3099 MaskName=MaskInfo.MaskFile;3089 MaskName=[MaskInfo.MaskFile MaskInfo.MaskExt]; 3100 3090 end 3101 3091 3102 3092 %% update mask image if the mask is new 3103 3093 UvData=get(handles.uvmat,'UserData'); 3104 TransformMenu=get(handles.TransformName,'String') 3094 TransformMenu=get(handles.TransformName,'String'); 3105 3095 TransformName= TransformMenu{get(handles.TransformName,'Value')}; 3106 3096 if ~ (isfield(UvData,'MaskName') && strcmp(UvData.MaskName,MaskName)&& isfield(UvData,'TransformName')&& strcmp(UvData.TransformName,TransformName))%check if the mask is new … … 3108 3098 UvData.TransformName=TransformName; %update the recorded name on UvData 3109 3099 set(handles.uvmat,'UserData',UvData); 3110 if exist(MaskName,'file')~=2 3100 if exist(MaskName,'file')~=2 % case file MaskName does not exist 3111 3101 if isfield(MaskInfo,'maskhandle')&& ishandle(Mask.maskhandle) 3112 3102 delete(MaskInfo.maskhandle) 3103 set(handles.CheckMask,'Value',0) 3113 3104 end 3114 3105 else … … 3322 3313 set(handles.CheckFixPair,'Value',0) 3323 3314 end 3324 %CheckFixPair=get(handles.CheckFixPair,'Value')||(isempty(num_i2)&& isempty(num_j2));3325 3315 3326 3316 % the pair num_i1-num_i2 or num_j1-num_j2 is imposed (check box CheckFixPair selected) … … 3427 3417 ref_j_1=ref_j; 3428 3418 end 3429 if numel(UvData.i1_series)==13419 if isscalar(UvData.i1_series) 3430 3420 UvData.i1_series{2}=UvData.i1_series{1}; 3431 3421 UvData.j1_series{2}=UvData.j1_series{1}; … … 3503 3493 NbField_j_cell=get(handles.MaxIndex_j,'String'); 3504 3494 NbField_j=str2double(NbField_j_cell{1}); 3505 [RootFile,FrameIndex]=index2filename(UvData.XmlData{1}.FileSeries,i1,j1,NbField_j);3495 RootFile=index2filename(UvData.XmlData{1}.FileSeries,i1,j1,NbField_j); 3506 3496 [~,RootFile]=fileparts(RootFile);%suppress the file extension 3507 3497 set(handles.RootFile,'String',RootFile) … … 4133 4123 check_x_name=find(strcmp(coord_x_name,UvData.Field.ListVarName)); 4134 4124 UvData.Field.VarAttribute{check_x_name}.Role='coord_x'; 4135 [ PlotType,PlotParamOut,haxes]=plot_field(UvData.Field,handles.PlotAxes,read_GUI(handles.uvmat));4125 [~,PlotParamOut]=plot_field(UvData.Field,handles.PlotAxes,read_GUI(handles.uvmat)); 4136 4126 UvData.PlotAxes=UvData.Field; %store data for further plot modifications 4137 4127 errormsg=fill_GUI(PlotParamOut,handles.uvmat); … … 4312 4302 else 4313 4303 [PlotType,PlotParamOut]=plot_field(ObjectData,haxes(imap),PlotParam{imap}); 4314 if ~isempty(regexp(PlotType,'^error' ))%exit in case of plotting error4315 if ~isempty(regexp(PlotType,'attempt to plot two vector fields' ))4304 if ~isempty(regexp(PlotType,'^error', 'once'))%exit in case of plotting error 4305 if ~isempty(regexp(PlotType,'attempt to plot two vector fields', 'once')) 4316 4306 set(handles.CheckEditObject,'Value',1) 4317 4307 CheckEditObject_Callback([], [], handles)% propose to edit the main projection plane … … 5654 5644 %------------------------------------------------------------------- 5655 5645 function num_Opacity_Callback(hObject, eventdata, handles) 5646 %------------------------------------------------------------------- 5656 5647 update_plot(handles); 5657 %-------------------------------------------------------------------5658 5648 5659 5649 %------------------------------------------------------------------- … … 5709 5699 %------------------------------------------------------------------------ 5710 5700 % --- Executes on selection change in CheckDecimate4 (nb_vec/4). 5711 %------------------------------------------------------------------------5712 5701 function CheckDecimate4_Callback(hObject, eventdata, handles) 5713 5702 %------------------------------------------------------------------------ 5714 5703 if isequal(get(handles.CheckDecimate4,'Value'),1) 5715 5704 set(handles.CheckDecimate16,'Value',0)
Note: See TracChangeset
for help on using the changeset viewer.
