Changeset 609 for trunk/src/uvmat.m
- Timestamp:
- Apr 9, 2013, 8:20:00 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r606 r609 32 32 % .OpenParam: structure containing parameters defined when uvmat is opened 33 33 % .PosColorbar: position (1x4 vector)of the colorbar (relative to the fig uvmat) 34 % .PosSetObject: position of set_object35 34 % .PosGeometryCalib: size of set_object 36 35 % .NbBuiltin: nbre of functions always displayed in TransformName menu … … 175 174 path_uvmat=fileparts(which('uvmat')); 176 175 177 %% set the position of colorbar and ancillary GUIs: 178 set(hObject,'Units','Normalized') 179 movegui(hObject,'center') 176 %% set the position of the GUI, colorbar and ancillary GUIs: 177 set(hObject,'Units','pixels')% 178 set(0,'Units','pixels'); 179 ScreenSize=get(0,'ScreenSize');%size of the current screen 180 Width=1050; 181 Height=700; 182 %adjust to screen size (reduced by a min margin) 183 RescaleFactor=min((ScreenSize(3)-80)/Width,(ScreenSize(4)-80)/Height); 184 if RescaleFactor>1 185 RescaleFactor=RescaleFactor/2+1/2; %reduce the rescale factor to provide an increased margin for a big screen 186 end 187 Width=Width*RescaleFactor; 188 Height=Height*RescaleFactor; 189 LeftX=80*RescaleFactor;%position of the left fig side, in pixels (put to the left side, with some margin) 190 LowY=round(ScreenSize(4)/2-Height/2); % put at the middle height on the screen 191 set(hObject,'Position',[LeftX LowY Width Height]) 192 193 %set(hObject,'Units','Normalized') 194 180 195 %UvData.OpenParam.PosColorbar=[0.8450 0.0900 0.0190 0.3600]; 181 196 UvData.OpenParam.PosColorbar=[0.805 0.022 0.019 0.445]; 182 UvData.OpenParam.PosSetObject=[-0.05 -0.03 0.3 0.7]; %position for set_object197 %UvData.OpenParam.PosSetObject=[-0.05 -0.03 0.3 0.7]; %position for set_object 183 198 UvData.OpenParam.PosGeometryCalib=[0.95 -0.03 0.28 1 ];%position for geometry_calib (TO IMPROVE) 184 199 % UvData.OpenParam.CalSize=[0.28 1]; … … 197 212 198 213 %% initialisation 199 % set(handles.ListObject,'Value',1)% default: empty projection objectproj_field200 % set(handles.ListObject,'String',{''})201 % set(handles.ListObject_1,'Value',1)% default: empty projection objectproj_field202 % set(handles.ListObject_1,'String',{''})203 214 set(handles.FieldName,'Value',1) 204 215 set(handles.FieldName,'string',{''}) … … 337 348 function MenuBrowse_Callback(hObject, eventdata, handles) 338 349 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles); 339 oldfile= fullfile(RootPath,SubDir);350 oldfile=[fullfile(RootPath,SubDir,RootFile) FileIndices FileExt]; 340 351 if isempty(oldfile) %loads the previously stored file name and set it as default in the file_input box 341 352 oldfile=get(handles.RootPath,'UserData'); 342 353 end 343 hfig=uigetfile_uvmat('file browser',fileparts(oldfile)); 344 uiwait(hfig); 345 if ishandle(hfig) % stop if browser closed without selection 346 fileinput=get(hfig,'UserData');% retrieve the input file selection 347 delete(hfig) 348 % display the selected field and related information 354 fileinput=uigetfile_uvmat('select an input file:',oldfile); 355 if ~isempty(fileinput) 349 356 display_file_name(handles,fileinput) 350 357 end 351 352 %353 %354 %355 % [FileName, PathName] = uigetfile({'*.*','All Files(*.*)'},'Pick a file',oldfile);356 % if ~ischar(FileName),return,end %abandon if the browser is cancelled357 % fileinput=[PathName FileName];%complete file name358 358 359 359 %% display the selected field and related information … … 435 435 %------------------------------------------------------------------------ 436 436 RootPath=get(handles.RootPath,'String'); 437 [FileName, PathName] = uigetfile({'*.*','All Files(*.*)'},'Pick a file',RootPath); 438 if ~ischar(FileName),return,end %abandon if the browser is cancelled 439 fileinput_1=[PathName FileName];%complete file name 440 441 % refresh the current displayed field 442 set(handles.SubField,'Value',1) 443 display_file_name(handles,fileinput_1,2) 444 445 %update list of recent files in the menubar 446 MenuFile_1=fileinput_1; 447 MenuFile_2=get(handles.MenuFile_1,'Label'); 448 MenuFile_3=get(handles.MenuFile_2,'Label'); 449 MenuFile_4=get(handles.MenuFile_3,'Label'); 450 MenuFile_5=get(handles.MenuFile_4,'Label'); 451 set(handles.MenuFile_1,'Label',MenuFile_1) 452 set(handles.MenuFile_2,'Label',MenuFile_2) 453 set(handles.MenuFile_3,'Label',MenuFile_3) 454 set(handles.MenuFile_4,'Label',MenuFile_4) 455 set(handles.MenuFile_5,'Label',MenuFile_5) 456 set(handles.MenuFile_1_1,'Label',MenuFile_1) 457 set(handles.MenuFile_2_1,'Label',MenuFile_2) 458 set(handles.MenuFile_3_1,'Label',MenuFile_3) 459 set(handles.MenuFile_4_1,'Label',MenuFile_4) 460 set(handles.MenuFile_5_1,'Label',MenuFile_5) 461 % dir_perso=prefdir; 462 % profil_perso=fullfile(dir_perso,'uvmat_perso.mat'); 463 % if exist(profil_perso,'file') 464 % save (profil_perso,'MenuFile_1','MenuFile_2','MenuFile_3','MenuFile_4', 'MenuFile_5','-append'); %store the file names for future opening of uvmat 465 % else 466 % txt=ver('MATLAB'); 467 % Release=txt.Release; 468 % relnumb=str2double(Release(3:4)); 469 % if relnumb >= 14 470 % save (profil_perso,'MenuFile_1','MenuFile_2','MenuFile_3','MenuFile_4', 'MenuFile_5','-V6'); %store the file names for future opening of uvmat 471 % else 472 % save (profil_perso,'MenuFile_1','MenuFile_2','MenuFile_3','MenuFile_4', 'MenuFile_5'); %store the file names for future opening of uvmat 473 % end 474 % end 437 SubDir=get(handles.SubDir,'String'); 438 fileinput_1=uigetfile_uvmat('select a second input file:',fullfile(RootPath,SubDir)); 439 if ~isempty(fileinput_1) 440 % [FileName, PathName] = uigetfile({'*.*','All Files(*.*)'},'Pick a file',RootPath); 441 % if ~ischar(FileName),return,end %abandon if the browser is cancelled 442 % fileinput_1=[PathName FileName];%complete file name 443 444 % refresh the current displayed field 445 set(handles.SubField,'Value',1) 446 display_file_name(handles,fileinput_1,2) 447 448 %update list of recent files in the menubar 449 MenuFile_1=fileinput_1; 450 MenuFile_2=get(handles.MenuFile_1,'Label'); 451 MenuFile_3=get(handles.MenuFile_2,'Label'); 452 MenuFile_4=get(handles.MenuFile_3,'Label'); 453 MenuFile_5=get(handles.MenuFile_4,'Label'); 454 set(handles.MenuFile_1,'Label',MenuFile_1) 455 set(handles.MenuFile_2,'Label',MenuFile_2) 456 set(handles.MenuFile_3,'Label',MenuFile_3) 457 set(handles.MenuFile_4,'Label',MenuFile_4) 458 set(handles.MenuFile_5,'Label',MenuFile_5) 459 set(handles.MenuFile_1_1,'Label',MenuFile_1) 460 set(handles.MenuFile_2_1,'Label',MenuFile_2) 461 set(handles.MenuFile_3_1,'Label',MenuFile_3) 462 set(handles.MenuFile_4_1,'Label',MenuFile_4) 463 set(handles.MenuFile_5_1,'Label',MenuFile_5) 464 end 475 465 476 466 % -------------------------------------------------------------------- … … 2003 1993 num_j1=stra2num(get(handles.j1,'String')); 2004 1994 num_j2=stra2num(get(handles.j2,'String')); 2005 [tild,tild,tild,i1_1,i2_1,j1_1,j2_1]=fileparts_uvmat(FileIndex_1); 1995 [tild,tild,tild,i1_1,i2_1,j1_1,j2_1]=fileparts_uvmat(FileIndex_1);% get the indices of the second series from the string FileIndex_1 1996 if isempty(j1_1)% case of movies, the index is not given by file index 1997 j1_1=num_j1; 1998 end 2006 1999 2007 2000 errormsg=refresh_field(handles,filename,filename_1,num_i1,num_i2,num_j1,num_j2,i1_1,i2_1,j1_1,j2_1); … … 2204 2197 end 2205 2198 case 'multimage' 2206 if ~strcmp(NomType_1,'*')2207 frame_index_1= j1_1;%frame index for movies or multimage2199 if strcmp(NomType_1,'*')%frame index for movies or multimage 2200 frame_index_1=i1_1; 2208 2201 else 2209 frame_index_1= i1_1;2202 frame_index_1=j1_1; 2210 2203 end 2211 2204 case 'vol' %TODO: update … … 3509 3502 [hset_object,UvData.sethandles]=set_object(data,PlotHandles);% call the set_object interface with action on haxes, 3510 3503 % associate the set_object interface handle to the plotting axes 3511 set(hset_object,'Position',get(handles.uvmat,'Position')+UvData.OpenParam.PosSetObject)3504 %set(hset_object,'Position',get(handles.uvmat,'Position')+UvData.OpenParam.PosSetObject) 3512 3505 UvData.MouseAction='create_object'; 3513 3506 else … … 4402 4395 [PlotType,PlotParam]=plot_field(ProjData,hhview_field.PlotAxes,read_GUI(hview_field));%read plotting parameters on the GUI view_field); 4403 4396 errormsg=fill_GUI(PlotParam,hview_field); 4404 4405 if ~isfield(PlotParamOut,list{1})4406 4407 4408 4397 for list={'Scalar','Vectors'} 4398 if ~isfield(PlotParam,list{1}) 4399 set(hhview_field.(list{1}),'Visible','off') 4400 end 4401 end 4409 4402 %write_plot_param(hhview_field,PlotParam); %update the display of plotting parameters for the current object 4410 4403 haxes=findobj(hview_field,'tag','axes3');
Note: See TracChangeset
for help on using the changeset viewer.