Changeset 1201 for trunk/src


Ignore:
Timestamp:
Mar 23, 2026, 4:49:29 PM (5 hours ago)
Author:
sommeria
Message:

various improvements...

Location:
trunk/src
Files:
1 added
4 deleted
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/browse_data.m

    r1179 r1201  
    11
    2 %'browse_data': function for scanning directories in a campaign
     2%'browse_data': function for scanning data tree in a project
    33%------------------------------------------------------------------------
    44% function varargout = series(varargin)
  • trunk/src/check_files.m

    r1179 r1201  
    4343    'check_files';...
    4444    'civ';... % key function  for image correlations (called by series/cvi_series.m)
    45     'cluster_command';...% creates the command string for launching jobs in the cluster system 'oar'.
     45    'cluster_command_LEGI';...% creates the command string for launching jobs in the cluster system 'oar'.
    4646    'command_launch_matlab';% creates the command strings for opening a new Matlab session
    4747    'command_load_python';% creates the command strings for loading Python
     
    8181    'nc2struct';...% transform a netcdf file in a corresponding matlab structure
    8282    'num2stra';...% transform number to the corresponding character string depending on the nomenclature
     83    'parciv';... % same as civ.m, but for loop replaced by 'parfor' for parallel computing on local computer
    8384    'phys_XYZ';...% transform coordiantes from pixels to phys
    8485    'px_XYZ';...% transform coordiantes from phys to pixels
     
    8687    'plot_object';...%draws a projection object (points, line, plane...)
    8788    'proj_field';...%project a field on a projection object (plane, line,...)
    88     'read_civxdata';...reads civx data from netcdf files
    8989    'read_civdata';... reads new civ data from netcdf files
    9090    'read_field';...% read the fields from files in different formats (netcdf files, images, video)
     
    104104    'set_object.m';...%  edit a projection object
    105105    'set_object.fig';...% interface for set_object
     106    'set_slices.mlapp';% creates illumination slices in 3D context
    106107    'set_subdomains';...% sort a set of points defined by scattered coordinates in subdomains, as needed for tps interpolation
    107108    'stra2num';...% transform letters (a, b, A, B,) or numerical strings ('1','2'..) to the corresponding numbers
     
    117118    'uigetfile_uvmat';... browser, and display of directories, faster than the Matlab fct uigetfile
    118119    'update_imadoc';...  %update the ImaDoc xml file
    119     'update_waitbar';... update the waitbar display, used for ACTION functions in the GUI 'series'
    120120    'uvmat';...% master function for file scanning and visualisation of 2D fields
    121121    'uvmat.fig';...  %interface for uvmat
  • trunk/src/civ.m

    r1199 r1201  
    129129SearchRange_2=par_civ.SearchRange(2);
    130130if par_civ.CorrSmooth~=0 % par_civ.CorrSmooth=0 implies no civ computation (just input image and grid points given)
    131     parfor ivec=1:nbvec
    132 %         iref=round(par_civ.Grid(ivec,1));% xindex on the image A for the middle of the correlation box
    133 %         jref=round(npy_ima-par_civ.Grid(ivec,2));%  j index  for the middle of the correlation box in the image A
     131    for ivec=1:nbvec
    134132         iref=xtable(ivec);% xindex on the image A for the middle of the correlation box
    135133         jref=ytable(ivec);%  j index  for the middle of the correlation box in the image A
     
    230228                        utable(ivec)=vector(1)*mesh+shiftx(ivec);
    231229                        vtable(ivec)=-vector(2)*mesh+shifty(ivec);% vtable and shifty in image coordinates (opposite to pixel shift)
    232                       %  xtable(ivec)=iref+utable(ivec)/2-0.5;% convec flow (velocity taken at the point middle from imgae 1 and 2)
    233                        % ytable(ivec)=jref+vtable(ivec)/2-0.5;% and position of pixel 1=0.5 (convention for image coordinates=0 at the edge)
    234 %                         iref=round(xtable(ivec)+0.5);% nearest image index for the middle of the vector
    235 %                         jref=round(ytable(ivec)+0.5);
    236                         % eliminate vectors located in the mask
    237 %                         if  checkmask && (iref<1 || jref<1 ||iref>npx_ima || jref>npy_ima ||( par_civ.Mask(jref,iref)<200 && par_civ.Mask(jref,iref)>=100))
    238 %                             utable(ivec)=0;
    239 %                             vtable(ivec)=0;
    240 %                             FF(ivec)=1;
    241 %                         end
    242230                        ctable(ivec)=corrmax/sum_square;% correlation value
    243231                    catch ME
     
    354342    [X,Y]=meshgrid(x_vec,y_vec);
    355343    coord=[reshape(X,[],1) reshape(Y,[],1)];
    356     result_conv=reshape(result_conv(y_ind,x_ind),[],1);
    357    
    358    
     344    result_conv=reshape(result_conv(y_ind,x_ind),[],1);       
    359345    % n=numel(X);
    360346    % x=[X Y];
  • trunk/src/command_launch_matlab.m

    r1184 r1201  
    1 %'command_launch_matlab': creates the command strings for opening a new Matlab session 
     1%'command_launch_matlab': creates the command strings for opening a new Matlab session
    22% and running a programme in a Linux system('GLNX86','GLNXA64','MACI64')
    33%------------------------------------------------------------------------
     
    66%OUTPUT
    77% cmd=set of system commands (char string) to write in an executable file: [fid,message]=fopen(file_exe,'w');
    8                            % fprintf(fid,cmd); % fill the executable file with the  char string cmd
    9                            % fclose(fid); % close the executable file
    10                            %  system(['chmod +x ' file_exe]); % set the file to executable
    11                            % system([file_exe ' &'])%  execute the command file
    12                            
     8% fprintf(fid,cmd); % fill the executable file with the  char string cmd
     9% fclose(fid); % close the executable file
     10%  system(['chmod +x ' file_exe]); % set the file to executable
     11% system([file_exe ' &'])%  execute the command file
     12
    1313%
    1414%INPUT:
     
    2828matlab_ver = ver('MATLAB');
    2929matlab_version = matlab_ver.Version;
     30% matlab launch options:
     31  % -nodisplay: no graphic display
     32  % -nodesktop: disables the desktop environment.
     33   % replaces -nojvm: no Java-related overhead (useful for scripts or batch jobs)
     34   % TODO : replace all these options by -batch for newer Matlab versions
    3035cmd=[...
    3136    '#!/bin/bash\n'...
     
    3439    'module load matlab/' matlab_version '\n'...% CHOICE OF THE SAME MATLAB VERSION AS THE CURRENT MATLAB SESSION (not mandatory)
    3540    'time_start=$(date +%%s)\n'...
    36     'matlab -nodisplay -nosplash -nojvm ''' ThreadOption ''' -logfile ''' filelog ''' <<END_MATLAB\n'...%launch the new Matlab session  without display
     41    'matlab -nodisplay -nosplash -nodesktop ''' ThreadOption ''' -logfile ''' filelog ''' <<END_MATLAB\n'...%launch the new Matlab session  without display
    3742    'addpath(''' path_uvmat ''');\n'...
    3843    'current_dir=pwd;\n'... % current working dir
    3944    'cd(''' ActionPath ''');\n'...
    40 'h_fun=str2func(''' ActionName ''');\n'...% create the function handle for the function ActionName
    41 'cd(current_dir);\n'];
    42  %   'addpath(''' ActionPath ''');\n'];
     45    'h_fun=str2func(''' ActionName ''');\n'...% create the function handle for the function ActionName
     46    'cd(current_dir);\n'];
    4347for iprocess=1:numel(inputxml)
    44 %    cmd=[cmd '' ActionName  '(''' inputxml{iprocess} ''');\n'];
    45 cmd=[cmd ' h_fun  (''' inputxml{iprocess} ''');\n'];
     48    cmd=[cmd ' h_fun  (''' inputxml{iprocess} ''');\n'];
    4649end
    4750cmd=[cmd  'exit\n' 'END_MATLAB\n'];
    48     if strcmp(option,'background')
     51if strcmp(option,'background')
    4952    cmd=[cmd ...
    50     'time_end=$(date +%%s)\n'...
    51     'echo "global time = " $(($time_end - $time_start)) >> ''' filelog '''\n'];
    52     end
     53        'time_end=$(date +%%s)\n'...
     54        'echo "global time = " $(($time_end - $time_start)) >> ''' filelog '''\n'];
     55end
    5356
    5457
  • trunk/src/keyboard_callback.m

    r1184 r1201  
    1 %'keyboard_callback:' function activated when a key is pressed on the keyboard
     1%'keyboard_callback:' function activated when a key is pressed on the keyboard when a figure has been selected by the mouse  (callback `KeyPressFcn` of Matlab).
    22%-----------------------------------
    33
  • trunk/src/nc2struct.m

    r1196 r1201  
    1 
    2 %'nc2struct': transform a NetCDF file in a corresponding matlab structure
     1%'nc2struct': reads a NetCDF file as a corresponding Matlab structure.
    32% or directly read the a matlab data file .mat (calling the fct mat2struct.m)
    43% it reads all the global attributes and all variables, or a selected list.
  • trunk/src/plot_field.m

    r1200 r1201  
    1 %'plot_field': plot any field with the structure defined in the uvmat package
     1%'plot_field': plots a field (vectors, scalar or images, or usual x,y plot), depending on the input field object and plotting parameters defined in uvmat.
    22%------------------------------------------------------------------------
    33%
  • trunk/src/px_XYZ.m

    r1127 r1201  
    1 %'px_XYZ': transform physical to image coordinates.
     1%'px_XYZ': transforms physical to image coordinates.
    22%------------------------------------------------------------------------
    3 %[X,Y]=px_XYZ(Calib,Xphys,Yphys,Zphys)
     3%[X,Y]=px_XYZ(Calib,Slice,Xphys,Yphys,Zphys)
    44%------------------------------------------------------------------------           
    55% OUTPUT:
     
    88% INPUT:
    99% Calib: structure containing calibration parameters
     10% Slice: structure indicating the plane cut position
    1011% Xphys,Yphys,Zphys; vectors of physical coordinates for a set of points
    1112
     
    4142%%%%%%%%%%%%%
    4243if isempty(Slice)
    43     Slice=Calib;
     44    Slice=Calib;% old convention (< 2022)
    4445end
    4546% general case
     
    5152        if H>Zphys
    5253            Zphys=H-(H-Zphys)/Slice.RefractionIndex; %corrected z (virtual object)Calib
    53            
    54           %  test_refraction=1;
    5554        end
    5655    end
    5756   
    5857    %camera coordinates
    59     Zphys=Zphys;%flip z coordinates
    6058    xc=R(1)*Xphys+R(2)*Yphys+R(3)*Zphys+Calib.Tx_Ty_Tz(1);
    6159    yc=R(4)*Xphys+R(5)*Yphys+R(6)*Zphys+Calib.Tx_Ty_Tz(2);
     
    6967    if ~isfield(Calib,'kc')
    7068        r2=1; %no quadratic distortion
    71     elseif numel(Calib.kc)==1
     69    elseif isscalar(Calib.kc)
    7270        r2=1+Calib.kc*(Xu.*Xu+Yu.*Yu);
    7371    else
  • trunk/src/script_check_required_toolbox.m

    r1179 r1201  
     1%'script_check_required_toolbox': checks the Matlab toolboxes required for
     2%each function of the package UVMAT
     3
    14%% check list of fcts in main folder
     5disp('%%%%%%%%%%%% fcts in the master folder UVMAT %%%%%%%%%%%%')
    26[~,~,~,list_fct]=check_files;
    37for ilist=1:numel(list_fct)
    48    [~, pList] = matlab.codetools.requiredFilesAndProducts(list_fct{ilist});
    5     disp([list_fct{ilist} ': ' {pList.Name}])
     9    Name_str='';
     10    for iname=1:numel(pList)
     11        Name_str=[Name_str ' ' pList(iname).Name];
     12    end
     13    disp([list_fct{ilist} ': ' Name_str])
    614end
    715
    816str=which('UVMAT');
    9 path_uvmat=fileparts(str)
     17path_uvmat=fileparts(str);
    1018
    1119%% check list of fcts in transform_field
     20disp('%%%%%%%%%%%% fcts in UVMAT/transform_field %%%%%%%%%%%%')
    1221dir_fct=fullfile(path_uvmat,'transform_field');
    1322list_fct=dir(dir_fct);
    1423for ilist=1:numel(list_fct)
    1524    if ~isempty(regexp(list_fct(ilist).name,'.m$', 'once'))
    16     [~, pList] = matlab.codetools.requiredFilesAndProducts(fullfile(dir_fct,list_fct(ilist).name));
    17     disp([list_fct(ilist).name ': ' {pList.Name}])
     25        [~, pList] = matlab.codetools.requiredFilesAndProducts(fullfile(dir_fct,list_fct(ilist).name));
     26        Name_str='';
     27        for iname=1:numel(pList)
     28            Name_str=[Name_str ' ' pList(iname).Name];
     29        end
     30        disp([list_fct(ilist).name ': ' Name_str])
    1831    end
    1932end
    2033
    2134%% check list of fcts in series
     35disp('%%%%%%%%%%%% fcts in UVMAT/series %%%%%%%%%%%%')
    2236dir_fct=fullfile(path_uvmat,'series');
    2337list_fct=dir(dir_fct);
    2438for ilist=1:numel(list_fct)
    2539    if ~isempty(regexp(list_fct(ilist).name,'.m$', 'once'))
    26     [~, pList] = matlab.codetools.requiredFilesAndProducts(fullfile(dir_fct,list_fct(ilist).name));
    27     disp([list_fct(ilist).name ': ' {pList.Name}])
     40        [~, pList] = matlab.codetools.requiredFilesAndProducts(fullfile(dir_fct,list_fct(ilist).name));
     41        Name_str='';
     42        for iname=1:numel(pList)
     43            Name_str=[Name_str ' ' pList(iname).Name];
     44        end
     45        disp([list_fct(ilist).name ':' Name_str])
    2846    end
    2947end
  • trunk/src/series.xml.default

    r1200 r1201  
    1010      <WallTimeMax unit="hour">23</WallTimeMax>                <!-- maximum allowed time for a job -->
    1111      <JobStatCmd>oarstat |grep N=UVmat</JobStatCmd>           <!-- command to know the number of active and waiting job launches -->
    12       <LaunchCmdFcn>cluster_command</LaunchCmdFcn>             <!-- name of the function used to create job launch commmand -->
     12      <LaunchCmdFcn>cluster_command_LEGI</LaunchCmdFcn>             <!-- name of the function used to create job launch commmand -->
    1313   </ClusterParam>
    1414</SeriesParam>
  • trunk/src/series/civ2vel_3C.m

    r1157 r1201  
    5252
    5353function ParamOut=civ2vel_3C(Param)
    54 disp('test')
     54
    5555%% set the input elements needed on the GUI series when the function is selected in the menu ActionName or InputTable refreshed
    5656if isstruct(Param) && isequal(Param.Action.RUN,0)
     
    349349        V1=Data{1}.V;
    350350    end
    351     Ua=griddata(X1,Y1,U1,Xa,Ya);
     351    Ua=griddata(X1,Y1,U1,Xa,Ya);% interpolate PIV data positions to the common grid Xa,Ya
    352352    Va=griddata(X1,Y1,V1,Xa,Ya);
    353353    [Ua,Va,Xa,Ya]=Ud2U(XmlData{1}.GeometryCalib,Xa,Ya,Ua,Va); % convert Xd data to X
  • trunk/src/series/civ_input.m

    r1200 r1201  
    15891589function TestCiv1_Callback(hObject, eventdata, handles)
    15901590%------------------------------------------------------------------------
    1591 drawnow
     1591drawnowci
    15921592if get(handles.TestCiv1,'Value')
    15931593    set(handles.TestCiv1,'BackgroundColor',[1 1 0])% paint TestCiv1 button to yellow to confirm civ launch
  • trunk/src/series/civ_series.m

    r1200 r1201  
    4646%=======================================================================
    4747
    48 function [Data,errormsg,result_conv]= civ_series(Param)
     48function [Data,errormsg]= civ_series(Param)
    4949errormsg='';
    5050
     
    398398            if strcmp(NomTypeNc,'_1-2_1')% case of volume,backgrounds act on different j levels
    399399                backgroundname=fullfile_uvmat(RootPath_background,SubDir_background,RootFile_background,Ext_background,'_1',j1_series_Civ1(ifield));
    400             elseif isfield(par_civ1,'NbSlice')&& ~isequal(par_civ1.NbSlice,1)
     400            elseif isfield(par_civ1,'NbSlice')
    401401                i1_background=mod(i1-1,par_civ1.NbSlice)+1;
    402402                backgroundname=fullfile_uvmat(RootPath_background,SubDir_background,RootFile_background,Ext_background,'_1',i1_background);
     
    490490            if ~isempty(i2_series_Civ1)&& ~isequal(i1_series_Civ1,i2_series_Civ1)% case of volume,masks act on different j levels
    491491                maskname=fullfile_uvmat(RootPath_mask,SubDir_mask,RootFile_mask,Ext_mask,'_1',j1);
    492             elseif isfield(par_civ1,'NbSlice')&& ~isequal(par_civ1.NbSlice,1)
     492            elseif isfield(par_civ1,'NbSlice')
    493493                i1_mask=mod(i1-1,par_civ1.NbSlice)+1;
    494494                maskname=fullfile_uvmat(RootPath_mask,SubDir_mask,RootFile_mask,Ext_mask,'_1',i1_mask);
     
    530530       
    531531        % caluclate velocity data
    532         %   [Data.Civ1_X,Data.Civ1_Y,Data.Civ1_U,Data.Civ1_V,Data.Civ1_C,Data.Civ1_FF, result_conv, errormsg] = civ (par_civ1);
    533         [Civ_X,Civ_Y,Civ_U,Civ_V,Civ_C,Civ_FF, result_conv, errormsg] = civ (par_civ1);
     532        if strcmp(Param.RunMode,'cluster')
     533            [Civ_X,Civ_Y,Civ_U,Civ_V,Civ_C,Civ_FF,~, errormsg] = civ (par_civ1);% single processor used in cluster
     534        else
     535            [Civ_X,Civ_Y,Civ_U,Civ_V,Civ_C,Civ_FF,errormsg] = parciv (par_civ1);%use parfor loop
     536        end
    534537        Civ_X_shifted=Civ_X-0.5+Civ_U/2;% get the exact positions
    535538        Civ_Y_shifted=Civ_Y-0.5+Civ_V/2;
     
    680683            if ~isempty(i2_series_Civ2)% case of volume,backgrounds act on different j levels
    681684                backgroundname=fullfile_uvmat(RootPath_background,SubDir_background,RootFile_background,Ext_background,'_1',j1);
    682             elseif isfield(par_civ2,'NbSlice') && ~isequal(par_civ2.NbSlice,1)
     685            elseif isfield(par_civ2,'NbSlice')
    683686                i1_background=mod(i1-1,par_civ2.NbSlice)+1;
    684687                backgroundname=fullfile_uvmat(RootPath_background,SubDir_background,RootFile_background,Ext_background,'_1',i1_background);
     
    804807                end
    805808                maskname=fullfile_uvmat(RootPath_mask,SubDir_mask,RootFile_mask,Ext_mask,'_1',j1);
    806             elseif isfield(par_civ2,'NbSlice')&& ~isequal(par_civ2.NbSlice,1)
     809            elseif isfield(par_civ2,'NbSlice')
    807810                i1=i1_series_Civ2(ifield);
    808811                i1_mask=mod(i1-1,par_civ2.NbSlice)+1;
     
    855858        end
    856859       
    857         % calculate velocity data     
    858         [Civ_X,Civ_Y,Civ_U,Civ_V,Civ_C,Civ_FF,~, errormsg] = civ (par_civ2);
     860        % calculate velocity data
     861        if strcmp(Param.RunMode,'cluster')
     862            [Civ_X,Civ_Y,Civ_U,Civ_V,Civ_C,Civ_FF,~, errormsg] = civ (par_civ2);% single processor used in cluster
     863        else
     864            [Civ_X,Civ_Y,Civ_U,Civ_V,Civ_C,Civ_FF,errormsg] = parciv (par_civ2);%use parfor loop
     865        end
    859866        Civ_X_shifted=Civ_X-0.5+Civ_U/2;% get the exact positions
    860867        Civ_Y_shifted=Civ_Y-0.5+Civ_V/2;
  • trunk/src/uvmat.m

    r1200 r1201  
    1 %'uvmat': function associated with the GUI 'uvmat.fig' for images and data field visualization
     1%'uvmat': function associated with the master GUI 'uvmat.fig' for the visualisation of images and data fields
    22%------------------------------------------------------------------------
    33% function huvmat=uvmat(input)
     
    220220
    221221%% EXPORT menu
    222 export_menu={'as field in workspace';'in new figure';'on existing axis';'make movie';'more...'};
     222export_menu={'field in workspace';'field in new figure';'field on existing axis';'make movie';'create mirror data tree';'more...'};
    223223
    224224%% load the list of previously browsed files in menus Open, Open_1 and TransformName
     
    363363CoordinatesPanelHeight=100;
    364364ScalarPanelHeight=150;
     365FieldIndicesHeight=220;
     366NavigateHeight=120;
     367TransformHeight=100;
     368ObjectsHeight=150;
    365369Interval=2;
    366370
     
    433437
    434438%% reset position and scale of axis
    435 pos(1)=0.2*size_uvmat(3)+35;
    436 pos(2)=50;
    437 pos(3)=0.77*size_uvmat(3)-1.2*ColumnWidth;
     439pos(1)=1.2*ColumnWidth+50;%axis x position
     440pos(2)=50;%axis y position
     441pos(3)=size_uvmat(3)-2.2*ColumnWidth-100;%axis width
    438442pos(4)=pos_InputFile(2)-50-Interval;
    439443set(handles.PlotAxes,'Units','pixels')
     
    441445%set(handles.PlotAxes,'Units','normalized')
    442446UvData=get(handles.uvmat,'UserData');
    443 UvData.PosColorbar([1 3])=[pos(1)+pos(3)+10 10]/size_uvmat(3);
     447UvData.PosColorbar([1 3])=[pos(1)+pos(3)+10 15]/size_uvmat(3);%x position and width of the colorbar
    444448UvData.PosColorbar([2 4])=[pos(2)+pos(3)/4 pos(3)/2]/size_uvmat(4);
    445449set(handles.uvmat,'UserData',UvData)
    446450
    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)
     451%% reset position of Field Indices
     452set(handles.FieldIndices,'Units','pixels')
     453pos_1(1)=Interval;         % set 'Scalar' to the right of the fig
     454pos_1(2)=pos_InputFile(2)-FieldIndicesHeight-Interval;     
     455pos_1(3)=1.2*ColumnWidth; % set 'Scalar' to the lower edge of frame 'Coordinates' if visible
     456pos_1(4)=FieldIndicesHeight;
     457set(handles.FieldIndices,'Position',pos_1)
     458
     459%% reset position of Navigation
     460set(handles.Navigation,'Units','pixels')
     461pos_2(1)=Interval;         % set 'Scalar' to the right of the fig
     462pos_2(2)=pos_1(2)-NavigateHeight-Interval;     
     463pos_2(3)=1.2*ColumnWidth; % set 'Scalar' to the lower edge of frame 'Coordinates' if visible
     464pos_2(4)=NavigateHeight;
     465set(handles.Navigation,'Position',pos_2)
     466
     467%% reset position of Transform
     468set(handles.Transform,'Units','pixels')
     469pos_3(1)=Interval;         % set 'Scalar' to the right of the fig
     470pos_3(2)=pos_2(2)-TransformHeight-Interval;     
     471pos_3(3)=1.2*ColumnWidth; % set 'Scalar' to the lower edge of frame 'Coordinates' if visible
     472pos_3(4)=TransformHeight;
     473set(handles.Transform,'Position',pos_3)
     474
     475%% reset position of Objects
     476set(handles.Objects,'Units','pixels')
     477pos_4(1)=Interval;         % set 'Scalar' to the right of the fig
     478pos_4(2)=pos_3(2)-ObjectsHeight-Interval;     
     479pos_4(3)=1.2*ColumnWidth; % set 'Scalar' to the lower edge of frame 'Coordinates' if visible
     480pos_4(4)=ObjectsHeight;
     481set(handles.Objects,'Position',pos_4)
     482
     483%% reset position of Histogram
     484set(handles.Histogram_txt,'Units','pixels')
     485set(handles.HistoMenu,'Units','pixels')
     486set(handles.LogLinHisto,'Units','pixels')
     487set(handles.HistoAxes,'Units','pixels')
     488set(handles.Histogram_txt,'FontSize',16)
     489set(handles.Histogram_txt,'Position',[Interval pos_4(2)-20-Interval 0.5*ColumnWidth-Interval 20])
     490set(handles.HistoMenu,'Position',[2*Interval+0.5*ColumnWidth pos_4(2)-20-Interval 0.35*ColumnWidth-Interval 20])
     491set(handles.LogLinHisto,'Position',[3*Interval+0.85*ColumnWidth pos_4(2)-20-Interval 0.35*ColumnWidth-Interval 20])
     492set(handles.HistoAxes,'Position',[40 pos_4(2)-220-Interval 1.2*ColumnWidth-40 180])
     493
    458494
    459495%------------------------------------------------------------------------
     
    831867else
    832868    current_dir=pwd;%current working dir
     869    export_fct_name=get(handles.MenuExportCustom,'label');
    833870    cd(fullfile(fileparts(which('uvmat')),'export_fct'))
    834871    export_handle=str2func(export_fct_name);% pick the relevant export fct in the folder UVMAT/export_fct
     
    853890
    854891% -----------------------------------------------------------------------
     892% --- called by menu bar Projection object/points
    855893function Menupoints_Callback(hObject, eventdata, handles)
    856894%------------------------------------------------------------------------
     
    861899
    862900% -----------------------------------------------------------------------
    863 % --- Callback of the Menu command line
    864 %------------------------------------------------------------------------
     901% --- % --- called by menu bar Projection object/line
    865902function Menuline_Callback(hObject, eventdata, handles)
    866903%------------------------------------------------------------------------
     
    871908
    872909% -----------------------------------------------------------------------
    873 % --- Callback of the Menu command line_x
    874 %------------------------------------------------------------------------
     910% --- called by menu bar Projection object/line_x
    875911function Menuline_x_Callback(hObject, eventdata, handles)
     912%------------------------------------------------------------------------
    876913
    877914data.Type='line_x';
     
    881918
    882919% -----------------------------------------------------------------------
    883 % --- Callback of the Menu command line_y
    884 % -----------------------------------------------------------------------
     920% --- called by menu bar Projection object/line_y
    885921function Menuline_y_Callback(hObject, eventdata, handles)
     922%------------------------------------------------------------------------
    886923
    887924data.Type='line_y';
     
    899936
    900937%------------------------------------------------------------------------
     938% --- called by menu bar Projection object/
    901939function Menupolygon_Callback(hObject, eventdata, handles)
    902940%------------------------------------------------------------------------
     
    915953
    916954%------------------------------------------------------------------------
     955% --- called by menu bar Projection object/
    917956function Menuellipse_Callback(hObject, eventdata, handles)
    918957%------------------------------------------------------------------------
     
    923962
    924963%------------------------------------------------------------------------
    925 function MenuMaskObject_Callback(hObject, eventdata, handles)
     964% --- called by menu bar Projection object/
     965function MenuMaskObject_Callback(hObject, eventdata, handles)% TO DELETE
    926966%------------------------------------------------------------------------
    927967data.Type='polygon';
     
    932972
    933973%------------------------------------------------------------------------
     974% --- called by menu bar Projection object/plane_xy: to project fields on a horizontal plane x,y
    934975function Menuplane_Callback(hObject, eventdata, handles)
    935976%------------------------------------------------------------------------
     
    939980create_object(data,handles)
    940981
    941 % --------------------------------------------------------------------
     982% -----------------------------------------------------------------------
     983% --- called by menu bar Projection object/plane_z: to project fields on a vertical plane
    942984function Menuplane_z_Callback(hObject, eventdata, handles)
     985%------------------------------------------------------------------------
    943986data.Type='plane_z';
    944987data.ProjMode='projection';%default
     
    947990
    948991%------------------------------------------------------------------------
     992% --- called by menu bar Projection object/volume (to check !!)
    949993function Menuvolume_Callback(hObject, eventdata, handles)
    950994%------------------------------------------------------------------------
     
    9891033    end
    9901034    if isfield(UvData.Field,'CoordMesh')&&~isempty(UvData.Field.CoordMesh)
    991         %data.RangeX=[UvData.Field.XMin UvData.Field.XMax];
    9921035        data.DX=UvData.Field.CoordMesh;
    9931036        data.DY=UvData.Field.CoordMesh;
     
    10671110%------------------------------------------------------------------------
    10681111function MenuBrowseObject_Callback(hObject, eventdata, handles)
     1112% --- called by menu bar Projection object/browse...
    10691113%------------------------------------------------------------------------
    10701114%get the object file
     
    10981142%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    10991143%------------------------------------------------------------------------
     1144% --- called by menu bar Tools/ruler
    11001145function MenuRuler_Callback(hObject, eventdata, handles)
    11011146%------------------------------------------------------------------------
     
    11121157
    11131158%------------------------------------------------------------------------
     1159% --- called by menu bar Tools/geometry calibration
    11141160function MenuCalib_Callback(hObject, eventdata, handles)
    11151161%------------------------------------------------------------------------
     
    11401186
    11411187
    1142 % --------------------------------------------------------------------
    1143 % --- set the slice plane ro the set of slice planes when volume scan is used
     1188% -----------------------------------------------------------------------
     1189% --- called by menu bar Tools/set slice calibrationset the slice plane ro the set of slice planes when volume scan is used
    11441190function MenuSetSlice_Callback(hObject, eventdata, handles)
    1145 % --------------------------------------------------------------------
     1191% -----------------------------------------------------------------------
    11461192%% suppress the second input field if exists
    11471193if get(handles.SubField,'Value')
     
    14801526delete(hset_slice)
    14811527
    1482 %-----------------------------------------------------------------------
     1528%------------------------------------------------------------------------
     1529% --- called by menu bar Tools/LIF calibration
    14831530function MenuLIFCalib_Callback(hObject, eventdata, handles)
    14841531%------------------------------------------------------------------------
     
    15981645end
    15991646XmlData.LIFCalib.RefLineCoord=LineData{3}.Coord;
    1600 
    1601 %% rescale the image
    1602 % [nby,nbx]=size(UvData.Field.A);
    1603 % x=linspace(UvData.Field.Coord_x(1),UvData.Field.Coord_x(2),nbx)-nbx/2;
    1604 % y=linspace(UvData.Field.Coord_y(1),UvData.Field.Coord_y(2),nby)-nby/2;
    1605 % [X,Y]=meshgrid(x,y);
    1606 %coeff_quad=0.15*4/(nbx*nbx);% image luminosity reduced by 10% at the edge
    1607 %UvData.Field.A=double(UvData.Field.A).*(1+coeff_quad*(X.*X+Y.*Y));
    16081647
    16091648%% display the current image in polar axes with origin at the  illumination source
     
    16561695AX=DataPol.radius;
    16571696AY=DataPol.theta;
    1658 % dX=(AX(2)-AX(1))/(npx-1);
    1659 % dY=(AY(1)-AY(2))/(npy-1);%mesh of new pixels
    16601697[R,Theta]=meshgrid(linspace(AX(1),AX(end),npx),linspace(AY(1),AY(end),npy));%matrix of radius and angles with the same size as DataPol
    16611698A=R.*Anorm;
     
    16781715gamma_coeff=NaN(1,npy);
    16791716fitlength=NaN(1,npy);
    1680 %[ThetaMask,RMask] = cart2pol(MaskData.Coord(:,1)-x0,MaskData.Coord(:,2)-y0);
    1681 %ThetaMask=ThetaMask*180/pi
    16821717for iY=1:npy% loop on the y index of the image in polar coordinate
    16831718    ALine=A(iY,:);%profile of image luminosity log (vs radial index)
     
    17901825end
    17911826
    1792 
    1793 
    1794 %------------------------------------------------------------------------
    1795     function MenuMask_Callback(hObject, eventdata, handles)
    1796         %------------------------------------------------------------------------
    1797         UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface
    1798         ListObj=UvData.ProjObject;
    1799         select=zeros(1,numel(ListObj));
    1800         for iobj=1:numel(ListObj);
    1801             if strcmp(ListObj{iobj}.ProjMode,'mask_inside')||strcmp(ListObj{iobj}.ProjMode,'mask_outside')
    1802                 select(iobj)=1;
    1803             end
    1804         end
    1805         val=find(select);
    1806         if isempty(val)
    1807             msgbox_uvmat('ERROR','polygons must be first created by Projection object/mask polygon in the menu bar');
     1827%------------------------------------------------------------------------
     1828% --- called by menu bar Tools/make mask: produces a mask image from existing projection objects with ProjMode='mask inside' or 'mask_outside
     1829function MenuMask_Callback(hObject, eventdata, handles)
     1830%------------------------------------------------------------------------
     1831UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface
     1832
     1833%% selects the appropriate projection objects
     1834select=false(1,numel(UvData.ProjObject));% selection flag on the list of projection objects, false by default
     1835for iobj=1:numel(UvData.ProjObject)
     1836    if ismember(UvData.ProjObject{iobj}.ProjMode,{'mask_inside','mask_outside','inside'}) &&...
     1837            isfield(UvData.ProjObject{iobj},'Coord') && isfield(UvData.ProjObject{iobj},'Type')% avoid empty or other wrong objects in the list
     1838        select(iobj)=true;% select only the objects with appropriate projection mode
     1839    end
     1840end
     1841val=find(select);% indices of the selected objects
     1842if isempty(val)
     1843    msgbox_uvmat('ERROR','projection objects with ProjMode=mask_inside or mask_outside must be first created');
     1844    return
     1845else
     1846    ProjObject=UvData.ProjObject(val);%list of appropriate objects to use
     1847end
     1848set(handles.ListObject,'Value',val);% indicate the used object in the list
     1849
     1850%% initialise the flag image for mask
     1851if ~isfield(UvData.Field,'A')
     1852    msgbox_uvmat('ERROR','an image needs to be opened to set the mask size');
     1853    return
     1854end
     1855npx=size(UvData.Field.A,2);
     1856npy=size(UvData.Field.A,1);
     1857xi=0.5:npx-0.5;
     1858yi=0.5:npy-0.5;
     1859[Xi,Yi]=meshgrid(xi,yi);
     1860flag=true(npy,npx);
     1861
     1862%% scan the list of the selected projection objects
     1863for iobj=1:numel(ProjObject)
     1864    flagobj=true(npy,npx);
     1865    testphys=false; %coordinates in pixels by default
     1866    if isfield(ProjObject{iobj},'CoordUnit') && ~isequal(ProjObject{iobj}.CoordUnit,'pixel')
     1867        if isfield(UvData,'XmlData')
     1868            if isfield(UvData.XmlData{1},'GeometryCalib')
     1869                Calib=UvData.XmlData{1}.GeometryCalib;
     1870                testphys=true; %flag to transform object coordinates into pixels
     1871                Slice=[];% check for slices in 3D
     1872                if isfield(UvData.XmlData{1},'Slice')
     1873                    Slice=UvData.XmlData{1}.Slice;
     1874                end
     1875            end
     1876        end
     1877    end
     1878    X=ProjObject{iobj}.Coord(:,1);
     1879    Y=ProjObject{iobj}.Coord(:,2);
     1880    if testphys% transform the object into polygon, then to pixel coordinates       
     1881        if strcmp(ProjObject{iobj}.Type,'ellipse')% transform into polygon
     1882            perimeter=2*pi*ProjObject{iobj}.RangeX*ProjObject{iobj}.RangeY;
     1883            NbPoint=ceil(perimeter/UvData.Field.CoordMesh);% estimate the number of interpolation points according to estimated field mesh
     1884            Theta=2*pi*(1:NbPoint)/NbPoint; %set of  NbPoint angles       
     1885            X=X+ProjObject{iobj}.RangeX*cos(Theta);% correspondfing x positions
     1886            Y=Y+ProjObject{iobj}.RangeY*sin(Theta);% correspondfing y positions
     1887        elseif strcmp(ProjObject{iobj}.Type,'rectangle')%
     1888            RangeX=ProjObject{iobj}.RangeX;% half side of the rectangle
     1889            RangeY=ProjObject{iobj}.RangeY;% y axis of the ellipse
     1890            Xflag=[X-RangeX X+RangeX X+RangeX X-RangeX];% coordinates of the corners
     1891            Yflag=[Y-RangeY Y-RangeY Y+RangeY Y+RangeY];
     1892        else %polygon
     1893            Xflag=X';Yflag=Y';
     1894            Xflag=[Xflag X(1)];Yflag=[Yflag Y(1)];% close the polygon before interpolation
     1895        end
     1896        if ~strcmp(ProjObject{iobj}.Type,'ellipse')% interpolate between flag points
     1897            X=[]; Y=[];
     1898            for iflag=1:numel(Xflag)-1
     1899                SegmentLength=sqrt((Xflag(iflag+1)-Xflag(iflag))^2+(Yflag(iflag+1)-Yflag(iflag))^2);
     1900                NbPoint=ceil(SegmentLength/UvData.Field.CoordMesh);
     1901                X=[X Xflag(iflag)+((0:NbPoint-1)/NbPoint)*(Xflag(iflag+1)-Xflag(iflag))];% interpolate between 'flag points'
     1902                Y=[Y Yflag(iflag)+((0:NbPoint-1)/NbPoint)*(Yflag(iflag+1)-Yflag(iflag))];
     1903            end
     1904        end
     1905        ProjObject{iobj}.Type='polygon';
     1906        pos=[X' Y' zeros(numel(X),1)];% create the matrix for transform to pixel coordinates
     1907        % introduce the plane of cut in 3D case
     1908        if isfield(Slice,'SliceCoord') && length(Slice.SliceCoord)>=3
     1909            if isfield(Slice,'SliceAngle')&&~isequal(Slice.SliceAngle,[0 0 0])
     1910                om=norm(Slice.SliceAngle);%norm of rotation angle in radians
     1911                OmAxis=Slice.SliceAngle/om; %unit vector marking the rotation axis
     1912                cos_om=cos(pi*om/180);
     1913                sin_om=sin(pi*om/180);
     1914                pos=cos_om*pos+sin_om*cross(OmAxis,pos)+(1-cos_om)*(OmAxis*pos')*OmAxis;
     1915            end
     1916            pos(:,1)=pos(:,1)+Slice.SliceCoord(1);
     1917            pos(:,2)=pos(:,2)+Slice.SliceCoord(2);
     1918            pos(:,3)=pos(:,3)+Slice.SliceCoord(3);
     1919        end
     1920        [X,Y]=px_XYZ(Calib,Slice,pos(:,1),pos(:,2),pos(:,3));% transform to pixel coordinates
     1921    end
     1922    if strcmp(ProjObject{iobj}.Type,'polygon')
     1923        flagobj=~inpolygon(Xi,Yi,X',Y');%=0 inside the polygon, 1 outside
     1924    elseif isequal(ProjObject{iobj}.Type,'ellipse')
     1925        RangeX=max(ProjObject{iobj}.RangeX);
     1926        RangeY=max(ProjObject{iobj}.RangeY);
     1927        X2Max=RangeX*RangeX;
     1928        Y2Max=RangeY*RangeY;
     1929        distX=(Xi-ProjObject{iobj}.Coord(1,1));
     1930        distY=(Yi-ProjObject{iobj}.Coord(1,2));
     1931        flagobj=(distX.*distX/X2Max+distY.*distY/Y2Max)>1;
     1932    elseif isequal(ProjObject{iobj}.Type,'rectangle')
     1933        distX=abs(Xi-ProjObject{iobj}.Coord(1,1));
     1934        distY=abs(Yi-ProjObject{iobj}.Coord(1,2));
     1935        flagobj=distX>max(ProjObject{iobj}.RangeX) | distY>max(ProjObject{iobj}.RangeY);
     1936    end
     1937    if isequal(ProjObject{iobj}.ProjMode,'mask_outside')
     1938        flagobj=~flagobj;
     1939    end
     1940    flag=flag & flagobj;% concatene the mask flag
     1941end
     1942imflag=uint8(255*(0.392+0.608*flag));% =100 for flag=0 (PIV vectors not computed when imflag<200)
     1943imflag=flip(imflag,1);
     1944
     1945%% display the mask image for checking
     1946hfigmask=figure;
     1947set(hfigmask,'Name','mask image')
     1948vec=linspace(0,1,256);%define a linear greyscale colormap
     1949map=[vec' vec' vec'];
     1950colormap(map)
     1951image(imflag);
     1952
     1953%% propose a mask name
     1954RootPath=get(handles.RootPath,'String');
     1955SubDir=get(handles.SubDir,'String');
     1956maskindex=get(handles.masklevel,'Value');
     1957mask_name=fullfile_uvmat(RootPath,[SubDir '.mask'],'mask','.png','_1',maskindex);
     1958answer=msgbox_uvmat('INPUT_TXT','mask file name:', mask_name);
     1959
     1960%% save the mask as requested
     1961if ~strcmp(answer,'Cancel')
     1962    mask_dir=fileparts(answer);
     1963    if ~exist(mask_dir,'dir')
     1964        [success,msg]=mkdir(mask_dir);
     1965        if success==0
     1966            msgbox_uvmat('ERROR',['cannot create ' mask_dir ': ' msg]);%error message for directory creation
    18081967            return
    1809         else
    1810             set(handles.ListObject,'Value',val);
    1811             flag=1;
    1812             if ~isfield(UvData.Field,'A')
    1813                 msgbox_uvmat('ERROR','an image needs to be opened to set the mask size');
    1814                 return
    1815             end
    1816             npx=size(UvData.Field.A,2);
    1817             npy=size(UvData.Field.A,1);
    1818             xi=0.5:npx-0.5;
    1819             yi=0.5:npy-0.5;
    1820             [Xi,Yi]=meshgrid(xi,yi);
    1821             for iobj=1:length(UvData.ProjObject)
    1822                 ObjectData=UvData.ProjObject{iobj};
    1823                 if isfield(ObjectData,'ProjMode') &&(isequal(ObjectData.ProjMode,'mask_inside')||isequal(ObjectData.ProjMode,'mask_outside'));
    1824                     flagobj=1;
    1825                     testphys=0; %coordinates in pixels by default
    1826                     if isfield(ObjectData,'CoordUnit') && ~isequal(ObjectData.CoordUnit,'pixel')
    1827                         if isfield(UvData,'XmlData')&& isfield(UvData.XmlData{1},'GeometryCalib')
    1828                             Calib=UvData.XmlData{1}.GeometryCalib;
    1829                             testphys=1;
    1830                         end
    1831                     end
    1832                     if isfield(ObjectData,'Coord')&& isfield(ObjectData,'Type')
    1833                         if isequal(ObjectData.Type,'polygon')
    1834                             X=ObjectData.Coord(:,1);
    1835                             Y=ObjectData.Coord(:,2);
    1836                             if testphys
    1837                                 pos=[X Y zeros(size(X))];
    1838                                 if isfield(Calib,'SliceCoord') && length(Calib.SliceCoord)>=3
    1839                                     if isfield(Calib,'SliceAngle')&&~isequal(Calib.SliceAngle,[0 0 0])
    1840                                         om=norm(Calib.SliceAngle);%norm of rotation angle in radians
    1841                                         OmAxis=Calib.SliceAngle/om; %unit vector marking the rotation axis
    1842                                         cos_om=cos(pi*om/180);
    1843                                         sin_om=sin(pi*om/180);
    1844                                         pos=cos_om*pos+sin_om*cross(OmAxis,pos)+(1-cos_om)*(OmAxis*pos')*OmAxis;
    1845                                     end
    1846                                     pos(:,1)=pos(:,1)+Calib.SliceCoord(1);
    1847                                     pos(:,2)=pos(:,2)+Calib.SliceCoord(2);
    1848                                     pos(:,3)=pos(:,3)+Calib.SliceCoord(3);
    1849                                 end
    1850                                 [X,Y]=px_XYZ(Calib,Slice,pos(:,1),pos(:,2),pos(:,3));
    1851                             end
    1852                             flagobj=~inpolygon(Xi,Yi,X',Y');%=0 inside the polygon, 1 outside
    1853                         elseif isequal(ObjectData.Type,'ellipse')
    1854                             if testphys
    1855                                 %[X,Y]=px_XYZ(Calib,X,Y,0);% TODO:create a polygon boundary and transform to phys
    1856                             end
    1857                             RangeX=max(ObjectData.RangeX);
    1858                             RangeY=max(ObjectData.RangeY);
    1859                             X2Max=RangeX*RangeX;
    1860                             Y2Max=RangeY*RangeY;
    1861                             distX=(Xi-ObjectData.Coord(1,1));
    1862                             distY=(Yi-ObjectData.Coord(1,2));
    1863                             flagobj=(distX.*distX/X2Max+distY.*distY/Y2Max)>1;
    1864                         elseif isequal(ObjectData.Type,'rectangle')
    1865                             if testphys
    1866                                 %[X,Y]=px_XYZ(Calib,X,Y,0);% TODO:create a polygon boundary and transform to phys
    1867                             end
    1868                             distX=abs(Xi-ObjectData.Coord(1,1));
    1869                             distY=abs(Yi-ObjectData.Coord(1,2));
    1870                             flagobj=distX>max(ObjectData.RangeX) | distY>max(ObjectData.RangeY);
    1871                         end
    1872                         if isequal(ObjectData.ProjMode,'mask_outside')
    1873                             flagobj=~flagobj;
    1874                         end
    1875                         flag=flag & flagobj;
    1876                     end
    1877                 end
    1878             end
    1879             %mask name
    1880             RootPath=get(handles.RootPath,'String');
    1881             SubDir=get(handles.SubDir,'String');
    1882             RootFile=get(handles.RootFile,'String');
    1883             if ~isempty(RootFile)&&(isequal(RootFile(1),'/')|| isequal(RootFile(1),'\'))
    1884                 RootFile(1)=[];
    1885             end
    1886             list=get(handles.masklevel,'String');
    1887             masknumber=num2str(length(list));
    1888             maskindex=get(handles.masklevel,'Value');
    1889             mask_name=fullfile_uvmat(RootPath,[SubDir '.mask'],'mask','.png','_1',maskindex);
    1890             imflag=uint8(255*(0.392+0.608*flag));% =100 for flag=0 (vectors not computed when 20<imflag<200)
    1891             imflag=flipdim(imflag,1);
    1892            
    1893             %display the mask
    1894             hfigmask=figure;
    1895             set(hfigmask,'Name','mask image')
    1896             vec=linspace(0,1,256);%define a linear greyscale colormap
    1897             map=[vec' vec' vec'];
    1898             colormap(map)
    1899             image(imflag);
    1900             answer=msgbox_uvmat('INPUT_TXT','mask file name:', mask_name);
    1901             if ~strcmp(answer,'Cancel')
    1902                 mask_dir=fileparts(answer);
    1903                 if ~exist(mask_dir,'dir')
    1904                     [success,msg]=mkdir(mask_dir);
    1905                     if success==0
    1906                         msgbox_uvmat('ERROR',['cannot create ' mask_dir ': ' msg]);%error message for directory creation
    1907                         return
    1908                     end
    1909                     [success,msg] = fileattrib(mask_dir,'+w','g','s');% allow writing access for the group of users, recursively in the folder
    1910                     if success==0
    1911                         msgbox_uvmat('WARNING',{['unable to set group write access to ' mask_dir ':']; msg});%error message for directory creation
    1912                     end
    1913                 end
    1914                 try
    1915                     imwrite(imflag,answer,'BitDepth',8);
    1916                 catch ME
    1917                     msgbox_uvmat('ERROR',ME.message)
    1918                 end
    1919             end
    1920             set(handles.ListObject,'Value',1)
    1921         end
    1922 
    1923 %------------------------------------------------------------------------
    1924 %-- open the GUI set_grid.fig to create grid
     1968        end
     1969        [success,msg] = fileattrib(mask_dir,'+w','g','s');% allow writing access for the group of users, recursively in the folder
     1970        if success==0
     1971            msgbox_uvmat('WARNING',{['unable to set group write access to ' mask_dir ':']; msg});%error message for directory creation
     1972        end
     1973    end
     1974    try
     1975        imwrite(imflag,answer,'BitDepth',8);
     1976    catch ME
     1977        msgbox_uvmat('ERROR',ME.message)
     1978    end
     1979end
     1980set(handles.ListObject,'Value',1)
     1981
     1982%------------------------------------------------------------------------
     1983%-- open the GUI set_grid.fig to create grid (TODO: check the relevance)
    19251984function MenuGrid_Callback(hObject, eventdata, handles)
    19261985%------------------------------------------------------------------------
     
    19341993FileName=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt];
    19351994UvData=get(handles.uvmat,'UserData');
    1936 % CoordList=get(handles.TransformName,'String');
    1937 % val=get(handles.TransformName,'Value');
    19381995set_grid(FileName,UvData.Field);% call the set_object interface
    19391996
    19401997%------------------------------------------------------------------------
    1941 %-- introduce a section FileSeries in the xml file ImaDoc to virtually relabel frames
    1942 % --------------------------------------------------------------------
     1998%--- called by menu bar Tools/relabel series: introduce a section FileSeries in the xml file ImaDoc to virtually relabel frames
    19431999function MenuRelabelFrames_Callback(hObject, eventdata, handles)
    1944 
     2000%------------------------------------------------------------------------
    19452001[RootPath,SubDir,RootFile,FileIndex,FileExt]=read_file_boxes(handles);
    19462002FileName=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt];
     
    19812037    case 'rdvision'%TO CHECK******
    19822038        check_time_rdvision(FileName,XmlData)
    1983     case 'telopsIR'
    1984        
     2039    case 'telopsIR'     
    19852040        DirContent=dir(fullfile(RootPath,SubDir));
    19862041        NbFiles=0;
     
    42494304        end
    42504305    end
    4251    
     4306
    42524307    set(handles.uvmat,'UserData',UvData)
    42534308   
     
    43744429    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    43754430    % display menus and plot histograms
    4376     test_v=0;
     4431    %test_v=0;
    43774432    if ~isempty(menu_histo)
    43784433        set(handles.HistoMenu,'Value',1)
    43794434        set(handles.HistoMenu,'String',menu_histo)
    4380         set(handles.Histogram,'Visible','on')
     4435        set(handles.Histogram_txt,'Visible','on')
    43814436        set(handles.HistoMenu,'Visible','on')
    43824437        set(handles.LogLinHisto,'Visible','on')
     
    62906345function LogLinHisto_Callback(hObject, eventdata, handles)
    62916346HistoMenu_Callback(hObject, eventdata, handles)
     6347
     6348
     6349% --------------------------------------------------------------------
     6350function MenuCreateMirror_Callback(hObject, eventdata, handles)
     6351% hObject    handle to MenuCreateMirror (see GCBO)
     6352% eventdata  reserved - to be defined in a future version of MATLAB
     6353% handles    structure with handles and user data (see GUIDATA)
Note: See TracChangeset for help on using the changeset viewer.