- Timestamp:
- Jul 31, 2012, 6:55:39 PM (12 years ago)
- Location:
- trunk/src
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/check_field_structure.m
r406 r508 28 28 nbfield=numel(Data.ListVarName); 29 29 else 30 errormsg='input field does not contain the cell array of variable names .ListVarName s';30 errormsg='input field does not contain the cell array of variable names .ListVarName'; 31 31 return 32 32 end -
trunk/src/datatree_browser.m
r507 r508 80 80 set(handles.UpdateLink,'String','create_link') 81 81 set(handles.MarkupDir,'Visible','on') 82 82 83 83 else% opening by uvmat/Open 84 84 InputDir=regexprep(InputName,'.xml$',''); … … 94 94 set(handles.MarkupDir,'String','CreateLink') 95 95 end 96 end 97 FillExperiments(handles) 98 set(handles.OK,'Visible','on') 99 drawnow 100 96 end 101 97 end 98 FillExperiments(handles) 99 set(handles.OK,'Visible','on') 100 drawnow 102 101 end 103 102 … … 196 195 MirrorPath=''; 197 196 if strcmp(get(handles.LinkDir,'Visible'),'on') 198 MirrorPath=get(handles.LinkDir,'String');197 MirrorPath=get(handles.LinkDir,'String'); 199 198 end 200 199 ListExperiments=get(handles.ListExperiments,'String'); 201 200 if isequal(get(handles.ListExperiments,'Value'),1) 202 ListExperiments=ListExperiments(2:end); %choose all experiments 201 ListExperiments=ListExperiments(2:end); %choose all experiments if the first line '*' has been selected 203 202 else 204 203 ListExperiments=ListExperiments(get(handles.ListExperiments,'Value')); … … 206 205 ListDevices={}; 207 206 207 %% loop on the list of selected experiments 208 208 for iexp=1:numel(ListExperiments) 209 hdir=dir(fullfile(SourcePath,ListExperiments{iexp})); %list files and dirs 209 210 % update the directory of the sources and update the links in the case of a link dir 211 hdir=dir(fullfile(SourcePath,ListExperiments{iexp})); %list files and folders in the source 210 212 for ilist=1:length(hdir) 211 213 Device=hdir(ilist).name; … … 213 215 if ~isempty(MirrorPath)% we list the links to the data directories of files 214 216 link=fullfile(MirrorPath,ListExperiments{iexp},Device); 215 if ~exist(link) 217 if ~exist(link)% create a link if it does not exist 216 218 source=fullfile(SourcePath,ListExperiments{iexp},Device); 217 219 system(['ln -s ' source ' ' link])%TODO translate for DOS … … 228 230 end 229 231 end 230 end 232 233 % check for dir and files in the link dir which do not exist in the source dir 234 if ~isempty(MirrorPath) 235 hdir=dir(fullfile(MirrorPath,ListExperiments{iexp})); %list files and folders in the link dir 236 for ilist=1:length(hdir) 237 Device=hdir(ilist).name; 238 if ~isequal(Device(1),'.') 239 if hdir(ilist).isdir 240 Device=[Device '/']; 241 end 242 check_list=strcmp(Device,ListDevices) | strcmp(['@' Device],ListDevices); 243 if isempty(find(check_list)) 244 ListDevices=[ListDevices;Device]; 245 end 246 end 247 end 248 end 249 end 250 251 %% display the updated list, keeping track of the previously selected item 252 PreviousList=get(handles.ListDevices,'String'); 253 NewValue=[]; 254 if ~isempty(PreviousList)&&iscell(PreviousList) 255 PreviousDevice=PreviousList{get(handles.ListDevices,'Value')}; 256 NewValue=find(strcmp(PreviousDevice,ListDevices)); 257 end 258 if isempty(NewValue) 259 NewValue=1; 260 end 261 set(handles.ListDevices,'Value',NewValue) 231 262 set(handles.ListDevices,'String',ListDevices) 232 263 … … 237 268 %------------------------------------------------------------------------ 238 269 list_val=get(handles.ListExperiments,'Value'); 239 if numel(list_val)~=1240 msgbox_uvmat('ERROR','select a single experiment ')270 if isequal(list_val,1) || numel(list_val)~=1 271 msgbox_uvmat('ERROR','select a single experiment in the column ''Experiments''') 241 272 return 242 273 end … … 253 284 Device=ListDevices{get(handles.ListDevices,'Value')}; 254 285 Device=regexprep(Device,'^@',''); 286 287 %% open the selected file 288 % case of a directory, open a file inside 255 289 if strcmp(Device(end),'/') 256 290 DataDir=fullfile(RootPath,Experiment,Device(1:end-1)); 257 291 DirList=dir(DataDir); 258 292 for ilist=1:numel(DirList) 259 [tild,tild,FileExt]=fileparts(DirList(ilist).name); 260 FileExt=regexprep(FileExt,'^.',''); 261 if ~isempty(FileExt) && (~isempty(imformats(FileExt))||strcmp(lower(FileExt),'avi')||strcmp(lower(FileExt),'nc')) 262 uvmat(fullfile(DataDir,DirList(ilist).name)) 263 return 293 if ~DirList(ilist).isdir 294 [tild,tild,FileExt]=fileparts(DirList(ilist).name); 295 FileExt=regexprep(FileExt,'^.',''); 296 if ~isempty(FileExt) && (~isempty(imformats(FileExt))||strcmp(lower(FileExt),'avi')||strcmp(lower(FileExt),'nc')) 297 uvmat(fullfile(DataDir,DirList(ilist).name)) 298 return 299 end 264 300 end 265 301 end 266 end 267 % 268 % set(handles.ListRecords,'Value',1) 269 % set(handles.ListXml,'Value',1) 270 % ListDevices=get(handles.ListDevices,'String'); 271 % list_val=get(handles.ListDevices,'Value'); 272 % if isequal(list_val,1) 273 % ListDevices=ListDevices(2:end); 274 % else 275 % ListDevices=ListDevices(list_val); 276 % end 277 % [ListDevices,ListRecords,ListXml]=ListDir(CurrentPath,ListExperiments,ListDevices,{}); 278 % set(handles.ListRecords,'String',[{'*'};ListRecords']) 279 % set(handles.ListXml,'String',[{'*'};ListXml']) 302 % open browser if no valid input file has been detected 303 [FileName, PathName] = uigetfile( ... 304 { '*.*', 'All Files (*.*)'}, ... 305 'Pick a mask file *.png',DataDir); 306 if ~isempty(FileName) 307 uvmat(fullfile(PathName,FileName)); 308 return 309 end 310 else %case of a file 311 uvmat(fullfile(RootPath,Experiment,Device)) 312 return 313 end 314 280 315 281 316 -
trunk/src/editxml.m
r248 r508 55 55 % set(handles.replicate,'String',['copy';'<---']) 56 56 if nargin 57 CurrentFile=varargin{1} 57 CurrentFile=varargin{1}; 58 58 else 59 59 CurrentFile=[]; … … 330 330 head_name=get(t,1,'name'); 331 331 %Path to shemas: 332 path_uvmat= which('editxml');% check the path detected for source file uvmat333 path_UVMAT=fileparts(path_uvmat); %path to UVMAT332 path_uvmat=fileparts(which('editxml'));% check the path detected for source file uvmat 333 % path_UVMAT=fileparts(path_uvmat); %path to UVMAT 334 334 % xmlparam=fullfile(path_UVMAT,'PARAM.xml'); 335 xmlparam='PARAM.xml'; %will find PARAM.xml whose path is set in priority336 if exist(xmlparam,'file')337 tparam=xmltree(xmlparam);338 sparam=convert(tparam);339 if isfield(sparam,'SchemaPath')340 schemafile=[fullfile(sparam.SchemaPath,head_name) '.xsd'];341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 end361 end335 % xmlparam='PARAM.xml'; %will find PARAM.xml whose path is set in priority 336 % if exist(xmlparam,'file') 337 % tparam=xmltree(xmlparam); 338 % sparam=convert(tparam); 339 % if isfield(sparam,'SchemaPath') 340 schemafile=[fullfile(path_uvmat,'xml_shemas',head_name) '.xsd']; 341 if ~exist(schemafile,'file') 342 schemafile=fullfile(path_UVMAT,schemafile);%look for relative path definition 343 end 344 if exist(schemafile,'file') 345 xs=xmltree(schemafile); 346 else 347 msgbox_uvmat('ERROR',['The needed xml schema ' sparam.SchemaPath ' is not found, check the file PARAM.xml']) 348 [FileName, PathName]=uigetfile( ... 349 {'*.xsd', '(*.xsd)'; 350 '*.xsd', '.xsd files '; ... 351 '*.*', 'All Files (*.*)'}, ... 352 'Pick a .xsd schema' ,schemafile); %file browser 353 if ischar(PathName) && ischar(FileName) && exist(fullfile(PathName,FileName),'file') 354 DataIn.Schema=fullfile(PathName,FileName); 355 xs=xmltree(DataIn.Schema);%open the associated schema file 356 else 357 xs=[]; 358 end 359 end 360 % end 361 % end 362 362 end 363 363 DataIn.CurrentUid=1; -
trunk/src/set_object.m
r491 r508 417 417 function PLOT_Callback(hObject, eventdata, handles) 418 418 419 set(handles.PLOT,'BackgroundColor',[1 1 0]) 420 drawnow 421 419 422 %% read the object parameters in the GUI set_object 420 423 ObjectData=read_GUI(handles.set_object);%read the parameters defining the object in the GUI set_object … … 482 485 PlotType='text'; 483 486 else 487 % create tps coeff if needed for ProjMode 'filter' 488 if strcmp(ObjectData.ProjMode,'filter')&&~isfield(UvData.Field,'Coord_tps') 489 UvData.Field=calc_tps(UvData.Field); 490 end 484 491 [ProjData,errormsg]= proj_field(UvData.Field,ObjectData);%project the current field of uvmat on ObjectData 485 492 if ~isempty(errormsg) 486 493 msgbox_uvmat('ERROR', errormsg) 494 set(handles.PLOT,'enable','on') 487 495 return 488 496 end … … 546 554 set(hhuvmat.edit_object,'BackgroundColor',[1 1 0]);% paint the edit text in yellow 547 555 set(hhuvmat.ViewField,'Value',1) 548 556 % set(handles.PLOT,'enable','on') 557 set(handles.PLOT,'BackgroundColor',[1 0 0]) 549 558 %------------------------------------------------------------------------ 550 559 % --- Executes on button press in MenuCoord. -
trunk/src/uvmat.m
r507 r508 232 232 233 233 %% refresh projection plane 234 set(handles.ListObject,'Value',1)% default: empty projection objectproj_field235 set(handles.ListObject,'String',{'plane'})236 set(handles.ListObject_1,'Value',1)% default: empty projection objectproj_field237 set(handles.ListObject_1,'String',{'plane'})234 % set(handles.ListObject,'Value',1)% default: empty projection objectproj_field 235 % set(handles.ListObject,'String',{''}) 236 % set(handles.ListObject_1,'Value',1)% default: empty projection objectproj_field 237 % set(handles.ListObject_1,'String',{''}) 238 238 set(handles.Fields,'Value',1) 239 239 set(handles.Fields,'string',{''}) … … 685 685 case 'xml' % edit xml files 686 686 t=xmltree(fileinput); 687 % the xml file marks a project or project link, open datatree_browser 687 688 if strcmp(get(t,1,'name'),'Project')&& exist(regexprep(fileinput,'.xml$',''),'dir') 688 689 datatree_browser(fileinput) 689 else 690 else % other xml file, open the xml editor 690 691 editxml(fileinput); 691 692 end 692 % if exist(regexprep(fileinput,'.project.xml$','.link'),'dir') 693 % datatree_browser(regexprep(fileinput,'.project.xml$','.link')) 694 % check_project=1; 695 % elseif exist(regexprep(fileinput,'.project.xml$',''),'dir') 696 % datatree_browser(regexprep(fileinput,'.project.xml$','')) 697 % check_project=1; 698 % end 699 % end 700 % if ~check_project 701 % editxml(fileinput); 702 case 'xls' 693 case 'xls'% Excel file opended by editxml 703 694 editxml(fileinput); 704 695 otherwise … … 833 824 return 834 825 end 835 % nbfield=[];%default836 % nbfield_j=[];%default837 826 838 827 %% read timing and total frame number from the current file (movie files) !! may be overrid by xml file … … 849 838 imainfo=get(VideoObject); 850 839 testima=1; 851 % nbfield_j=1;852 840 TimeUnit='s'; 853 841 if isempty(j1_series); %frame index along i … … 987 975 set(handles.transform_fct,'Value',2); % phys transform by default if fixedLimits is off 988 976 end 989 if isfield(GeometryCalib,'SliceCoord') 990 977 if isfield(GeometryCalib,'SliceCoord') 991 978 siz=size(GeometryCalib.SliceCoord); 992 979 if siz(1)>1 … … 1099 1086 end 1100 1087 1101 %% view the field 1102 run0_Callback([],[], handles); %view field 1088 %% apply the effect of the transform fct and view the field 1089 transform_fct_Callback([],[],handles) 1090 %run0_Callback([],[], handles); %view field 1103 1091 mask_test=get(handles.CheckMask,'value'); 1104 1092 if mask_test … … 1935 1923 1936 1924 %% determine the main input file information for action 1937 FileType=[];%default1925 % UvData.FileType{1}=[];%default 1938 1926 if ~exist(FileName,'file') 1939 1927 errormsg=['input file ' FileName ' does not exist']; … … 1945 1933 NomType_1=get(handles.NomType_1,'String'); 1946 1934 end 1947 % NomType=get(handles.FileIndex,'UserData');1948 1935 %update the z position index 1949 1936 nbslice_str=get(handles.num_NbSlice,'String'); … … 1972 1959 case {'civx','civdata','netcdf'}; 1973 1960 list_fields=get(handles.Fields,'String');% list menu fields 1974 % index_fields=get(handles.Fields,'Value');% selected string index1975 1961 FieldName= list_fields{get(handles.Fields,'Value')}; % selected field 1976 1962 if ~strcmp(FieldName,'get_field...') … … 2282 2268 set(handles.abs_time,'String',num2str(abstime,5)) 2283 2269 set(handles.abs_time_1,'String',num2str(abstime_1,5)) 2284 % if testimedoc && isfield(UvData,'dt')2285 % dt=UvData.dt;2286 % end2287 2270 if isempty(dt)||isequal(dt,0) 2288 2271 set(handles.Dt_txt,'String','') … … 2327 2310 end 2328 2311 end 2329 %% check whether tps is needed, then calculate tps coefficients if needed 2312 2313 %% check whether tps is needed, then calculate tps coefficients if needed 2330 2314 check_proj_tps=0; 2331 2315 if isfield(UvData,'Object')&& (strcmp(UvData.FileType{1},'civdata')||strcmp(UvData.FileType{1},'civx')) … … 2339 2323 check_tps=0; 2340 2324 if strcmp(UvData.FileType{1},'civdata')&&~strcmp(ParamOut.FieldName,'velocity')&&~strcmp(ParamOut.FieldName,'get_field...') 2341 check_tps=1; 2325 check_tps=1;%tps needed to get the requested field 2342 2326 end 2343 2327 if (check_tps ||check_proj_tps)&&~isfield(Field{1},'Coord_tps') 2344 SubDomain=1000; %default, estimated nbre of vectors in a subdomain used for tps 2345 if isfield(Field{1},'SubDomain') 2346 SubDomain=Field{1}.SubDomain;% 2347 end 2348 [Field{1}.SubRange,Field{1}.NbSites,Field{1}.Coord_tps,Field{1}.U_tps,Field{1}.V_tps,tild,U_smooth,V_smooth,W_smooth,FF] =... 2349 filter_tps([Field{1}.X(Field{1}.FF==0) Field{1}.Y(Field{1}.FF==0)],Field{1}.U(Field{1}.FF==0),Field{1}.V(Field{1}.FF==0),[],SubDomain,0); 2350 nbvar=numel(Field{1}.ListVarName); 2351 Field{1}.ListVarName=[Field{1}.ListVarName {'SubRange','NbSites','Coord_tps','U_tps','V_tps'}]; 2352 Field{1}.VarDimName=[Field{1}.VarDimName {{'nb_coord','nb_bounds','nb_subdomain'},{'nb_subdomain'},... 2353 {'nb_tps','nb_coord','nb_subdomain'},{'nb_tps','nb_subdomain'},{'nb_tps','nb_subdomain'}}]; 2354 Field{1}.VarAttribute{nbvar+3}.Role='coord_tps'; 2355 Field{1}.VarAttribute{nbvar+4}.Role='vector_x_tps'; 2356 Field{1}.VarAttribute{nbvar+5}.Role='vector_y_tps'; 2357 if isfield(Field{1},'ListDimName')%cleaning 2358 Field{1}=rmfield(Field{1},'ListDimName'); 2359 end 2360 if isfield(Field{1},'DimValue')%cleaning 2361 Field{1}=rmfield(Field{1},'DimValue'); 2362 end 2363 end 2328 Field{1}=calc_tps(Field{1}); 2329 end 2330 Field{1}.FieldList=[{ParamOut.FieldName} {ParamOut.ColorVar}]; 2364 2331 2365 2332 %% calculate scalar 2366 2333 if isstruct(ParamOut)&&~strcmp(ParamOut.FieldName,'get_field...')&& (strcmp(UvData.FileType{1},'civdata')||strcmp(UvData.FileType{1},'civx'))... 2367 2334 &&~strcmp(ParamOut.FieldName,'velocity') && ~strcmp(ParamOut.FieldName,'get_field...') 2368 if check_proj_tps 2369 Field{1}.FieldList=[{ParamOut.FieldName} {ParamOut.ColorVar}]; 2370 else 2335 if ~check_proj_tps 2371 2336 Field{1}=calc_field([{ParamOut.FieldName} {ParamOut.ColorVar}],Field{1}); 2372 2337 end … … 2382 2347 2383 2348 %% combine the two input fields (e.g. substract velocity fields) 2384 %Field{1}.FieldList=[{ParamOut.FieldName} {ParamOut.ColorVar}];2385 2349 if numel(Field)==2 2386 2350 [UvData.Field,errormsg]=sub_field(Field{1},Field{2}); … … 2511 2475 end 2512 2476 % default projection plane 2513 if ~isfield(UvData,'Object') 2477 if ~isfield(UvData,'Object')||isempty(UvData.Object{1}) 2514 2478 UvData.Object{1}.Type='plane';%main plotting plane 2515 2479 UvData.Object{1}.ProjMode='projection';%main plotting plane … … 2576 2540 [PlotType,PlotParamOut]=plot_field(UvData.Field,handles.axes3,read_GUI(handles.uvmat)); 2577 2541 write_plot_param(handles,PlotParamOut) %update the auto plot parameters 2578 % if isfield(Field,'Mesh')&&~isempty(Field.Mesh)2579 % ObjectData.Mesh=Field.Mesh; % gives an estimated mesh size (useful for mouse action on the plot)2580 % end2581 2542 2582 2543 %% 2D or 3D fields are generally projected … … 2590 2551 list_object=get(handles.ListObject_1,'String'); 2591 2552 if isequal(list_object,{''})%refresh list of objects if the menu is empty 2592 UvData.Object={[]}; 2553 set(handles.ListObject,'Value',1) 2554 set(handles.ListObject,'String',{'plane'}) 2555 UvData.Object{1}.Type='plane';%main plotting plane 2556 UvData.Object{1}.ProjMode='projection';%main plotting plane 2557 UvData.Object{1}.DisplayHandle.uvmat=[]; %plane not visible in uvmat 2558 UvData.Object{1}.DisplayHandle.view_field=[]; %plane not visible in uvmat 2593 2559 set(handles.ListObject_1,'Value',1) 2560 set(handles.ListObject_1,'String',{'plane'}) 2594 2561 end 2595 2562 IndexObj(1)=get(handles.ListObject_1,'Value');%selected projection object for main view … … 2636 2603 for imap=1:numel(IndexObj) 2637 2604 iobj=IndexObj(imap); 2638 % if imap==2 || check_proj==0 % field not yet projected) && ~isfield(UvData.Object{iobj},'Type')% case with no projection (only for the first empty object)2639 % % [ObjectData,errormsg]=calc_field(UvData.Field.FieldList,UvData.Field);2640 % % else2641 2605 [ObjectData,errormsg]=proj_field(UvData.Field,UvData.Object{iobj});% project field on the object 2642 % end2643 2606 if ~isempty(errormsg) 2644 2607 return … … 2706 2669 end 2707 2670 end 2708 % if isequal(PlotType,'none')2709 % hget_field=findobj(allchild(0),'name','get_field');2710 % if isempty(hget_field)2711 % get_field(FileName)% the projected field cannot be automatically plotted: use get_field to specify the variablesdelete(hget_field)2712 % end2713 % errormsg='The field defined by get_field cannot be plotted';2714 % return2715 % end2716 2671 end 2717 2672 end … … 3424 3379 else 3425 3380 set(handles.VOLUME,'BackgroundColor',[0 1 0]) 3426 UvData.MouseAction='none';3381 % UvData.MouseAction='none'; 3427 3382 end 3428 3383 set(handles.uvmat,'UserData',UvData) … … 3452 3407 set(handles.record,'Visible','off') 3453 3408 set(handles.edit_vect,'BackgroundColor',[0.7 0.7 0.7]) 3454 % UvData.MouseAction='none'; 3455 end 3456 % set(handles.uvmat,'UserData',UvData) 3409 end 3457 3410 3458 3411 %---------------------------------------------- … … 3546 3499 %------------------------------------------------------------- 3547 3500 % --- Executes on selection change in transform_fct. 3501 3548 3502 function transform_fct_Callback(hObject, eventdata, handles) 3549 3503 %------------------------------------------------------------- 3550 3504 UvData=get(handles.uvmat,'UserData'); 3551 menu=get(handles.transform_fct,'String'); 3505 menu=get(handles.transform_fct,'String');refresh 3552 3506 ichoice=get(handles.transform_fct,'Value');%item number in the menu 3553 3507 transform_name=menu{ichoice};% choice of the transform fct … … 3555 3509 3556 3510 %% add a new item to the menu if the option 'more...' has been selected 3511 prev_path=fullfile(get(handles.path_transform,'String')); 3512 if ~exist(prev_path,'dir') 3513 prev_path=fullfile(fileparts(which('uvmat')),'transform_field'); 3514 end 3557 3515 if strcmp(transform_name,'more...'); 3558 3516 [FileName, PathName] = uigetfile( ... … … 3560 3518 '*.m', '.m files '; ... 3561 3519 '*.*', 'All Files (*.*)'}, ... 3562 'Pick the transform function', get(handles.path_transform,'String'));3520 'Pick the transform function', prev_path); 3563 3521 path_transform_fct =fullfile(PathName,FileName); 3564 3522 if ~exist(path_transform_fct,'file')% cancel has been activated … … 3577 3535 end 3578 3536 list_path{ichoice}=PathName;%update the list fo fct paths 3537 set(handles.transform_fct,'String',menu) 3538 set(handles.transform_fct,'Value',ichoice) 3579 3539 3580 3540 % save the new menu in the personal file 'uvmat_perso.mat' … … 3584 3544 nb_builtin=UvData.OpenParam.NbBuiltin;% number of 'builtin' (basic) transform fcts in uvmat 3585 3545 for ilist=nb_builtin+1:numel(list_path) 3586 transform_fct{ilist-nb_builtin}= fullfile(list_path{ilist},menu{ilist});3546 transform_fct{ilist-nb_builtin}=[fullfile(list_path{ilist},menu{ilist}) '.m']; 3587 3547 end 3588 3548 save (profil_perso,'transform_fct','-append'); %store the root name for future opening of uvmat … … 3603 3563 cd(current_dir) 3604 3564 end 3565 set(handles.path_transform,'String',list_path{ichoice}) 3605 3566 set(handles.path_transform,'UserData',transform_handle) 3606 3567 … … 3618 3579 3619 3580 %% adapt the GUI to the input/output conditions of the selected transform fct 3620 if isempty(list_path{ichoice})% case of no selected fct 3621 DataOut=[]; 3622 else 3623 if nargin(transform_handle)>1 3624 if isfield(UvData,'XmlData')&&~isempty(UvData.XmlData) 3625 XmlData=UvData.XmlData{1}; 3626 DataOut=feval(transform_handle,'*',XmlData); 3627 end 3581 DataOut=[]; 3582 CoordUnit=''; 3583 CoordUnitPrev=''; 3584 if isfield(UvData,'Field')&&isfield(UvData.Field,'CoordUnit') 3585 CoordUnitPrev=UvData.Field.CoordUnit; 3586 end 3587 if ~isempty(list_path{ichoice}) 3588 if nargin(transform_handle)>1 && isfield(UvData,'XmlData')&&~isempty(UvData.XmlData) 3589 XmlData=UvData.XmlData{1}; 3590 DataOut=feval(transform_handle,'*',XmlData); 3591 if isfield(DataOut,'CoordUnit') 3592 CoordUnit=DataOut.CoordUnit; 3593 end 3594 if isfield(DataOut,'InputFieldType') 3595 UvData.InputFieldType=DataOut.InputFieldType; 3596 end 3597 else 3598 DataOut=feval(transform_handle,'*'); 3628 3599 end 3629 3600 end … … 3632 3603 set(handles.CheckFixLimits,'BackgroundColor',[0.7 0.7 0.7]) 3633 3604 3634 %% execute the function to set input an output conditions 3635 3636 3637 %% delete drawn objects 3638 hother=findobj('Tag','proj_object');%find all the proj objects 3639 for iobj=1:length(hother) 3640 delete_object(hother(iobj)) 3641 end 3642 hother=findobj('Tag','DeformPoint');%find all the proj objects 3643 for iobj=1:length(hother) 3644 delete_object(hother(iobj)) 3645 end 3646 hh=findobj('Tag','calib_points'); 3647 if ~isempty(hh) 3648 delete(hh) 3649 end 3650 hhh=findobj('Tag','calib_marker'); 3651 if ~isempty(hhh) 3652 delete(hhh) 3653 end 3654 if isfield(UvData,'Object') 3655 UvData.Object=UvData.Object(1); 3656 end 3657 set(handles.ListObject,'Value',1) 3658 set(handles.ListObject,'String',{'plane'}) 3659 set(handles.ListObject_1,'Value',1) 3660 set(handles.ListObject_1,'String',{'plane'}) 3661 3662 %delete mask if it is displayed 3663 % if isequal(get(handles.CheckMask,'Value'),1)%if the mask option is on 3664 % UvData=rmfield(UvData,'MaskName'); %will impose mask refresh 3665 % end 3605 %% delete drawn objects if the output CooordUnit is different from the previous one 3606 if ~strcmp(CoordUnit,CoordUnitPrev) 3607 hother=findobj('Tag','proj_object');%find all the proj objects 3608 for iobj=1:length(hother) 3609 delete_object(hother(iobj)) 3610 end 3611 hother=findobj('Tag','DeformPoint');%find all the proj objects 3612 for iobj=1:length(hother) 3613 delete_object(hother(iobj)) 3614 end 3615 hh=findobj('Tag','calib_points'); 3616 if ~isempty(hh) 3617 delete(hh) 3618 end 3619 hhh=findobj('Tag','calib_marker'); 3620 if ~isempty(hhh) 3621 delete(hhh) 3622 end 3623 % if isfield(UvData,'Object') 3624 % UvData.Object=UvData.Object(1); 3625 % end 3626 set(handles.ListObject,'Value',1) 3627 set(handles.ListObject,'String',{''}) 3628 set(handles.ListObject_1,'Value',1) 3629 set(handles.ListObject_1,'String',{''}) 3630 set(handles.ViewObject,'value',0) 3631 ViewObject_Callback(hObject, eventdata, handles) 3632 set(handles.ViewField,'value',0) 3633 ViewField_Callback(hObject, eventdata, handles) 3634 set(handles.edit_object,'Value',0) 3635 edit_object_Callback(hObject, eventdata, handles) 3636 UvData.Object={[]}; 3637 end 3666 3638 set(handles.uvmat,'UserData',UvData) 3639 3640 %% refresh the current plot 3667 3641 run0_Callback(hObject, eventdata, handles) 3668 3642 … … 4341 4315 colorbar 4342 4316 4343 % %------------------------------------------------------ 4344 % % --- Executes on button press in Menu/Export/extract figure. 4345 % %------------------------------------------------------ 4346 % function MenuExport_plot_Callback(hObject, eventdata, handles) 4347 % huvmat=get(handles.MenuExport_plot,'parent'); 4348 % UvData=get(huvmat,'UserData'); 4349 % hfig=figure; 4350 % newaxes=copyobj(handles.axes3,hfig); 4351 % map=colormap(handles.axes3); 4352 % colormap(map);%transmit the current colormap to the zoom fig 4353 % colorbar 4354 4355 % 4356 % % -------------------------------------------------------------------- 4357 % function Insert_Callback(hObject, eventdata, handles) 4358 % 4317 % -------------------------------------------------------------------- 4318 function MenuExportAxis_Callback(hObject, eventdata, handles) 4319 answer=msgbox_uvmat('CONFIRMATION','select a figure/axis on which the current uvmat plot will be exported') 4320 if strcmp(answer,'Yes') 4321 hchild=get(handles.axes3,'children'); 4322 copyobj(hchild,gca); 4323 end 4359 4324 4360 4325 %------------------------------------------------------------------------ … … 4879 4844 ProjectDir = uigetdir(fileparts(fileparts(RootPath)), 'select the project source directory'); 4880 4845 datatree_browser(ProjectDir) 4846 4847 4848
Note: See TracChangeset
for help on using the changeset viewer.