Changeset 1200 for trunk/src/uvmat.m
- Timestamp:
- Mar 20, 2026, 4:42:36 PM (22 hours ago)
- File:
-
- 1 edited
-
trunk/src/uvmat.m (modified) (22 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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.
