Changeset 671 for trunk/src/uvmat.m


Ignore:
Timestamp:
Jul 31, 2013, 11:11:55 PM (11 years ago)
Author:
sommeria
Message:

geometry_calib corrected for translation and rotation + cleaning

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uvmat.m

    r669 r671  
    227227
    228228%% load the list of previously browsed files in menus Open, Open_1 and TransformName
    229  dir_perso=prefdir; % path to the directory .matlab containing the personal data of the current user
    230  profil_perso=fullfile(dir_perso,'uvmat_perso.mat');% personal data file uvmat_perso.mat' in .matlab
    231  if exist(profil_perso,'file')% if the file exists
    232      h=load (profil_perso); % open the personal file
    233      if isfield(h,'MenuFile')% load the saved menu of previously opened files
    234          for ifile=1:min(length(h.MenuFile),5)
    235              set(handles.(['MenuFile_' num2str(ifile)]),'Label',h.MenuFile{ifile});
    236          end
    237      end
    238      if isfield(h,'MenuCampaign')% load the saved menu of previously opened campaigns
    239          for ifile=1:min(length(h.MenuCampaign),5)
    240              set(handles.(['MenuCampaign_' num2str(ifile)]),'Label',h.MenuCampaign{ifile});
    241          end
    242      end
    243      if isfield(h,'RootPath')
    244          set(handles.RootPath,'UserData',h.RootPath); %store the previous campaign in the UserData of RootPath
    245      end
    246      if isfield(h,'transform_fct') && iscell(h.transform_fct) % load the menu of transform fct set by user
    247          for ilist=1:length(h.transform_fct);
    248              if exist(h.transform_fct{ilist},'file')
    249                  [path,file]=fileparts(h.transform_fct{ilist});
    250                  transform_menu=[transform_menu; {file}];
    251                  path_list=[path_list; {path}];
    252              end
    253          end
    254      end
    255  end
     229dir_perso=prefdir; % path to the directory .matlab containing the personal data of the current user
     230profil_perso=fullfile(dir_perso,'uvmat_perso.mat');% personal data file uvmat_perso.mat' in .matlab
     231if exist(profil_perso,'file')% if the file exists
     232    h=load (profil_perso); % open the personal file
     233    if isfield(h,'MenuFile')% load the saved menu of previously opened files
     234        for ifile=1:min(length(h.MenuFile),5)
     235            set(handles.(['MenuFile_' num2str(ifile)]),'Label',h.MenuFile{ifile});
     236        end
     237    end
     238    if isfield(h,'MenuCampaign')% load the saved menu of previously opened campaigns
     239        for ifile=1:min(length(h.MenuCampaign),5)
     240            set(handles.(['MenuCampaign_' num2str(ifile)]),'Label',h.MenuCampaign{ifile});
     241        end
     242    end
     243    if isfield(h,'RootPath')
     244        set(handles.RootPath,'UserData',h.RootPath); %store the previous campaign in the UserData of RootPath
     245    end
     246    if isfield(h,'transform_fct') && iscell(h.transform_fct) % load the menu of transform fct set by user
     247        for ilist=1:length(h.transform_fct);
     248            if exist(h.transform_fct{ilist},'file')
     249                [path,file]=fileparts(h.transform_fct{ilist});
     250                transform_menu=[transform_menu; {file}];
     251                path_list=[path_list; {path}];
     252            end
     253        end
     254    end
     255end
    256256transform_menu=[transform_menu;{'more...'}];%append the option more.. to the menu
    257257set(handles.TransformName,'String',transform_menu)% display the menu of transform fcts
     
    35353535%------------------------------------------------------------------------
    35363536UvData=get(handles.uvmat,'UserData');
    3537 menu=get(handles.TransformName,'String');refresh
     3537menu=get(handles.TransformName,'String');%refresh
    35383538ichoice=get(handles.TransformName,'Value');%item number in the menu
    35393539transform_name=menu{ichoice};% choice of the transform fct
     
    35463546end
    35473547if strcmp(transform_name,'more...');
    3548     transform_fct=uigetfile_uvmat('Pick the transform function',prev_path,'.m');
    3549     %     [FileName, PathName] = uigetfile( ...
    3550     %         {'*.m', ' (*.m)';
    3551     %         '*.m',  '.m files '; ...
    3552     %         '*.*', 'All Files (*.*)'}, ...
    3553     %         'Pick the transform function', prev_path);
    3554     %     if ~ischar(FileName),return,end %abandon if the browser is cancelled
    3555     %     path_transform_fct =fullfile(PathName,FileName);
    3556     if ~isempty(transform_fct)
    3557         [PathName,transform_name]=fileparts(transform_fct);
    3558         %     if isempty(regexp(FileName,'\.m$'))% detect file extension .m
    3559         %         msgbox_uvmat('ERROR','a Matlab function .m must be introduced');
    3560         %         return
    3561         %     else
    3562         %         transform_name=regexprep(FileName,'\.m','');
    3563         %     end
     3548    transform_fct_chosen=uigetfile_uvmat('Pick the transform function',prev_path,'.m');
     3549    if ~isempty(transform_fct_chosen)
     3550        [PathName,transform_name]=fileparts(transform_fct_chosen);
    35643551        ichoice=find(strcmp(transform_name,menu),1);%look for the selected fct in the existing menu
    35653552        if isempty(ichoice)% if the item is not found, add it to the menu (before 'more...' and select it)
     
    35873574
    35883575%% create the function handle of the selected fct
    3589 
    35903576if isempty(list_path{ichoice})% case of no selected fct
    35913577    transform_handle=[];
Note: See TracChangeset for help on using the changeset viewer.