Changeset 38 for trunk/src


Ignore:
Timestamp:
Mar 7, 2010, 6:30:11 PM (15 years ago)
Author:
sommeria
Message:

field transforms put in subdir transform_field. cleaning of obsolete functions

Location:
trunk/src
Files:
12 deleted
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/RUN_STLIN.m

    r19 r38  
    2626 end
    2727 if isempty(npxA) ||isempty(npxB)
    28      warndlg_uvmat('The size of image A needs to be defined in the xml file ImaDoc','ERROR')
     28     msgbox_uvmat('ERROR','The size of image A needs to be defined in the xml file ImaDoc')
    2929     return
    3030 elseif isempty(npxB) || isempty(npyB)
    31       warndlg_uvmat('The size of image B needs to be defined in the xml file ImaDoc','ERROR')
     31      msgbox_uvmat('ERROR','The size of image B needs to be defined in the xml file ImaDoc')
    3232     return
    3333 end
     
    3535     tsaiA=XmlDataA.GeometryCalib;
    3636 else
    37      warndlg_uvmat('no geometric calibration available for image A','ERROR')
     37     msgbox_uvmat('ERROR','no geometric calibration available for image A')
    3838     return
    3939 end
     
    4141     tsaiB=XmlDataB.GeometryCalib;
    4242 else
    43      warndlg_uvmat('no geometric calibration available for image B','ERROR')
     43     msgbox_uvmat('ERROR','no geometric calibration available for image B')
    4444     return
    4545 end
     
    9898[Field,VelTypeOut]=read_civxdata(file_B,FieldNames,vel_type);
    9999if ~isequal(Field.dt,dt)
    100     warndlg_uvmat('different time intervals for the two velocity fields ','ERROR')
     100    msgbox_uvmat('ERROR','different time intervals for the two velocity fields ')
    101101     return
    102102end
    103103if ~isequal(Field.Time,time)
    104     warndlg_uvmat('different times for the two velocity fields ','ERROR')
     104    msgbox_uvmat('ERROR','different times for the two velocity fields ')
    105105     return
    106106end
     
    191191
    192192
    193 
    194 
    195 
    196 
    197 
    198 
    199 
    200 
    201 
    202 
     193%'pxcm_tsai': find differentials of the Tsai calibration
     194%
     195function [A11,A12,A13,A21,A22,A23]=pxcm_tsai(a,var_phys)
     196a_read=a;
     197
     198R=(a.R)';
     199
     200x=var_phys(:,1);
     201y=var_phys(:,2);
     202
     203if isfield(a,'PlanePos')
     204    prompt={'Plane 1 Index','Plane 2 Index'};
     205    Rep=inputdlg(prompt,'Target displacement test');
     206    Z1=str2double(Rep(1));
     207    Z2=str2double(Rep(2));
     208    z=(a.PlanePos(Z2,3)+a.PlanePos(Z1,3))/2
     209else
     210    z=0;
     211end
     212
     213%transform coeff for differentiels
     214a.C11=R(1)*R(8)-R(2)*R(7);
     215a.C12=R(2)*R(7)-R(1)*R(8);
     216a.C21=R(4)*R(8)-R(5)*R(7);
     217a.C22=R(5)*R(7)-R(4)*R(8);
     218a.C1x=R(3)*R(7)-R(9)*R(1);
     219a.C1y=R(3)*R(8)-R(9)*R(2);
     220a.C2x=R(6)*R(7)-R(9)*R(4);
     221a.C2y=R(6)*R(8)-R(9)*R(5);
     222
     223
     224%dependence in x,y
     225denom=(R(7)*x+R(8)*y+R(9)*z+a.Tz).*(R(7)*x+R(8)*y+R(9)*z+a.Tz);
     226A11=(a.f*a.sx*(a.C11*y-a.C1x*z+R(1)*a.Tz-R(7)*a.Tx)./denom)/a.dpx;
     227A12=(a.f*a.sx*(a.C12*x-a.C1y*z+R(2)*a.Tz-R(8)*a.Tx)./denom)/a.dpx;
     228A21=(a.f*a.sx*(a.C21*y-a.C2x*z+R(4)*a.Tz-R(7)*a.Ty)./denom)/a.dpy;
     229A22=(a.f*(a.C22*x-a.C2y*z+R(5)*a.Tz-R(8)*a.Ty)./denom)/a.dpy;
     230A13=(a.f*(a.C1x*x+a.C1y*y+R(3)*a.Tz-R(9)*a.Tx)./denom)/a.dpx;
     231A23=(a.f*(a.C2x*x+a.C2y*y+R(6)*a.Tz-R(9)*a.Ty)./denom)/a.dpy;
     232
     233%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     234%Old Version for z=0
     235%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     236% %'camera' coordinates
     237% xc=R(1)*x+R(2)*y+a.Tx;
     238% yc=R(4)*x+R(5)*y+a.Ty;
     239% zc=R(7)*x+R(8)*y+a.Tz;
     240% %undistorted image coordinates
     241% Xu=a.f*xc./zc;
     242% Yu=a.f*yc./zc;
     243% %distorted image coordinates
     244% distortion=(a.kappa1)*(Xu.*Xu+Yu.*Yu)+1; %!! intégrer derivation kappa
     245% % distortion=1;
     246% Xd=Xu./distortion;
     247% Yd=Yu./distortion;
     248% %pixel coordinates
     249% X=Xd*a.sx/a.dpx+a.Cx;
     250% Y=Yd/a.dpy+a.Cy;
     251%
     252% %transform coeff for differentiels
     253% a.C11=R(1)*R(8)-R(2)*R(7);
     254% a.C12=R(2)*R(7)-R(1)*R(8);
     255% a.C21=R(4)*R(8)-R(5)*R(7);
     256% a.C22=R(5)*R(7)-R(4)*R(8);
     257% a.C1x=R(3)*R(7)-R(9)*R(1);
     258% a.C1y=R(3)*R(8)-R(9)*R(2);
     259% a.C2x=R(6)*R(7)-R(9)*R(4);
     260% a.C2y=R(6)*R(8)-R(9)*R(5);
     261%
     262%
     263% %dependence in x,y
     264% denom=(R(7)*x+R(8)*y+a.Tz).*(R(7)*x+R(8)*y+a.Tz);
     265% A11=(a.f*a.sx*(a.C11*y+R(1)*a.Tz-R(7)*a.Tx)./denom)/a.dpx;
     266% A12=(a.f*a.sx*(a.C12*x+R(2)*a.Tz-R(8)*a.Tx)./denom)/a.dpx;
     267% A21=(a.f*a.sx*(a.C21*y+R(4)*a.Tz-R(7)*a.Ty)./denom)/a.dpy;
     268% A22=(a.f*(a.C22*x+R(5)*a.Tz-R(8)*a.Ty)./denom)/a.dpy;
     269% A13=(a.f*(a.C1x*x+a.C1y*y+R(3)*a.Tz-R(9)*a.Tx)./denom)/a.dpx;
     270% A23=(a.f*(a.C2x*x+a.C2y*y+R(6)*a.Tz-R(9)*a.Ty)./denom)/a.dpy;
     271%
     272
     273
     274
     275
     276
     277
     278
     279
     280
     281
  • trunk/src/check_field_structure.m

    r19 r38  
    1 %'check_field_structure': check the validity of the field struture representation consitant with the netcdf format
     1%'check_field_structure': check the validity of the field struture representation consistant with the netcdf format
    22%----------------------------------------------------------------------
    33% function [DataOut,errormsg]=check_field_structure(Data)
  • trunk/src/check_functions.m

    r19 r38  
    2828list_fct={'calc_field';...% defines fields (velocity, vort, div...) from civx data and calculate them 
    2929          'cell2tab';... %transform a Matlab cell in a character array suitable for display in a table
     30          'check_field_structure';...% check the validity of the field struture representation consistant with the netcdf format
    3031          'check_functions';... 
    3132          'civ';...   %function associated with the interface 'civ.fig' for PIV and spline interpolation
     
    3435          'civ_3D.fig';...
    3536          'close_fig';...% function  activated when a figure is closed
    36           'copyfields';...%copy fields between two matlab structures
    37           'delete_object';...%delete a projection object, defined by its index in the Uvmat list or by its graphic handle
     37          'copyfields';...% copy fields between two matlab structures
     38          'create_grid';...% called by the GUI geometry_calib to create a physical grid
     39          'create_grid.fig';...% GUI corresponding to create_grid.m
     40          'dataview';...% function for scanning directories in a campaign
     41          'delete_object';...%delete a projection object, defined by its index in the Uvmat list or by its graphic handle 
    3842          'editxml';...%display and edit xml files using a xls schema
    3943          'editxml.fig';...%interface for editxml
     
    5862          'nc2struct';...% transform a netcdf file in a corresponding matlab structure
    5963          'peaklock';...%
    60           'phys';...% transforms fields from image (px) to real world (phys) coordinates using geometric calibration parameters
    61           'phys_polar';... transform image coordinates (px) to physical ploar coordinates
    62           'phys_XYZ';...%transforms image (px) to real world (phys) coordinates using geometric calibration parameters
    63           'px';...% transform fields from physical to px coordinates using geometrical calibration parameters
    64           'px_XYZ';...% ransform physical to px coordinates using geometrical calibration parameters
    6564          'plot_field';...%displays a vector field and/or scalar or images
    6665          'plot_object';...%draws a projection object (points, line, plane...)
     
    8887           'update_obj';... update the object representation graph and its projection field, record it in the uvmat interface
    8988           'update_waitbar';... update the waitbar display, used for ACTION functions in the GUI 'series'
    90            'warndlg_uvmat';...% display messages (error, warning, confirmation) , OBSOLETE, use msgbox_uvmat
    9189            'write_plot_param'};%update plotting parameters after plot
    9290 dir_fct=which('uvmat');% path to uvmat
  • trunk/src/create_grid.m

    r37 r38  
    1 %'create_grid': associated with GUI create_grid.fig to display message boxes, for error, warning or input calls
    2 % create_grid(title,display)
     1%'create_grid': called by the GUI geometry_calib to create a physical grid
     2% coord=create_grid(input_grid)
    33%
    44% OUTPUT:
    5 % answer  (text string)= 'yes', 'No', 'cancel', or the text string introduced as input
     5% coord: matrix (nbpoint, 3) of coordinates for grid points, with columns x,y,z
    66%
    77%INPUT:
    8 % title: string indicating the type of message box:
    9 %          title= 'INPUT_TXT','CONFIMATION' ,'ERROR', 'WARNING', 'INPUT_Y-N', default = 'INPUT_TXT' (the title is displayed in the upper bar of the fig).
    10 %          if title='INPUT_TXT', input data is asked in an edit box
    11 %          if title='CONFIMATION'', 'ERROR', 'WARNING', the figure remains  opened until a button 'OK' is pressed
    12 %          if title='INPUT_Y-N', an answer Yes/No is requested
    13 % display, displayed text
    14 % default_answer: default answer in the edit box (only used with title='INPUT_TXT')
     8% input_grid (optional): structure to initiate the GUI with fields .x_0,.Dx,.x_1
     9% (defining x coordinates), .y_0,.Dy,.y_1 (defining y coordinates)
    1510
    1611function varargout = create_grid(varargin)
  • trunk/src/get_field.m

    r34 r38  
    543543    DimIndex_v(ind)=[];%Mremove singleton
    544544    if ~isequal(DimIndex_u,DimIndex_v)
    545         warndlg_uvmat('inconsistent dimensions for u and v','ERROR')
     545        msgbox_uvmat('ERROR','inconsistent dimensions for u and v')
    546546        set(handles.vector_y,'Value',1);
    547547        return
    548548    elseif  test_scalar & ~isequal(DimIndex_u,DimIndex)
    549          warndlg_uvmat('inconsistent dimensions for vector and scalar represented as vector color','ERROR')
     549         msgbox_uvmat('ERROR','inconsistent dimensions for vector and scalar represented as vector color')
    550550         set(handles.scalar,'Value',1);
    551551         return
     
    561561    nbdim=length(DimIndex);
    562562    if nbdim > 3
    563         warndlg_uvmat('array with more than three dimensions, not supported','ERROR')
     563        msgbox_uvmat('ERROR','array with more than three dimensions, not supported')
    564564        return
    565565    else
     
    590590                test_grid=1;
    591591            else
    592                 warndlg_uvmat('multiple dimensions for the z coordinate','ERROR')
     592                msgbox_uvmat('ERROR','multiple dimensions for the z coordinate')
    593593                return
    594594            end
     
    634634        end
    635635    elseif test_grid
    636         warndlg_uvmat('the dimension of the y coordinate variable should be 1','ERROR')   
     636        msgbox_uvmat('ERROR','the dimension of the y coordinate variable should be 1')   
    637637    end
    638638end
     
    677677        DimIndex=DimIndex(perm_ind);
    678678    elseif test_grid
    679         warndlg_uvmat('the dimension of the x coordinate variable should be 1','ERROR')   
     679        msgbox_uvmat('ERROR','the dimension of the x coordinate variable should be 1')   
    680680    end
    681681    if isequal(DimIndex_x,DimIndex)
     
    12821282    check_vector_Callback(hObject, eventdata, handles)
    12831283end
    1284 %
    1285 % % --- Executes on selection change in menu_coord.
    1286 % function menu_coord_Callback(hObject, eventdata, handles)
    1287 % hget_field=get(handles.menu_coord,'parent');
    1288 % menu=get(handles.menu_coord,'String');
    1289 % ind_coord=get(handles.menu_coord,'Value');
    1290 % coord_option=menu{ind_coord};
    1291 % if isequal(coord_option,'more...');
    1292 %     fct_name='';
    1293 %     if exist('./TMP/current_usr_fct.mat','file')% if a file is found
    1294 %         h=load('./TMP/current_usr_fct.mat');
    1295 %         if isfield(h,'fct_name');
    1296 %             fct_name=h.fct_name;
    1297 %         end
    1298 %     end
    1299 %     prompt = {'Enter the name of the transform function'};
    1300 %     dlg_title = 'user defined transform';
    1301 %     num_lines= 1;
    1302 %     [FileName, PathName, filterindex] = uigetfile( ...
    1303 %        {'*.m', ' (*.m)';
    1304 %         '*.m',  '.m files '; ...
    1305 %         '*.*', 'All Files (*.*)'}, ...
    1306 %         'Pick a file', fct_name);
    1307 %     fct_name=fullfile(PathName,FileName);
    1308 %     addpath(PathName);%add the path to the selected fct
    1309 %     [errormsg,date_str]=check_functions;%check whether new functions can oversed the uvmat package A UTILISER
    1310 %     if ~exist(fct_name,'file')
    1311 %            warndlg_uvmat(['image procesing fct ' fct_name ' not found'],'WARNING')
    1312 %     else
    1313 %         transform=FileName(1:end-2);%
    1314 %         menu=update_menu(handles.menu_coord,transform);%add the selected fct to the menu
    1315 % %         set(handles.mouse_coord,'String',menu([1:end-1])')%update the mouse coord menu
    1316 %       save ('./TMP/current_usr_fct.mat','fct_name');
    1317 %     end   
    1318 % end
    1319 
    1320 
    13211284
    13221285%-----------------------------------------------------
     
    13301293    name=get(hh(ifig),'Name');
    13311294     if ~isequal(name,'uvmat')%case of uvmat GUI
    1332 %         ilist=ilist+1;
    1333 %         list{ilist,1}='uvmat';
    1334 %     else        %other figures
    13351295        hchild=get(hh(ifig),'children');% look for axes contained in each figure
    13361296        nbaxe=0;
  • trunk/src/plot_object.m

    r19 r38  
    4949end
    5050if ~isfield(ObjectData,'Style')|isempty(ObjectData.Style)|~ischar(ObjectData.Style)
    51     warndlg_uvmat('undefined ObjectData.Style in plot_object.m','ERROR')
     51    msgbox_uvmat('ERROR','undefined ObjectData.Style in plot_object.m')
    5252    return
    5353end
    5454if ~isfield(ObjectData,'Style')|isempty(ObjectData.Style)|~ischar(ObjectData.Style)
    55     warndlg_uvmat('undefined ObjectData.Style in plot_object.m','ERROR')
     55    msgbox_uvmat('ERROR','undefined ObjectData.Style in plot_object.m')
    5656    return
    5757end
     
    377377        hh=rectangle('Curvature',[1 1],'Position',[ObjectData.Coord(1,1)-XMax ObjectData.Coord(1,2)-YMax 2*XMax 2*YMax],'EdgeColor',col);
    378378    else
    379         warndlg_uvmat('unknown ObjectData.Style in plot_object.m','ERROR')
     379        msgbox_uvmat('ERROR','unknown ObjectData.Style in plot_object.m')
    380380        return
    381381    end
    382382    set(hh,'Tag','proj_object')
    383     %set(hh,'UserData',ObjectData)%
    384 %         hh=hplot;
    385 %     set(hh,'DeleteFcn',@deletefcn)
    386 %     if isequal(ObjectData.ProjMode,'inside')
    387 %          if isequal(ObjectData.Style,'ellipse')|isequal(ObjectData.Style,'rectangle')
    388 %             set(hh,'FaceColor',col)
    389 %             set(hh,'EdgeColor',col)
    390 %          end
    391 %     end
    392383    if test_patch
    393384        hold on
  • trunk/src/proj_field.m

    r19 r38  
    241241            test3D=1;
    242242        end
    243 %         if length(ivar_U)>1 | length(ivar_V)>1 | length(ivar_W)>1
    244 %                  warndlg_uvmat('multiple vector input in proj_field.m','ERROR')
    245 %                     return
    246 %         end
    247243        if length(ivar_F)>1 | length(ivar_FF)>1
    248                  warndlg_uvmat('multiple flag input in proj_field.m','ERROR')
     244                 msgbox_uvmat('ERROR','multiple flag input in proj_field.m')
    249245                    return
    250         end
    251        
     246        end     
    252247        for ipoint=1:siz(1)
    253248           Xpoint=ObjectData.Coord(ipoint,:);
     
    473468            Coord{idim}=[0.5 DimValue(idim)];
    474469            test_direct(idim)=1;
    475 %             if isfield(FieldData,'VarAttribute')
    476 %                 for ivar=VarIndex
    477 %                     if length(FieldData.VarAttribute)>=ivar & isfield(FieldData.VarAttribute{ivar},Coord_i_str)% if there is a variable  attribute named Coord_1, _2 or _3
    478 %                         eval(['Coord_i=FieldData.VarAttribute{ivar}.' Coord_i_str ';']);%'range x
    479 %                         if isnumeric(Coord_i)
    480 %                              if length(Coord_i)>=2
    481 %                                 Coord{idim}=[Coord_i(1) Coord_i(end)];
    482 %                                 %test_direct(idim)=(Coord{idim}(2)>Coord{idim}(1));
    483 %                              else
    484 %                                 warndlg_uvmat(['two values needed for ' Coord_i_str 'in proj_field.m'],'ERROR')
    485 %                                 return
    486 %                              end
    487 %                          else
    488 %                             warndlg_uvmat(['non numerical coordinate attributes' Coord_i_str 'in proj_field.m'],'ERROR')
    489 %                             return
    490 %                          end
    491 %                          %test_coord(idim)=1;
    492 %                          DCoord_min(idim)=(Coord{idim}(end)-Coord{idim}(1))/(DimValue(idim)-1);
    493 %                     end
    494 %                 end
    495 %             end
    496470        end
    497471        AX=linspace(Coord{2}(1),Coord{2}(2),DimValue(2));
     
    12881262                test_direct_min=DCoord_min(idim)>0;% =1 for increasing values, 0 otherwise
    12891263                if ~isequal(test_direct(idim),test_direct_min)
    1290                      warndlg_uvmat(['non monotonic dimension variable # ' num2str(idim)  ' in proj_field.m'],'ERROR')
     1264                     msgbox_uvmat('ERROR',['non monotonic dimension variable # ' num2str(idim)  ' in proj_field.m'])
    12911265                                return
    12921266                end               
     
    12991273                Coord{idim}=[0.5 DimValue(idim)-0.5];
    13001274                test_direct(idim)=1;
    1301 %                 for ivar=VarIndex
    1302 %                     if  isfield(FieldData.VarAttribute{ivar},Coord_i_str)% if there is a variable  attribute named Coord_1, _2 or _3
    1303 %                          eval(['Coord{idim}=FieldData.VarAttribute{ivar}.' Coord_i_str ';']);%'range x
    1304 %                          if isnumeric(Coord{idim})
    1305 %                              if length(Coord{idim})>=2
    1306 %                                 test_direct(idim)=(Coord{idim}(2)>Coord{idim}(1));
    1307 %                              else
    1308 %                                 warndlg_uvmat(['two values needed for ' Coord_i_str 'in proj_field.m'],'ERROR')
    1309 %                                 return
    1310 %                              end
    1311 %                          else
    1312 %                             warndlg_uvmat(['non numerical coordinate attributes' Coord_i_str 'in proj_field.m'],'ERROR')
    1313 %                             return
    1314 %                          end
    1315 %                          DCoord_min(idim)=(Coord{idim}(end)-Coord{idim}(1))/(DimValue(idim)-1);
    1316 %                     end
    1317 %                 end
    13181275            end
    13191276        end
     
    15571514    if ~isequal(Phi,0) & length(ivar_U)==1
    15581515        if isempty(ivar_V)
    1559             warndlg_uvmat('v velocity component missing in proj_field.m','ERROR')
     1516            msgbox_uvmat('ERROR','v velocity component missing in proj_field.m')
    15601517            return
    15611518        end
  • trunk/src/proj_grid.m

    r19 r38  
    66function [A,rangx,rangy]=proj_grid(vec_X,vec_Y,vec_A,rgx_in,rgy_in,npxy_in)
    77    if length(vec_Y)<2
    8         warndlg_uvmat('less than 2 points in proj_grid.m','ERROR');
     8        msgbox_uvmat('ERROR','less than 2 points in proj_grid.m');
    99        return;
    1010    end
    1111    diffy=diff(vec_Y); %difference dy=vec_Y(i+1)-vec_Y(i)
    1212    index=find(diffy);% find the indices of vec_Y after wich a change of horizontal line occurs(diffy non zero)
    13     if isempty(index); warndlg_uvmat('points aligned along abscissa in proj_grid.m','ERROR'); return; end;%points aligned% A FAIRE: switch to line plot.
     13    if isempty(index); msgbox_uvmat('ERROR','points aligned along abscissa in proj_grid.m'); return; end;%points aligned% A FAIRE: switch to line plot.
    1414    diff2=diff(diffy(index));% diff2 = fluctuations of the detected vertical grid mesh dy
    1515    if max(abs(diff2))>0.001*abs(diffy(index(1))) % if max(diff2) is larger than 1/1000 of the first mesh dy
  • trunk/src/series.m

    r36 r38  
    5555%--------------------------------------------------------------------------
    5656function series_OpeningFcn(hObject, eventdata, handles,param)
    57 global nb_builtin
     57global nb_builtin nb_transform
    5858% Choose default command line output for series
    5959handles.output = hObject;
     
    133133
    134134%loads the information stored in prefdir to initiate the browser and the list of functions
    135 menu_str={'check_files';'aver_stat';'time_series';'merge_proj';'clean_civ_cmx'};
    136 nb_builtin=numel(menu_str); %number of functions
     135fct_menu={'check_files';'aver_stat';'time_series';'merge_proj';'clean_civ_cmx'};
     136transform_menu={'';'phys';'px';'phys_polar'};
     137nb_builtin=numel(fct_menu); %number of functions
     138nb_transform=numel(transform_menu);
    137139[path_series,name,ext]=fileparts(which('series'));
    138140path_series=fullfile(path_series,'series');%path of the function 'series'
    139 
    140 for ilist=1:length(menu_str)
     141path_transform=fullfile(path_series,'transform_field');%path of the function 'series'
     142for ilist=1:length(fct_menu)
    141143    fct_path{ilist,1}=path_series;%paths of the fuctions buil-in in 'series.m'
     144end
     145for ilist=1:length(transform_menu)
     146    transform_path{ilist,1}=path_transform;
    142147end
    143148% read the list of functions stored in the personal file 'uvmat_perso.mat' in prefdir
     
    150155             [path,file]=fileparts(h.series_fct{ilist});
    151156             fct_path=[fct_path; {path}];%concatene the list of paths
    152              menu_str=[menu_str; {file}];
     157             transform_menu=[transform_menu; {file}];
    153158         end
    154159    end
    155 end
    156 
    157 menu_str=[menu_str;{'more...'}];
    158 set(handles.ACTION,'String',menu_str)
     160    if isfield(h,'transform_fct') && iscell(h.transform_fct)
     161         for ilist=1:length(h.transform_fct)
     162             [path,file]=fileparts(h.transform_fct{ilist});
     163             transform_path=[transform_path; {path}];%concatene the list of paths
     164             transform_menu=[transform_menu;{file}];
     165         end
     166    end
     167end
     168fct_menu=[fct_menu;{'more...'}];
     169set(handles.ACTION,'String',fct_menu)
    159170set(handles.ACTION,'UserData',fct_path)% store the list of path in UserData of ACTION
     171transform_menu=[transform_menu;{'more...'}];
     172set(handles.CoordType,'String',transform_menu)
     173set(handles.CoordType,'UserData',transform_path)% store the list of path in UserData of ACTION
    160174
    161175% display the GUI for the default action 'check_files'
  • trunk/src/series/aver_stat.m

    r29 r38  
    358358                        eval(['siz=size(Field.' VarName ');']);
    359359                        if ~isequal(siz,sizmean)
    360                             warndlg_uvmat(['unequal size of input field ' VarName ', need to interpolate on a grid'],'WARNING')
     360                            msgbox_uvmat('WARNING',['unequal size of input field ' VarName ', need to interpolate on a grid'])
    361361                            nbmissing=nbmissing+1;
    362362                            break
  • trunk/src/series/sub_background.m

    r24 r38  
    118118    end
    119119    if ~isequal(floor(nbslice_i),nbslice_i)
    120         warndlg_uvmat('the number of slices must be a multiple of the i increment','ERROR')
     120        msgbox_uvmat('ERROR','the number of slices must be a multiple of the i increment')
    121121        return
    122122    end
  • trunk/src/series/time_series.m

    r27 r38  
    249249    for icell=1:length(timecell)
    250250        if ~isequal(size(timecell{icell}),size(timecell{1}))
    251             warndlg_uvmat('inconsistent time array dimensions in ImaDoc fields, the time for the first series is used','WARNING')
     251            msgbox_uvmat('WARNING','inconsistent time array dimensions in ImaDoc fields, the time for the first series is used')
    252252            time=timecell{1};
    253253            multitime=0;
     
    262262    diff_time=max(max(diff(time)));
    263263    if diff_time>0
    264         warndlg_uvmat(['times of series differ by more than ' num2str(diff_time)],'WARNING')
     264        msgbox_uvmat('WARNING',['times of series differ by more than ' num2str(diff_time)])
    265265    end   
    266266end
  • trunk/src/set_grid.m

    r2 r38  
    478478if isempty(imageA) | isequal(imageA,'')
    479479    if isempty(imageB) | isequal(imageB,'')
    480         warndlg_uvmat('at least one image file name must be introduced','ERROR')
     480        msgbox_uvmat('ERROR','at least one image file name must be introduced')
    481481    else
    482482        imageA=imageB;
     
    518518    testexist=exist(imageB,'file');
    519519    if isequal(testexist,0)
    520         warndlg_uvmat(['input image file' imageB 'does not exist'],'ERROR')
     520        msgbox_uvmat('ERROR',['input image file' imageB 'does not exist'])
    521521        return
    522522    end
     
    524524    form=imformats(ext([2:end]));
    525525    if isempty(form)% if the extension corresponds to an image format recognized by Matlab
    526          warndlg_uvmat(['error in read_image.m: ' imageB ' is not an image name recognized by Matlab '],'ERROR')
     526         msgbox_uvmat('ERROR',['error in read_image.m: ' imageB ' is not an image name recognized by Matlab '])
    527527         return
    528528    end
     
    532532     tsaiB=XmlDataB.GeometryCalib;
    533533    else
    534      warndlg_uvmat('no geometric calibration available for image B','WARNING')
     534     msgbox_uvmat('WARNING','no geometric calibration available for image B')
    535535     tsaiB=[];
    536536 end
  • trunk/src/uvmat.m

    r36 r38  
    1212%
    1313%AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    14 %  Copyright Joel Sommeria, Louis Gostiaux, 2008, LEGI / CNRS-UJF-INPG, sommeria@coriolis-legi.org.
     14%  Copyright Joel Sommeria,  2008, LEGI / CNRS-UJF-INPG, joel.sommeria@legi.grenoble-inp.fr.
    1515%AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    1616%     This open is part of the toolbox UVMAT.
     
    199199handles.output = hObject;
    200200
    201 % %group handles for input file in a structure handles.InputFile
    202 % handlesInputFile={handles.RootPath,handles.SubDir,handles.RootFile,handles.FileIndex,handles.FileExt};
    203 % TagsInputFile={'RootPath','SubDir','RootFile','FileIndex','FileExt'};
    204 % handles.InputFile=cell2struct(handlesInputFile,TagsInputFile,2);
    205 %
    206 % %group handles for the second input file in a structure handles.InputFile_1
    207 % handlesInputFile={handles.RootPath_1,handles.SubDir_1,handles.RootFile_1,handles.FileIndex_1,handles.FileExt_1};
    208 % TagsInputFile={'RootPath','SubDir','RootFile','FileIndex','FileExt'};
    209 % handles.InputFile_1=cell2struct(handlesInputFile,TagsInputFile,2);
    210 
    211201% Update handles structure
    212202guidata(hObject, handles);
     
    271261%check the path of menu_coord transform
    272262%set(handles.menu_coord,'String',{'';'phys';'px';'more...'})
    273 path_fct{1}='';
    274 path_fct{2}=fileparts(path_to_uvmat);
    275 path_fct{3}=fileparts(path_to_uvmat);
    276 path_fct{4}=fileparts(path_to_uvmat);
    277 set(handles.menu_coord,'UserData',path_fct)
     263% path_fct{1}='';
     264% path_fct{2}=fileparts(path_to_uvmat);
     265% path_fct{3}=fileparts(path_to_uvmat);
     266% path_fct{4}=fileparts(path_to_uvmat);
     267% set(handles.menu_coord,'UserData',path_fct)
    278268
    279269%case of an input argument for uvmat
     
    283273if exist('input','var')
    284274    if ~isempty(errormsg)
    285         warndlg_uvmat(errormsg,'WARNING')
     275        msgbox_uvmat('WARNING',errormsg)
    286276    end
    287277    if ishandle(handles.UVMAT_title)
     
    298288        sizinput=size(input);
    299289        if sizinput(1)<=1 || sizinput(2)<=1
    300             warndlg_uvmat('bad input for uvmat: file name, structure or numerical matrix accepted','ERROR')
     290            msgbox_uvmat('ERROR','bad input for uvmat: file name, structure or numerical matrix accepted')
    301291            return
    302292        end
     
    354344    end
    355345end
     346
     347%TRANSFORM menu: loads the information stored in prefdir to initiate the browser and the list of functions
     348menu_str={'';'phys';'px';'phys_polar'};
     349nb_builtin=numel(menu_str); %number of functions
     350[path_uvmat,name,ext]=fileparts(which('uvmat'));
     351addpath(fullfile(path_uvmat,'transform_field'))
     352fct_handle{1,1}=[];
     353testexist(1)=1;
     354for ilist=2:length(menu_str)
     355    if exist(menu_str{ilist},'file')
     356        fct_handle{ilist,1}=str2func(menu_str{ilist});
     357        testexist(ilist)=1;
     358    else
     359        testexist(ilist)=0;
     360    end
     361%     fct_handle{ilist,1}=fullfile(path_uvmat,'transform_field');%path to  the transform functions path_transform;
     362end
     363rmpath(fullfile(path_uvmat,'transform_field'))
     364% read the list of functions stored in the personal file 'uvmat_perso.mat' in prefdir
     365dir_perso=prefdir;
     366profil_perso=fullfile(dir_perso,'uvmat_perso.mat');
     367if exist(profil_perso,'file')
     368    h=load (profil_perso);
     369    if isfield(h,'transform_fct') && iscell(h.transform_fct)
     370         for ilist=1:length(h.transform_fct)
     371             [path,file]=fileparts(h.transform{ilist});
     372             addpath(path)
     373             if exist(file,'file')
     374                h_func=str2func(path);
     375                testexist=[testexist 1];
     376             else
     377                h_func=[];
     378                testexist=[testexist 0];
     379             end
     380             fct_handle=[fct_handle; {h_func}];%concatene the list of paths
     381             rmpath(path)
     382            % fct_path=[fct_path; {path}];%concatene the list of paths
     383             menu_str=[menu_str; {file}];
     384         end
     385    end
     386end
     387menu_str=menu_str(find(testexist));
     388fct_handle=fct_handle(find(testexist));
     389menu_str=[menu_str;{'more...'}];
     390set(handles.menu_coord,'String',menu_str)
     391set(handles.menu_coord,'UserData',fct_handle)% store the list of path in UserData of ACTION
     392
    356393set_vec_col_bar(handles)
    357394
     
    408445testblank=findstr(fileinput,' ');%look for blanks
    409446if ~isempty(testblank)
    410     warndlg_uvmat(['The input file name ' fileinput ' contains blank character : This is not allowed. Please change name'],'ERROR')
     447    msgbox_uvmat('ERROR',['The input file name ' fileinput ' contains blank character : This is not allowed. Please change name'])
    411448    return
    412449end
     
    906943testblank=findstr(fileinput_1,' ');%look for blanks
    907944if ~isempty(testblank)
    908     warndlg_uvmat(['The input file name ' fileinput_1 ' contains blank character : This is not allowed. Please change name'],'ERROR')
     945    msgbox_uvmat('ERROR',['The input file name ' fileinput_1 ' contains blank character : This is not allowed. Please change name'])
    909946    return
    910947end
     
    10081045%         set(handles.FileIndex,'UserData',NomType_1);
    10091046    otherwise
    1010         warndlg_uvmat(['invalid input file extension ' FileExt_1 ' for uvmat'],'ERROR')
     1047        msgbox_uvmat(['invalid input file extension ' FileExt_1 ' for uvmat'],'ERROR')
    10111048        return
    10121049end
     
    10151052if nbfield_1 >1 %case of image with multiple frames
    10161053    if nbfield_1 < num_i1
    1017         warndlg_uvmat('current frame index beyond the input movie length','ERROR')
     1054        msgbox_uvmat('ERROR','current frame index beyond the input movie length')
    10181055        return
    10191056    else
     
    10371074        indices=''; %default
    10381075        if ~idetect
    1039             warndlg_uvmat('second input file with indices corresponding to the first one does not exist','ERROR')
     1076            msgbox_uvmat('ERROR','second input file with indices corresponding to the first one does not exist')
    10401077            return
    10411078        end
     
    11951232end   
    11961233if ~isempty(TimeUnit_1) && ~isequal(TimeUnit_1,TimeUnit)
    1197         warndlg_uvmat('the time units for the second series differs from the first one','WARNING')
     1234        msgbox_uvmat('WARNING','the time units for the second series differs from the first one')
    11981235end
    11991236       
     
    12181255set(handles.last_j,'String',last_j_cell);
    12191256if ~isequal(last_i_cell{1},last_i_cell{2}) || ~isequal(last_j_cell{1},last_j_cell{2})
    1220         warndlg_uvmat('the numbers of input file of the second series differs from the first one','WARNING')
     1257        msgbox_uvmat('WARNING','the numbers of input file of the second series differs from the first one')
    12211258end
    12221259
     
    12441281
    12451282if ~isequal(warntext,'')
    1246     warndlg_uvmat(warntext,'WARNING')
     1283    msgbox_uvmat('WARNING',warntext)
    12471284end
    12481285
     
    14791516        end
    14801517        %px to phys or other transform on field
    1481         menu_transform=get(handles.menu_coord,'String');
     1518         menu_transform=get(handles.menu_coord,'String');
    14821519        choice_value=get(handles.menu_coord,'Value');
    1483         transform=menu_transform{choice_value};%name of the transform fct  given by the menu 'menu_coord'
    1484         if  ~isequal(transform,'') && ~isequal(transform,'px')
     1520        transform_name=menu_transform{choice_value};%name of the transform fct  given by the menu 'menu_coord'
     1521        transform_list=get(handles.menu_coord,'UserData');
     1522        transform=transform_list{choice_value};
     1523        if  ~isequal(transform_name,'') && ~isequal(transform_name,'px')
    14851524            if isfield(UvData,'XmlData') && isfield(UvData.XmlData,'GeometryCalib')%use geometry calib recorded from the ImaDoc xml file as first priority
    14861525                Calib=UvData.XmlData.GeometryCalib;
    1487                 Mask=feval(transform,Mask,UvData.XmlData);
     1526                Mask=transform(Mask,UvData.XmlData);
    14881527            end
    14891528        end
     
    16751714    UvData=get(huvmat,'UserData');
    16761715else
    1677     warndlg_uvmat('an image or movie must be first introduced as input','ERROR')
     1716    msgbox_uvmat('ERROR','an image or movie must be first introduced as input')
    16781717    return
    16791718end
     
    16861725    [imaname_1,idetect]=name_generator(filebase,num_i1,num_j2,Ext,NomType);
    16871726    if idetect==0
    1688         warndlg_uvmat(['second input open (-)  ' imaname_1 ' not found'],'ERROR');
     1727        msgbox_uvmat('ERROR',['second input open (-)  ' imaname_1 ' not found']);
    16891728        return
    16901729    end
     
    16941733    [imaname_1,idetect]=name_generator(filebase,num_i2,num_j1,Ext,NomType);
    16951734    if idetect==0
    1696         warndlg_uvmat(['second input open (-)  ' imaname_1 ' not found'],'ERROR');
     1735        msgbox_uvmat('ERROR',['second input open (-)  ' imaname_1 ' not found']);
    16971736        return
    16981737    end
    16991738else   
    1700     warndlg_uvmat('a second image index i2 or j2 is needed to show the pair as a movie','ERROR')
     1739    msgbox_uvmat('ERROR', 'a second image index i2 or j2 is needed to show the pair as a movie')
    17011740    return
    17021741end
     
    17041743%read the second image
    17051744Field.AName='image';
    1706 % Field.ListDimName={'AY','AX'}; %A FAIRE
    1707 % Field.DimValue=[];
    1708 % Field.ListVarName={'A'};
    17091745Field.AX=UvData.Field.AX;
    17101746Field.AY=UvData.Field.AY;
     
    17161752menu_transform=get(handles.menu_coord,'String');
    17171753choice_value=get(handles.menu_coord,'Value');
    1718 transform=menu_transform{choice_value};%name of the transform fct  given by the menu 'menu_coord'
    1719 if  ~isequal(transform,'') && ~isequal(transform,'px')
     1754transform_name=menu_transform{choice_value};%name of the transform fct  given by the menu 'menu_coord'
     1755transform_list=get(handles.menu_coord,'UserData');
     1756transform=transform_list{choice_value};
     1757if  ~isequal(transform_name,'') && ~isequal(transform_name,'px')
    17201758    if isfield(UvData,'XmlData') && isfield(UvData.XmlData,'GeometryCalib')%use geometry calib recorded from the ImaDoc xml file as first priority
    1721         Field=feval(transform,Field,UvData.XmlData);
     1759        Field=transform(Field,UvData.XmlData);
    17221760    end
    17231761end
     
    19962034            [Field{2},var_detect]=nc2struct(filename_1,SubField.ListVarName); %read the corresponding input data               
    19972035            Field{2}.VarAttribute=SubField.VarAttribute;
    1998             if isequal(get(hhget_field.menu_coord,'Visible'),'on')
    1999                 list_transform=get(hhget_field.menu_coord,'String');
    2000                 val_list=get(hhget_field.menu_coord,'Value');
    2001                 transf=list_transform{val_list};
    2002                 if ~isempty(transf)
    2003                     Field{2}=feval(transf,Field{2});
    2004                 end
    2005             end
     2036%             if isequal(get(hhget_field.menu_coord,'Visible'),'on')
     2037%                 list_transform=get(hhget_field.menu_coord,'String');
     2038%                 val_list=get(hhget_field.menu_coord,'Value');
     2039%                 transf=list_transform{val_list};
     2040%                 if ~isempty(transf)
     2041%                     Field{2}=feval(transf,Field{2});
     2042%                 end
     2043%             end
    20062044
    20072045            %update the display on get_field
     
    21352173menu_transform=get(handles.menu_coord,'String');
    21362174choice_value=get(handles.menu_coord,'Value');
    2137 transform=menu_transform{choice_value};%name of the transform fct  given by the menu 'menu_coord'
     2175%transform=menu_transform{choice_value};%name of the transform fct  given by the menu 'menu_coord'
     2176transform_list=get(handles.menu_coord,'UserData')
     2177transform=transform_list{choice_value}%selected function handles
    21382178
    21392179% z index
     
    21422182end
    21432183%px to phys or other transform on field
    2144 if  ~isequal(transform,'')
     2184if  ~isempty(transform)
    21452185    if length(Field)>=2
    21462186        Field{2}.ZIndex=mod(num_i1-1,nbslice)+1;
    2147         [Field{1},Field{2}]=feval(transform,Field{1},XmlData,Field{2},XmlData_1);
     2187        [Field{1},Field{2}]=transform(Field{1},XmlData,Field{2},XmlData_1);
    21482188        if isempty(Field{2})
    21492189            Field(2)=[];
    21502190        end
    21512191    else
    2152         Field{1}=feval(transform,Field{1},XmlData);
     2192        'TESTrun'
     2193        Field{1}=transform(Field{1},XmlData);
     2194         Field{1}
    21532195    end
    21542196end
     
    26122654nc=netcdf(filename,'write'); %open netcdf file
    26132655result=redef(nc);
    2614 if isempty(result), warndlg_uvmat('##Bad redef operation.','ERROR'),end
     2656if isempty(result), msgbox_uvmat('ERROR','##Bad redef operation.'),end
    26152657test_civ2=isequal(get(handles.civ2,'BackgroundColor'),[1 1 0]);
    26162658if ~test_civ2
     
    37083750imflag=flipdim(imflag,1);
    37093751% imflag=uint8(255*flag);% =0 for flag=0 (vectors=0 when 20<imflag<200)
    3710 warndlg_uvmat([mask_name ' saved'],'CONFIRMATION')
     3752msgbox_uvmat('CONFIRMATION',[mask_name ' saved'])
    37113753imwrite(imflag,mask_name,'BitDepth',8);
    37123754
     
    39684010ind_coord=get(handles.menu_coord,'Value');
    39694011coord_option=menu{ind_coord};
    3970 list_path=get(handles.menu_coord,'UserData');
     4012list_transform=get(handles.menu_coord,'UserData');
    39714013   
    39724014if isequal(coord_option,'more...');
     
    39954037           msgbox_uvmat('ERROR',['image procesing fct ' coord_fct ' not found'])
    39964038    else
    3997        transform=FileName(1:end-2);%
     4039       [ppp,transform]=fileparts(FileName);% removes extension .m
    39984040       menu=update_menu(handles.menu_coord,transform);%add the selected fct to the menu
    39994041       ind_coord=get(handles.menu_coord,'Value');
    4000        list_path{ind_coord}=PathName;
    4001        set(handles.menu_coord,'UserData',list_path)
     4042       addpath(PathName)
     4043       list_transform{ind_coord}=str2func(transform);% create the function handle corresponding to the newly seleced function
     4044       set(handles.menu_coord,'UserData',list_transform)
     4045       rmpath(PathName)
    40024046       if exist(profil_perso,'file')
    40034047            save (profil_perso,'coord_fct','-append'); %store the root name for future opening of uvmat
     
    40074051
    40084052%check the current path to the selected function
    4009 PathName=list_path{ind_coord};
    4010 CurrentPath=fileparts(which(coord_option));
    4011 if ~isequal(PathName,CurrentPath)&&~isequal(CurrentPath,fullfile(PathName,'private'))
    4012     addpath(PathName)
    4013     errormsg=check_functions;
    4014     msgbox_uvmat('WARNING',[['path ' PathName ' added to the current Matlab pathes'];errormsg])
    4015 end
    4016 set(handles.path_transform,'String',fullfile(PathName,' ')); %show the path to the senlected function
     4053func=functions(list_transform{ind_coord})
     4054set(handles.path_transform,'String',fileparts(func.file)); %show the path to the senlected function
     4055%CurrentPath=fileparts(which(coord_option));
     4056% if ~isequal(PathName,CurrentPath)
     4057%     addpath(PathName)
     4058%     errormsg=check_functions;
     4059%     msgbox_uvmat('WARNING',[['path ' PathName ' added to the current Matlab pathes'];errormsg])
     4060% end
     4061%set(handles.path_transform,'String',fullfile(PathName,' ')); %show the path to the senlected function
    40174062set(handles.FixedLimits,'Value',0)
    40184063set(handles.FixedLimits,'BackgroundColor',[0.7 0.7 0.7])
Note: See TracChangeset for help on using the changeset viewer.