Changeset 998 for trunk/src


Ignore:
Timestamp:
Feb 17, 2017, 12:09:25 PM (8 years ago)
Author:
g7moreau
Message:
  • Remove tab and space and end of line
Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/editxml.m

    r977 r998  
    111111DataIn=get(heditxml,'UserData');
    112112if ~isempty(xs)
    113         xs_node=list.xs_uid(ind);%xs_node of the subelement #ind
    114         [nodeup,path,xs_element,xs_subelem]=scan_schema(xs,xs_node);
    115         [element,subelem]=get_xml(t,path,xs_element,NewRootUid,xs_subelem);
    116         update_list(handles,path,xs_element,element,NewRootUid,xs_subelem,subelem);
    117         if xs_element.subtest     
     113    xs_node=list.xs_uid(ind);%xs_node of the subelement #ind
     114    [nodeup,path,xs_element,xs_subelem]=scan_schema(xs,xs_node);
     115    [element,subelem]=get_xml(t,path,xs_element,NewRootUid,xs_subelem);
     116    update_list(handles,path,xs_element,element,NewRootUid,xs_subelem,subelem);
     117    if xs_element.subtest     
    118118        DataIn.CurrentUid=[DataIn.CurrentUid NewRootUid];%record new current uid
    119119        DataIn.xs_CurrentUid=[DataIn.xs_CurrentUid xs_node];%record the new curent schema uid
    120         end
     120    end
    121121   
    122122%     %update the import file display
     
    174174    else
    175175        [xs_nodeup,path,xs_element,xs_subelem]=scan_schema(xs,xs_nodeup);
    176                 [element,subelem]=get_xml(t,path,xs_element,nodeup,xs_subelem);
    177                 update_list(handles,path,xs_element,element,nodeup,xs_subelem,subelem);
     176        [element,subelem]=get_xml(t,path,xs_element,nodeup,xs_subelem);
     177        update_list(handles,path,xs_element,element,nodeup,xs_subelem,subelem);
    178178        %update the import file display
    179179        if isfield(DataIn,'h_ref')&ishandle(DataIn.h_ref)
     
    369369else
    370370    DataIn.xs_CurrentUid=find(xs,'/xs:schema/xs:element');%uid of the root element in the schema
    371         [nodeup,path,xs_element,xs_subelem]=scan_schema(xs,DataIn.xs_CurrentUid);%scan the schema at the root level
    372         [element,subelem]=get_xml(t,path,xs_element,1,xs_subelem);% read the corresponding xml data
    373         update_list(handles,path,xs_element,element,1,xs_subelem,subelem);%update the display of information on the interface
     371    [nodeup,path,xs_element,xs_subelem]=scan_schema(xs,DataIn.xs_CurrentUid);%scan the schema at the root level
     372    [element,subelem]=get_xml(t,path,xs_element,1,xs_subelem);% read the corresponding xml data
     373    update_list(handles,path,xs_element,element,1,xs_subelem,subelem);%update the display of information on the interface
    374374end
    375375set(heditxml,'UserData',DataIn);%store the new input xml file name
     
    655655up=1;
    656656if node>0
    657         nodeup=node;
    658         while up==1;
     657    nodeup=node;
     658    while up==1;
    659659        nodeup=get(t,nodeup,'parent');%move up to the parent in the tree
    660660        if isempty(nodeup)
     
    671671            end
    672672        end
    673         end
    674         element.attrup=attrup;
     673    end
     674    element.attrup=attrup;
    675675end
    676676%find the subelement properties in the xml file
     
    10431043    list_element=[];
    10441044%      Data.CurrentUid=[Data.CurrentUid root_uid]%record new current uid
    1045         for iline=1:length(list_uid)
     1045    for iline=1:length(list_uid)
    10461046        element=get(t,list_uid(iline));
    10471047        if isfield(element,'type')&isequal(element.type,'element')
     
    10711071            end
    10721072        end
    1073         end
     1073    end
    10741074    set(handles.list_element,'Value',1)%select the first line of list_element by default
    1075         set(handles.list_element,'String',cell2tab(list_element,' ') )
     1075    set(handles.list_element,'String',cell2tab(list_element,' ') )
    10761076    list.uid=list_uid;
    1077         set(handles.list_element,'UserData',list)
     1077    set(handles.list_element,'UserData',list)
    10781078end
    10791079%---------------------------------------------------------
     
    14151415% up=1
    14161416% if node>0
    1417 %       nodeup=node;
    1418 %       while up==1;
     1417%     nodeup=node;
     1418%     while up==1;
    14191419%         nodeup=get(t,nodeup,'parent');%move up to the parent in the tree
    14201420%         if isempty(nodeup)
     
    14311431%             end
    14321432%         end
    1433 %       end
    1434 %       element.attrup=attrup;
     1433%     end
     1434%     element.attrup=attrup;
    14351435% end
    14361436% %find the subelement properties in the xml file
  • trunk/src/series.m

    r997 r998  
    30233023if get(handles.EditObject,'Value')
    30243024    set(handles.ViewObject,'Value',0)
    3025         UserData=get(handles.series,'UserData');
     3025    UserData=get(handles.series,'UserData');
    30263026    hset_object=set_object(UserData.ProjObject);
    30273027    set(hset_object,'Name','edit_object_series')
  • trunk/src/uvmat.m

    r984 r998  
    1 %'uvmat': function associated with the GUI 'uvmat.fig' for images and data field visualization 
     1%'uvmat': function associated with the GUI 'uvmat.fig' for images and data field visualization
    22%------------------------------------------------------------------------
    33% function huvmat=uvmat(input)
     
    5252%
    5353% 1) Input filenames are determined by MenuBrowse (first field), MenuBrowseCampaign
    54 % (second field), or by the stored file name .FileName_1, or as an input of uvmat. 
     54% (second field), or by the stored file name .FileName_1, or as an input of uvmat.
    5555% 2) These functions call 'uvmat/display_file_name.m' which detects the file series, and fills the file index boxes
    5656% 3) Then 'uvmat/update_rootinfo.m' Updates information about a new field series (indices to scan, timing, calibration from an xml file)
     
    6161%    %%%%%%%%  structure of uvmat/refresh_field.m %%%%%%%%
    6262%
    63 %           Main input open       second input open_1       
    64 %                    |                   | 
     63%           Main input open       second input open_1
     64%                    |                   |
    6565%             read_field.m            read_field.m
    6666%                    |                   |
    67 %                 Field{1}            Field{2}               
    68 %                    |                   |                                 
    69 %                    --->transform fct<---             transform (e.g. phys.m) and combine input fieldname 
    70 %                            |                                   
     67%                 Field{1}            Field{2}
     68%                    |                   |
     69%                    --->transform fct<---             transform (e.g. phys.m) and combine input fieldname
     70%                            |
    7171%                        (tps_coeff_field.m)               calculate tps coefficients (for filter projection or spatial derivatives).
    7272%                            |
    7373%                       UvData.Field-------------->Histogram
    7474%               _____________|____________
    75 %              |                          |                   
    76 %        proj_field.m               proj_field.m       project the field on the projection objects (use set_field_list.m)           
     75%              |                          |
     76%        proj_field.m               proj_field.m       project the field on the projection objects (use set_field_list.m)
    7777%              |                          |
    7878%         UvData.PlotAxes          ViewData.PlotAxes (on view_field)
     
    9292% If the scalar exists in an input open (image or scalar stored under its
    9393% name in a netcdf open), it is directly read at the level of Field{1}or Field{2}.
    94 % Else only its name AName is recorded in Field{i}, and its field is then calculated 
     94% Else only its name AName is recorded in Field{i}, and its field is then calculated
    9595%by the fuction calc_scal after the coordinate transform or after projection on an CheckEditObject
    96      
     96
    9797% Properties attached to plotting figures (standard Matlab properties):
    9898%    'CurrentAxes'= gca or get(gcf,'CurrentAxes');
     
    100100%    'CurrentCharacter'=get(gcf,'CurrentCharacter'): last character typed  over the figure where the mouse is positioned
    101101%    'WindowButtonMotionFcn': function permanently called by mouse motion over the figure
    102 %    'KeyPressFcn': function called by pressing a key on the key board 
     102%    'KeyPressFcn': function called by pressing a key on the key board
    103103%    'WindowButtonDownFcn':  function called by pressing the mouse over the  figure
    104104%    'WindowButtonUpFcn': function called by releasing  the mouse pressure over the  figure
     
    107107%    'CurrentPoint'=get(gca,'CurrentPoint'); (standard Matlab) same as for the figure, but position in plot axes.
    108108%     AxeData:=get(gca,'UserData');
    109 %     AxeData.Drawing  = create: create a new object 
     109%     AxeData.Drawing  = create: create a new object
    110110%                       = deform: modify an existing object by moving its defining create
    111111%                      = off: no current drawing action
     
    200200set(hObject,'WindowButtonMotionFcn',{'mouse_motion',handles})%set mouse action functio
    201201set(hObject,'WindowButtonDownFcn',{'mouse_down'})%set mouse click action function
    202 set(hObject,'WindowButtonUpFcn',{'mouse_up',handles}) 
     202set(hObject,'WindowButtonUpFcn',{'mouse_up',handles})
    203203set(hObject,'DeleteFcn',{@closefcn})%
    204204set(hObject,'ResizeFcn',{@ResizeFcn,handles})%
     
    260260    if ishandle(handles.UVMAT_title)
    261261        delete(handles.UVMAT_title)
    262     end   
     262    end
    263263    if isstruct(input)
    264264        if isfield(input,'InputFile')
     
    289289    %% check the path and date of modification of all functions in uvmat
    290290    path_to_uvmat=which ('uvmat');% check the path detected for source file uvmat
    291     [infomsg,date_str,svn_info]=check_files;%check the path of the functions called by uvmat.m   
     291    [infomsg,date_str,svn_info]=check_files;%check the path of the functions called by uvmat.m
    292292    date_str=['last modification: ' date_str];
    293293    if ishandle(handles.UVMAT_title)
     
    312312% --- Outputs from this function are returned to the command menuline.
    313313function varargout = uvmat_OutputFcn(hObject, eventdata, handles)
    314 %------------------------------------------------------------------------   
     314%------------------------------------------------------------------------
    315315varargout{1} = handles.output;% the only output argument is the handle to the GUI figure
    316316
     
    344344%--- activated when resizing the GUI view_field
    345345 function ResizeFcn(gcbo,eventdata,handles)
    346 %------------------------------------------------------------------------     
     346%------------------------------------------------------------------------
    347347set(handles.uvmat,'Units','pixels')
    348348size_fig=get(handles.uvmat,'Position');
     
    581581% --------------------------------------------------------------------
    582582function MenuExportAxis_Callback(hObject, eventdata, handles)
    583 % --------------------------------------------------------------------   
     583% --------------------------------------------------------------------
    584584ListFig=findobj(allchild(0),'Type','figure');
    585585nb_option=0;
     
    644644FileBase=fullfile(RootPath,RootFile);
    645645
    646 %% create a fig and axis for movies 
     646%% create a fig and axis for movies
    647647figure_movie=findobj(allchild(0),'name','figure_movie');
    648648
     
    659659time_str=get(handles.TimeValue,'String');
    660660if ~isempty(time_str)
    661     htitle=get(newaxes,'Title'); 
     661    htitle=get(newaxes,'Title');
    662662    set(htitle,'String',['t=' time_str])
    663663end
     
    674674Position(4)=Position(4)/2;
    675675hfig=findobj(allchild(0),'Tag','set_movie');
    676 if ~isempty(hfig),delete(hfig), end; %delete existing version of the GUI 
     676if ~isempty(hfig),delete(hfig), end; %delete existing version of the GUI
    677677hfig=figure('name','set_movie','tag','set_movie','MenuBar','none','NumberTitle','off','Units','pixels',...
    678678    'Position',Position);
     
    714714hMovieSize=findobj(hset_movie,'Tag','MovieSize');
    715715nbpix=[640 480; 720 480; 1280 720];
    716 SizeOption=get(hMovieSize,'Value');   
    717 nbpix=nbpix(SizeOption,:); 
    718    
    719 %% look for movie fig 
     716SizeOption=get(hMovieSize,'Value');
     717nbpix=nbpix(SizeOption,:);
     718
     719%% look for movie fig
    720720figure_movie=findobj(allchild(0),'name','figure_movie');
    721721if isempty(figure_movie)
     
    726726    newaxes=copyobj(hhuvmat.PlotAxes,figure_movie);%new plotting axes in the new figure
    727727    set(newaxes,'Tag','movieaxes')
    728    
     728
    729729    %% display time if defined in uvmat
    730730    time_str=get(hhuvmat.TimeValue,'String');
     
    745745% function called by pressing APPLY in the GUI  set_movie
    746746function set_movie_START_Callback(hObject,eventdata)
    747 %------------------------------------------------------------------------   
     747%------------------------------------------------------------------------
    748748%% read info from the GUI set_movie
    749749hset_movie=get(hObject,'parent');
     
    773773    while testexist==2
    774774        backup=[backup '~'];
    775         testexist=exist(backup,'file');     
     775        testexist=exist(backup,'file');
    776776    end
    777777    [success,message]=copyfile(MovieName,backup);%make backup of the existing file
    778778    if isequal(success,1)
    779         delete(MovieName)%delete existing file 
     779        delete(MovieName)%delete existing file
    780780    else
    781781        msgbox_uvmat('ERROR',message)
    782782        return
    783     end 
     783    end
    784784end
    785785%create avi open
     
    801801for i=1:FrameNumber
    802802    if get(hhuvmat.speed,'Value')~=0 && isequal(get(hhuvmat.MenuExportMovie,'BusyAction'),'queue') % enable STOP command
    803             runpm(hObject,eventdata,hhuvmat,increment)% run plus 
     803            runpm(hObject,eventdata,hhuvmat,increment)% run plus
    804804            drawnow
    805805            time_str=get(hhuvmat.TimeValue,'String');
     
    818818% function called by pressing APPLY in the GUI  set_slices
    819819function set_movie_Cancel_Callback(hObject,eventdata)
    820 %------------------------------------------------------------------------   
     820%------------------------------------------------------------------------
    821821delete(hObject)
    822822
     
    937937%% desactivate concurrent tools
    938938set(handles.MenuRuler,'checked','off')%desactivate ruler
    939 hgeometry_calib=findobj(allchild(0),'tag','geometry_calib');% search the GUI geometric calibration 
     939hgeometry_calib=findobj(allchild(0),'tag','geometry_calib');% search the GUI geometric calibration
    940940if ishandle(hgeometry_calib)
    941941    hhgeometry_calib=guidata(hgeometry_calib);
     
    10051005end
    10061006
    1007 hset_object=set_object(data,handles);% call the GUI set_object 
     1007hset_object=set_object(data,handles);% call the GUI set_object
    10081008hchild=get(hset_object,'children');
    10091009set(hchild,'enable','on')
     
    10111011if check_plot
    10121012    hhset_object=guidata(hset_object);
    1013     set_object('REFRESH_Callback',1,[],hhset_object);% call the GUI set_object 
     1013    set_object('REFRESH_Callback',1,[],hhset_object);% call the GUI set_object
    10141014end
    10151015set(handles.CheckViewField,'Visible','on')
     
    10581058    SubField_Callback(hObject, eventdata, handles)
    10591059end
    1060 UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface 
     1060UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface
    10611061
    10621062%% suppress competing tools
     
    10641064set(handles.CheckZoom,'Value',0)
    10651065set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7])
    1066 set(handles.ListObject,'Value',1) 
     1066set(handles.ListObject,'Value',1)
    10671067
    10681068%% initiate display of the GUI geometry_calib
     
    10741074FileName=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt];
    10751075set(handles.view_xml,'BackgroundColor',[1 1 0])%indicate the reading of the current xml file by geometry_calib
    1076 geometry_calib(FileName);% call the geometry_calib interface   
     1076geometry_calib(FileName);% call the geometry_calib interface
    10771077set(handles.view_xml,'BackgroundColor',[1 1 1])%indicate the end of reading of the current xml file by geometry_calib
    10781078set(handles.MenuCalib,'checked','on')% indicate that MenuCalib is activated, test used by mouse action
     
    10891089end
    10901090
    1091 UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface 
     1091UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface
    10921092% check=0;
    10931093if isfield(UvData,'XmlData')&&isfield(UvData.XmlData{1},'GeometryCalib')&& isfield(UvData.XmlData{1}.GeometryCalib,'SliceCoord')
     
    10961096    msgbox_uvmat('ERROR','3D geometric calibration needed before defining slices')
    10971097    return
    1098 end   
     1098end
    10991099SliceCoord=GeometryCalib.SliceCoord;
    11001100InterfaceCoord=min(SliceCoord(:,3));
     
    11061106if isfield(GeometryCalib,'CheckVolumeScan')
    11071107    CheckVolumeScan=GeometryCalib.CheckVolumeScan;
    1108 end     
     1108end
    11091109RefractionIndex=1.33;
    1110 CheckRefraction=0;% default value of the check box refraction 
     1110CheckRefraction=0;% default value of the check box refraction
    11111111if isfield(GeometryCalib,'RefractionIndex')
    11121112    RefractionIndex=GeometryCalib.RefractionIndex;
    11131113    CheckRefraction=1;
    1114 end     
     1114end
    11151115SliceAngle=[0 0 0];
    11161116if isfield(GeometryCalib,'SliceAngle')
     
    11261126Bottom=ScreenSize(4)-Height-40; %put fig at top right
    11271127hfig=findobj(allchild(0),'Tag','set_slice');
    1128 if ~isempty(hfig),delete(hfig), end; %delete existing version of the GUI 
     1128if ~isempty(hfig),delete(hfig), end; %delete existing version of the GUI
    11291129hfig=figure('name','set_slices','tag','set_slice','MenuBar','none','NumberTitle','off','Units','pixels','Position',[Left,Bottom,Width,Height],'UserData',GeometryCalib);
    11301130BackgroundColor=get(hfig,'Color');
     
    11971197% function called by selecting CheckRefraction in the GUI set_slices
    11981198function set_slice_CheckRefraction_Callback(hObject,eventdata)
    1199 %------------------------------------------------------------------------   
     1199%------------------------------------------------------------------------
    12001200hset_slice=get(hObject,'parent');
    12011201h_refraction(1)=findobj(hset_slice,'String','surface');
     
    12121212% function called by pressing APPLY in the GUI  set_slices
    12131213function set_slice_APPLY_Callback(hObject,eventdata)
    1214 %------------------------------------------------------------------------   
     1214%------------------------------------------------------------------------
    12151215set(hObject,'BackgroundColor',[1 1 0]);% paint button in yellow to indicate action
    12161216drawnow
     
    12541254elseif isfield(GeometryCalib,'RefractionIndex')
    12551255    GeometryCalib=rmfield(GeometryCalib,'RefractionIndex');
    1256     GeometryCalib=rmfield(GeometryCalib,'InterfaceCoord'); 
     1256    GeometryCalib=rmfield(GeometryCalib,'InterfaceCoord');
    12571257end
    12581258
     
    12751275% function called by pressing REPLICATE in the GUI  set_slices
    12761276function set_slice_REPLICATE_Callback(hObject,eventdata)
    1277 %------------------------------------------------------------------------ 
     1277%------------------------------------------------------------------------
    12781278set(hObject,'BackgroundColor',[1 1 0])
    12791279drawnow
     
    12941294        SubDirBase=regexprep(OutPut.DataSeries{idevice},'\..+$','');
    12951295        XmlFile=fullfile(OutPut.Campaign,OutPut.Experiment{ilist},[SubDirBase '.xml']);
    1296        
     1296
    12971297        % read the current xml file
    12981298        if  exist(XmlFile,'file')
     
    13201320                GeometryCalib=rmfield(GeometryCalib,'InterfaceCoord');
    13211321            end
    1322            
     1322
    13231323            % update the current xml file
    13241324            errormsg=update_imadoc(GeometryCalib,XmlFile,'GeometryCalib');% introduce the calibration data in the xml file
     
    13461346function MenuLIFCalib_Callback(hObject, eventdata, handles)
    13471347%------------------------------------------------------------------------
    1348 %% read UvData properties stored on the uvmat interface 
     1348%% read UvData properties stored on the uvmat interface
    13491349UvData=get(handles.uvmat,'UserData');
    13501350if isfield(UvData,'XmlData')&& isfield(UvData.XmlData{1},'GeometryCalib')
     
    13941394
    13951395%% display the current image in polar axes with origin at the  illumination source
    1396 currentdir=pwd; 
     1396currentdir=pwd;
    13971397uvmatpath=fileparts(which('uvmat'));
    13981398cd(fullfile(uvmatpath,'transform_field'));
     
    14641464    end
    14651465    % save the illumination origin
    1466     t=struct2xml(XmlData.Illumination,t,uid_illumination); 
     1466    t=struct2xml(XmlData.Illumination,t,uid_illumination);
    14671467    save(t,XmlFileName);
    14681468end
    1469    
     1469
    14701470
    14711471
     
    14731473function MenuMask_Callback(hObject, eventdata, handles)
    14741474%------------------------------------------------------------------------
    1475 UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface 
     1475UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface
    14761476ListObj=UvData.ProjObject;
    14771477select=zeros(1,numel(ListObj));
     
    15681568    imflag=uint8(255*(0.392+0.608*flag));% =100 for flag=0 (vectors not computed when 20<imflag<200)
    15691569    imflag=flipdim(imflag,1);
    1570    
     1570
    15711571    %display the mask
    15721572    hfigmask=figure;
     
    16061606set(handles.edit_vect,'Value',0)
    16071607edit_vect_Callback(hObject, eventdata, handles)
    1608 set(handles.ListObject,'Value',1)     
     1608set(handles.ListObject,'Value',1)
    16091609
    16101610%prepare display of the set_grid GUI
     
    17841784set(handles.uvmat,'Pointer','arrow')% set back the mouse pointer to arrow
    17851785
    1786 %------------------------------------------------------------------------ 
     1786%------------------------------------------------------------------------
    17871787% --- Fills the edit boxes RootPath, RootFile,NomType...from an input file name 'fileinput'
    17881788function errormsg=display_file_name(handles,fileinput,index)
     
    18991899                i2_s=i2_0;
    19001900            else
    1901                i2_s=i2; 
     1901               i2_s=i2;
    19021902            end
    19031903            j1_0=stra2num(get(handles.j1,'String'));
     
    19141914            end
    19151915        end
    1916        
     1916
    19171917        % synchronise indices of the second  input file if it exists
    19181918        if get(handles.SubField,'Value')==1% if the subfield button is activated, update the field numbers
     
    19431943            set(handles.FileIndex_1,'String',FileIndex_1)
    19441944        end
    1945        
     1945
    19461946        %enable other menus
    19471947        set(handles.MenuOpenCampaign,'Enable','on')
     
    19511951        set(handles.MenuTools,'Enable','on')
    19521952
    1953         % initiate input file series and inputfilerefresh the current field view:     
     1953        % initiate input file series and inputfilerefresh the current field view:
    19541954        update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileInfo,MovieObject,index);
    19551955
     
    20172017end
    20182018
    2019 %% read timing and total frame number from the current file (e.g. movie files) 
     2019%% read timing and total frame number from the current file (e.g. movie files)
    20202020TimeUnit='';%default
    20212021TimeName='';%default
     
    21902190            set(handles.TransformName,'Value',3); % phys transform by default if fixedLimits is off
    21912191        end
    2192         if isfield(GeometryCalib,'SliceCoord')           
     2192        if isfield(GeometryCalib,'SliceCoord')
    21932193           siz=size(GeometryCalib.SliceCoord);
    21942194           if siz(1)>1
     
    22042204           end
    22052205           slices_Callback([],[], handles)
    2206         end           
     2206        end
    22072207    end
    22082208end
     
    22572257set(handles.uvmat,'UserData',UvData)
    22582258
    2259 %% set index navigation options 
     2259%% set index navigation options
    22602260scan_option='i';%default
    22612261state_j='off'; %default
     
    22692269end
    22702270[ref_j,ref_i]=find(squeeze(i1_series(1,:,:)));
    2271 if ~isempty(j1_series) 
     2271if ~isempty(j1_series)
    22722272        state_j='on';
    22732273        if index==1
    22742274            if isequal(ref_i,ref_i(1)*ones(size(ref_j)))% if ref_i is always equal to its first value
    2275                 scan_option='j'; %scan j indext               
    2276             end 
     2275                scan_option='j'; %scan j indext
     2276            end
    22772277        end
    22782278end
     
    22862286    end
    22872287     set(handles.scan_i,'Value',1)
    2288      scan_i_Callback([],[], handles); 
     2288     scan_i_Callback([],[], handles);
    22892289else
    22902290    diff_ref_j=diff(ref_j);
     
    22962296    end
    22972297     set(handles.scan_j,'Value',1)
    2298      scan_j_Callback([],[], handles); 
     2298     scan_j_Callback([],[], handles);
    22992299end
    23002300set(handles.scan_j,'Visible',state_j)
     
    23092309end
    23102310
    2311 %% apply the effect of the transform fct and view the field 
     2311%% apply the effect of the transform fct and view the field
    23122312transform=get(handles.TransformPath,'UserData');
    23132313if index==2 && (~isa(transform,'function_handle')||nargin(transform)<3)
     
    23732373%------------------------------------------------------------------------
    23742374function update_ij(handles,index_rank)
    2375    
     2375
    23762376NomType=get(handles.NomType,'String');
    23772377
     
    24122412    set(handles.FileIndex_1,'BackgroundColor',[0.7 0.7 0.7])% mark the edit box in grey, then RUN0 will mark it in white for confirmation
    24132413end
    2414    
     2414
    24152415%------------------------------------------------------------------------
    24162416
     
    24482448for ilist=1:nbslice
    24492449    list_index{ilist,1}=num2str(ilist);
    2450 end   
     2450end
    24512451set(handles.masklevel,'String',list_index)
    24522452set(handles.masklevel,'Value',z)
     
    24652465end
    24662466option=get(handles.view_xml,'String');
    2467 if isequal(option,'view .xml')     
     2467if isequal(option,'view .xml')
    24682468    FileXml=fullfile(RootPath,[SubDir '.xml']);
    24692469    if ~exist(FileXml,'file')% case of civ files , removes the extension for subdir
     
    25582558
    25592559%% update mask image if the mask is new
    2560 if ~ (isfield(UvData,'MaskName') && isequal(UvData.MaskName,MaskName)) 
     2560if ~ (isfield(UvData,'MaskName') && isequal(UvData.MaskName,MaskName))
    25612561    UvData.MaskName=MaskName; %update the recorded name on UvData
    25622562    set(handles.uvmat,'UserData',UvData);
    25632563    if ~exist(MaskName,'file')
    25642564        if isfield(Mask,'maskhandle')&& ishandle(Mask.maskhandle)
    2565             delete(Mask.maskhandle)   
     2565            delete(Mask.maskhandle)
    25662566        end
    25672567    else
     
    25922592        end
    25932593        flagmask=MaskField.A < 200;
    2594        
     2594
    25952595        %make brown color image
    25962596        imflag(:,:,1)=0.9*flagmask;
    25972597        imflag(:,:,2)=0.7*flagmask;
    25982598        imflag(:,:,3)=zeros(size(flagmask));
    2599        
     2599
    26002600        %update mask image
    26012601        hmask=[]; %default
     
    26042604        end
    26052605        if ~isempty(hmask)
    2606             set(hmask,'CData',imflag)   
     2606            set(hmask,'CData',imflag)
    26072607            set(hmask,'AlphaData',flagmask*0.6)
    26082608            set(hmask,'XData',MaskField.Coord_x);
     
    26112611        else
    26122612            axes(handles.PlotAxes)
    2613             hold on   
     2613            hold on
    26142614            Mask.maskhandle=image(MaskField.Coord_x,MaskField.Coord_y,imflag,'Tag','mask','HitTest','off','AlphaData',0.6*ones(size(flagmask)));
    26152615            set(handles.CheckMask,'UserData',Mask)
     
    26252625%------------------------------------------------------------------------
    26262626% --- Executes on button press in runplus: make one step forward and call
    2627 % --- InputFileREFRESH. The step forward is along the fieldname series 1 or 2 depending on 
     2627% --- InputFileREFRESH. The step forward is along the fieldname series 1 or 2 depending on
    26282628% --- the scan_i and scan_j check box (exclusive each other)
    26292629function runplus_Callback(hObject, eventdata, handles)
     
    26342634increment=str2double(get(handles.num_IndexIncrement,'String')); %get the field increment d
    26352635if isnan(increment)% case of free increment: move to next available field index
    2636     increment='+'; 
     2636    increment='+';
    26372637end
    26382638errormsg=runpm(hObject,eventdata,handles,increment);
     
    26442644%------------------------------------------------------------------------
    26452645% --- Executes on button press in runmin: make one step backward and call
    2646 % --- InputFileREFRESH. The step backward is along the fieldname series 1 or 2 depending on 
     2646% --- InputFileREFRESH. The step backward is along the fieldname series 1 or 2 depending on
    26472647% --- the scan_i and scan_j check box (exclusive each other)
    26482648function runmin_Callback(hObject, eventdata, handles)
     
    26532653increment=-str2double(get(handles.num_IndexIncrement,'String')); %get the field increment d
    26542654if isnan(increment)% case of free increment: move to previous available field index
    2655     increment='-'; 
     2655    increment='-';
    26562656end
    26572657errormsg=runpm(hObject,eventdata,handles,increment);
     
    26702670increment=str2double(get(handles.num_IndexIncrement,'String')); %get the field increment d
    26712671if isnan(increment)% case of free increment: move to next available field index
    2672     increment='+'; 
     2672    increment='+';
    26732673end
    26742674set(handles.STOP,'Visible','on')
     
    27002700increment=-str2double(get(handles.num_IndexIncrement,'String')); %get the field increment d
    27012701if isnan(increment)% case of free increment: move to next available field index
    2702     increment='-'; 
     2702    increment='-';
    27032703end
    27042704set(handles.STOP,'Visible','on')
     
    27992799        end
    28002800    end
    2801    
     2801
    28022802% the pair i1-i2 or j1-j2 is free (check box CheckFixPair not selected): the list of existing indices recorded in UvData is used
    28032803else
     
    28702870        j2=UvData.j2_series{1}(ref_indices(end));
    28712871    end
    2872    
     2872
    28732873    % case of a second file series
    28742874    if sub_value
     
    29532953%% update the index counters if the index move is successfull
    29542954
    2955 if isempty(errormsg) 
     2955if isempty(errormsg)
    29562956    set(handles.i1,'String',num2stra(i1,NomType,1));
    29572957    if isequal(i2,i1)
     
    29672967    end
    29682968    if strcmp(NomType,'level')
    2969        indices=num2str(i1); 
     2969       indices=num2str(i1);
    29702970    else
    29712971    indices=fullfile_uvmat('','','','',NomType,i1,i2,j1,j2);
     
    29812981    else
    29822982        if isempty(i2), set(handles.i2,'String',''); end % suppress the second index display if not used
    2983         if isempty(j2), set(handles.j2,'String',''); end 
     2983        if isempty(j2), set(handles.j2,'String',''); end
    29842984    end
    29852985end
     
    29982998    return
    29992999end
    3000    
     3000
    30013001%% check the input file indexing:
    30023002[RootPath,SubDir,RootFile,FileIndex,FileExt]=read_file_boxes(handles);
     
    30083008filename=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt];% build the input file name (first line)
    30093009
    3010 set(handles.movie_pair,'BusyAction','queue')% 
     3010set(handles.movie_pair,'BusyAction','queue')%
    30113011set(handles.CheckFixPair,'Value',1)% impose fixed pair (needed for function runpm)
    30123012set(handles.REFRESH,'BackgroundColor',[1 1 0])%paint the command button in yellow to indicate its activity
     
    32093209%------------------------------------------------------------------------
    32103210% --- read the input files and inputfilerefresh all the plots, including projection.
    3211 % OUTPUT: 
     3211% OUTPUT:
    32123212%  errormsg: error message char string  =[] by default
    32133213% INPUT:
    32143214% FileName: first input file (=[] in the absence of input file)
    3215 % FileName_1: second input file (=[] in the asbsence of second input file) 
     3215% FileName_1: second input file (=[] in the asbsence of second input file)
    32163216% num_i1,num_i2,num_j1,num_j2; frame indices
    32173217% i1_1,i2_1,j1_1,j2_1: frame indices for the second input file  (needed if FileName_1 is not empty)
     
    32733273end
    32743274
    3275 %% read the first input field 
     3275%% read the first input field
    32763276ParamIn.ColorVar='';%default variable name for vector color
    32773277frame_index=1;%default
     
    32993299        end
    33003300    case {'video','mmreader','rdvision','cine_phantom'}
    3301         ParamIn=UvData.MovieObject{1}; % movie object     
     3301        ParamIn=UvData.MovieObject{1}; % movie object
    33023302        if strcmp(NomType,'*')
    33033303            frame_index=num_i1;%frame index from a single movies or multimage
     
    33273327            ParamIn.Npy=UvData.XmlData.Npy;
    33283328            ParamIn.Npx=UvData.XmlData.Npx;
    3329         else           
     3329        else
    33303330            errormsg='Npx and Npy need to be defined in the xml file for volume images .vol';
    33313331            return
     
    33483348            ParamIn.TimeVarName=TimeName(5:end);
    33493349        end
    3350     end 
     3350    end
    33513351end
    33523352
     
    33553355    errormsg=['uvmat / refresh_field / read_field( ' FileName ') / ' errormsg];
    33563356    return
    3357 end 
     3357end
    33583358if isfield(ParamOut,'Npx')&& isfield(ParamOut,'Npy')
    33593359    set(handles.num_Npx,'String',num2str(ParamOut.Npx));% display image size on the interface
     
    33933393                    list_code=get(handles.ColorScalar,'String');% list menu fields
    33943394                    index_code=get(handles.ColorScalar,'Value');% selected string index
    3395                     ParamIn_1.ColorVar= list_code{index_code}; % selected field for vector color display                 
     3395                    ParamIn_1.ColorVar= list_code{index_code}; % selected field for vector color display
    33963396                end
    33973397            end
     
    34023402            else
    34033403                frame_index_1=i1_1;
    3404             end 
     3404            end
    34053405         case 'multimage'
    34063406            if strcmp(NomType_1,'*')%frame index for movies or multimage
     
    34083408            else
    34093409                frame_index_1=j1_1;
    3410             end   
     3410            end
    34113411        case 'vol' %TODO: update
    34123412            if isfield(UvData.XmlData,'Npy') && isfield(UvData.XmlData,'Npx')
     
    34363436        ParamIn_1.Coord_x=get(handles.Coord_x,'String');
    34373437        ParamIn_1.Coord_y=get(handles.Coord_y,'String');
    3438         end 
     3438        end
    34393439        [Field{2},ParamOut_1,errormsg] = read_field(FileName_1,UvData.FileType{2},ParamIn_1,frame_index_1);
    34403440        if ~isempty(errormsg)
     
    35143514    set(handles.FixVelType,'Visible','off')
    35153515end
    3516    
     3516
    35173517%% introduce w as background image by default for a new series (only for nbdim=2)
    35183518if ~isfield(UvData,'NewSeries')
     
    35373537%         set(handles.FieldName_1,'Visible','on');
    35383538%         Field{1}.AName='w';
    3539 % end           
     3539% end
    35403540
    35413541%% display time value of the current file
     
    35753575        abstime=Field{1}.Time;
    35763576    elseif ~isempty(regexp(TimeName,'^att:', 'once'))
    3577         abstime=Field{1}.(TimeName(5:end));%the time is an attribute  selected by get_file 
     3577        abstime=Field{1}.(TimeName(5:end));%the time is an attribute  selected by get_file
    35783578        if isfield(Field{1},[TimeName(5:end) 'Unit'])
    35793579            TimeUnit=Field{1}.([TimeName(5:end) 'Unit']);
     
    35933593        dt=Field{2}.Dt;%dt read from the netcdf input file
    35943594    end
    3595 end 
     3595end
    35963596set(handles.TimeValue,'String',num2str(abstime))
    35973597
     
    36193619        end
    36203620    end
    3621    
     3621
    36223622    % get time in the input file of the second series, not defined in a xml file or movie
    3623     if isempty(abstime_1) && numel(Field)==2 
     3623    if isempty(abstime_1) && numel(Field)==2
    36243624         if strcmp(TimeName_1,'civdata')||strcmp(TimeName_1,'civx')
    36253625        abstime_1=Field{2}.Time;
     
    36523652set(handles.Time_title,'String',Time_title)
    36533653
    3654 %% store the current open names, fieldname and vel types in uvmat interface 
     3654%% store the current open names, fieldname and vel types in uvmat interface
    36553655UvData.FileName_1=FileName_1;
    36563656UvData.ParamOut_1=ParamOut_1;
     
    37343734else
    37353735    set(handles.Objects,'Visible','on')
    3736    
     3736
    37373737    %% Plot the projections on the selected  projection objects
    37383738    %if no projection object exists, create a default one
     
    37983798        PlotParam{1}.Vectors.ColorCode= {'rgb'};
    37993799    end
    3800    
     3800
    38013801    %% second projection object (view_field display)
    38023802    if length( IndexObj)==2
     
    38083808        end
    38093809    end
    3810    
    3811     %% loop on the projection objects: one or two 
     3810
     3811    %% loop on the projection objects: one or two
    38123812    for imap=1:numel(IndexObj)
    38133813        iobj=IndexObj(imap);
     
    38223822            if iobj==1 && ~(isfield(UvData.ProjObject{iobj},'Coord') && size(UvData.ProjObject{iobj}.Coord,2)>=3 && UvData.ProjObject{iobj}.Coord(1,3)<UvData.Field.ZMax && UvData.ProjObject{iobj}.Coord(1,3)>UvData.Field.ZMin)
    38233823                 UvData.ProjObject{iobj}.Coord(1,3)=(UvData.Field.ZMin+UvData.Field.ZMax)/2;%section at a middle plane chosen
    3824             end         
     3824            end
    38253825        end
    38263826        [ObjectData,errormsg]=proj_field(UvData.Field,UvData.ProjObject{iobj});% project field on the object
    38273827        if ~isempty(errormsg)
    3828             errormsg=['projection on ' UvData.ProjObject{iobj}.Type ': ' errormsg ]; 
     3828            errormsg=['projection on ' UvData.ProjObject{iobj}.Type ': ' errormsg ];
    38293829            return
    38303830        end
     
    38613861            ObjectData.A=flag_mask.*double(ObjectData.A);
    38623862            ObjectData.A=feval(AClass,ObjectData.A);
    3863         end       
     3863        end
    38643864        set(handles.uvmat,'UserData',UvData)
    38653865        if ~isempty(ObjectData)
     
    38753875                        hhset_object=guidata(hset_object);%
    38763876                        set(hhset_object.ProjMode,'Value',2);
    3877                         set_object('ProjMode_Callback',hset_object,[],hhset_object); 
     3877                        set_object('ProjMode_Callback',hset_object,[],hhset_object);
    38783878                    end
    38793879                    return
     
    38953895        end
    38963896    end
    3897    
     3897
    38983898    %% update the mask
    38993899    if isequal(get(handles.CheckMask,'Value'),1)%if the mask option is on
    39003900        update_mask(handles);
    39013901    end
    3902    
     3902
    39033903    %% prepare the menus of histograms and plot them (Histogram of the whole volume in 3D case)
    39043904    menu_histo=(UvData.Field.ListVarName)';%list of field variables to be displayed for the menu of histogram display
     
    39373937        menu_histo=[{[Ustring ',' Vstring]};menu_histo];% add U, V at the beginning if they exist
    39383938    end
    3939    
     3939
    39403940    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    39413941    % display menus and plot histograms
     
    39543954    set(handles.CheckEditObject,'Value',1)
    39553955    CheckEditObject_Callback(handles.uvmat, [], handles)
    3956 end   
     3956end
    39573957%ResizeFcn(handles.uvmat,[],handles)
    39583958set(handles.uvmat,'Pointer',pointer)
     
    40824082%------------------------------------------------------------------------
    40834083function [indx,indy]=pos2ind(x0,rangx0,nxy)
    4084 indx=1+round((nxy(2)-1)*(x0-rangx0(1))/(rangx0(2)-rangx0(1)));% index x of pixel 
     4084indx=1+round((nxy(2)-1)*(x0-rangx0(1))/(rangx0(2)-rangx0(1)));% index x of pixel
    40854085indy=1+round((nxy(1)-1)*(y12-rangy0(1))/(rangy0(2)-rangy0(1)));% index y of pixel
    40864086
     
    41444144if ~test_civ2 && ~test_civ1
    41454145    msgbox_uvmat('ERROR','manual correction only possible for CIV1 or CIV2 velocity fields')
    4146 end 
     4146end
    41474147if test_civ2
    41484148    nbname='nb_vec_2';
     
    41594159hhh=which('netcdf.open');% look for built-in matlab netcdf library
    41604160if ~isequal(hhh,'')% case of  builtin Matlab netcdf library
    4161     nc=netcdf.open(FileName,'NC_WRITE'); 
     4161    nc=netcdf.open(FileName,'NC_WRITE');
    41624162    netcdf.reDef(nc);
    41634163    netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'CivStage',CivStage);
    4164     dimid = netcdf.inqDimID(nc,nbname); 
     4164    dimid = netcdf.inqDimID(nc,nbname);
    41654165    try
    41664166        varid = netcdf.inqVarID(nc,flagname);% look for already existing fixflag variable
     
    41704170    netcdf.endDef(nc);
    41714171    netcdf.putVar(nc,varid,UvData.PlotAxes.FF);
    4172     netcdf.close(nc); 
     4172    netcdf.close(nc);
    41734173else %old netcdf library
    41744174    netcdf_toolbox(FileName,AxeData,attrname,nbname,flagname)
     
    41854185nb_vectors=size(theDim);
    41864186var_FixFlag=ncvar(flagname,nc);% var_FixFlag will be written as the netcdf variable vec_FixFlag
    4187 var_FixFlag(1:nb_vectors)=AxeData.FF;% 
     4187var_FixFlag(1:nb_vectors)=AxeData.FF;%
    41884188fin=close(nc);
    41894189
     
    41934193function SubField_Callback(hObject, eventdata, handles)
    41944194
    4195 if get(handles.SubField,'Value')==0% if the subfield button is desactivated 
     4195if get(handles.SubField,'Value')==0% if the subfield button is desactivated
    41964196    desable_subfield(handles)
    41974197    transform_fct_list=get(handles.TransformName,'String');
     
    41994199    if strcmp(transform_fct,'sub_field')
    42004200        set(handles.TransformName,'Value',1)%suppress the sub_field transform
    4201         TransformName_Callback(hObject, eventdata, handles); 
     4201        TransformName_Callback(hObject, eventdata, handles);
    42024202    else
    42034203        REFRESH_Callback(hObject, eventdata, handles)
    4204     end 
     4204    end
    42054205else
    42064206    fileinput_1=uigetfile_uvmat('select a second input file:',get(handles.RootPath,'String'));
    42074207    if isempty(fileinput_1)
    42084208        set(handles.SubField,'Value',0)
    4209     else       
     4209    else
    42104210        % refresh the current displayed field
    42114211        display_file_name(handles,fileinput_1,2)
    4212        
     4212
    42134213        %update list of recent files in the menubar
    42144214        MenuFile_1=fileinput_1;
     
    42294229%-----------------------------------------------------------------------
    42304230function desable_subfield(handles)
    4231    
     4231
    42324232set(handles.RootPath_1,'String','')
    42334233set(handles.RootFile_1,'String','')
     
    42934293RootFile_1=get(handles.RootFile_1,'String');
    42944294if isequal(get(handles.RootFile_1,'Visible'),'off') || isequal(RootFile_1,'"')
    4295     RootFile_1=get(handles.RootFile,'String'); 
     4295    RootFile_1=get(handles.RootFile,'String');
    42964296end
    42974297RootFile_1=regexprep(RootFile_1,'\<[\\/]|[\\/]\>','');%suppress possible / or \ separator at the beginning or the end of the string
     
    43234323[tild,tild,tild,i1,i2,j1,j2,tild,NomType]=fileparts_uvmat(['xxx' get(handles.FileIndex,'String') FileExt]);
    43244324
    4325 switch field 
     4325switch field
    43264326    case 'get_field...'
    43274327        %% fill the axes and variables from selections in get_field
     
    43534353            end
    43544354        end
    4355        
     4355
    43564356        % VelType menu desactivated
    43574357        set(handles.FixVelType,'visible','off')
    43584358        set(handles.VelType,'Visible','off')
    4359        
     4359
    43604360        %read selection from get_field
    43614361        [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles);
     
    43764376                        ZName=GetFieldData.Coordinates.Coord_z;
    43774377                    end
    4378                 end             
     4378                end
    43794379                CName=GetFieldData.PanelVectors.vec_color;
    43804380                FieldList={['vec(' UName ',' VName ')'];...
     
    44304430                    set(handles.TimeName,'String',['dim:' GetFieldData.Time.TimeName]);
    44314431                    set(handles.NomType,'String','*')
    4432                     set(handles.RootFile,'String',[get(handles.RootFile,'String') get(handles.FileIndex,'String')])             
     4432                    set(handles.RootFile,'String',[get(handles.RootFile,'String') get(handles.FileIndex,'String')])
    44334433                    set(handles.i1,'String','1')% set counter to 1 (now the time index in the input matrix)
    44344434                    MaxIndex_i=get(handles.MaxIndex_i,'String');
     
    44554455            REFRESH_Callback(hObject, eventdata, handles)
    44564456        end
    4457        
     4457
    44584458    case 'image'
    44594459        %% look for image corresponding to civ data
     
    45404540            end
    45414541        end
    4542        
     4542
    45434543        % VelType menu desactivated
    45444544        set(handles.FixVelType,'visible','off')
    45454545        set(handles.VelType,'Visible','off')
    4546        
     4546
    45474547        %read selection from get_field
    45484548        [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes_1(handles);
     
    46214621        if ~exist(imagename,'file')
    46224622            imagename=uigetfile_uvmat('Pick an image file',imagename,'image');
    4623            
     4623
    46244624        end
    46254625        if isempty(imagename)
     
    46344634            set(handles.FileIndex_1,'String',get(handles.FileIndex,'String'))
    46354635            set(handles.FileExt_1,'String',get(handles.FileExt,'String'))
    4636            
     4636
    46374637            UvData.FileType{2}=UvData.FileType{1};
    46384638            UvData.XmlData{2}= UvData.XmlData{1};
     
    46434643                TransformName_Callback(hObject, eventdata, handles)% activate transform_fct_Callback and refresh current plot
    46444644                 check_refresh=0;
    4645              end             
     4645             end
    46464646        end
    46474647        if ~isequal(field,'image')
     
    46514651        end
    46524652        set(handles.uvmat,'UserData',UvData)
    4653  
     4653
    46544654        if check_refresh && ~(isfield(UvData,'NewSeries')&&isequal(UvData.NewSeries,1))
    46554655            REFRESH_Callback(hObject, eventdata, handles)
     
    46584658
    46594659%------------------------------------------------------------------------
    4660 % --- set the visibility of relevant velocity type menus: 
     4660% --- set the visibility of relevant velocity type menus:
    46614661function menu=set_veltype_display(Civ,FileType)
    46624662%------------------------------------------------------------------------
     
    47204720UvData=get(handles.uvmat,'UserData');
    47214721set(handles.InputFileREFRESH,'BackgroundColor',[1 1 0])%paint REFRESH button in yellow to indicate its activation
    4722 drawnow   
     4722drawnow
    47234723InputFile=read_GUI(handles.InputFile);% read the input file parameters
    47244724[RootPath,SubDir,RootFile,FileIndex,FileExt]=read_file_boxes(handles);
     
    47354735     check_refresh=1;%will refresh the current plot
    47364736else% we introduce the same file (with a different field) for the second series
    4737      FileName_1=FileName;% we compare two fields in the same file 
     4737     FileName_1=FileName;% we compare two fields in the same file
    47384738     UvData.FileType{2}=UvData.FileType{1};
    47394739     UvData.XmlData{2}= UvData.XmlData{1};
     
    47464746     else
    47474747         check_refresh=1;
    4748      end 
     4748     end
    47494749end
    47504750
     
    47824782end
    47834783if exist('handle1','var')%handles of selected button
    4784         set(handle1,'BackgroundColor',[1 1 0]) 
     4784    set(handle1,'BackgroundColor',[1 1 0])
    47854785end
    47864786
     
    47934793    delete(handles.UVMAT_title)
    47944794end
    4795 UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface 
     4795UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface
    47964796if isequal(get(handles.VOLUME,'Value'),1)
    47974797    set(handles.CheckZoom,'Value',0)
     
    48224822        data.RangeX=max(meshx,meshy);
    48234823        data.DX=max(meshx,meshy);
    4824     end 
     4824    end
    48254825    data.ParentButton=handles.VOLUME;
    48264826    PlotHandles=get_plot_handles(handles);%get the handles of the interface elements setting the plotting parameters
     
    48374837function edit_vect_Callback(hObject, eventdata, handles)
    48384838%-------------------------------------------------------
    4839 % 
     4839%
    48404840if isequal(get(handles.edit_vect,'Value'),1)
    48414841    VelTypeMenu=get(handles.VelType,'String');
     
    48434843    if ~strcmp(VelType,'civ2') && ~strcmp(VelType,'civ1')
    48444844        msgbox_uvmat('ERROR','manual correction only possible for CIV1 or CIV2 velocity fields')
    4845     end 
     4845    end
    48464846    set(handles.record,'Visible','on')
    48474847    set(handles.edit_vect,'BackgroundColor',[1 1 0])
     
    48774877                end
    48784878            end
    4879             if isfield(ObjectData,'Coord')& isfield(ObjectData,'Style') 
    4880                 if isequal(ObjectData.Type,'polygon') 
     4879            if isfield(ObjectData,'Coord')& isfield(ObjectData,'Style')
     4880                if isequal(ObjectData.Type,'polygon')
    48814881                    X=ObjectData.Coord(:,1);
    48824882                    Y=ObjectData.Coord(:,2);
     
    48844884                        [X,Y]=px_XYZ(Calib,X,Y,0);% to generalise with 3D cases
    48854885                    end
    4886                     flagobj=~inpolygon(Xi,Yi,X',Y');%=0 inside the polygon, 1 outside                 
     4886                    flagobj=~inpolygon(Xi,Yi,X',Y');%=0 inside the polygon, 1 outside
    48874887                elseif isequal(ObjectData.Type,'ellipse')
    48884888                    if testphys
     
    49274927% imflag=uint8(255*flag);% =0 for flag=0 (vectors=0 when 20<imflag<200)
    49284928msgbox_uvmat('CONFIRMATION',[mask_name ' saved'])
    4929 imwrite(imflag,mask_name,'BitDepth',8); 
     4929imwrite(imflag,mask_name,'BitDepth',8);
    49304930
    49314931%display the mask
     
    49794979        set(handles.TransformName,'String',menu)
    49804980        set(handles.TransformName,'Value',ichoice)
    4981        
     4981
    49824982        % save the new menu in the personal file 'uvmat_perso.mat'
    49834983        dir_perso=prefdir;%personal Matalb directory
     
    53595359% --- Execute on return carriage on the edit box corresponding to slider 1
    53605360%----------------------------------------------------------------
    5361 function num_ColCode1_Callback(hObject, eventdata, handles) 
     5361function num_ColCode1_Callback(hObject, eventdata, handles)
    53625362set_vec_col_bar(handles)
    53635363update_plot(handles);
     
    54915491            objectcolor='b';
    54925492        end
    5493         UvData.ProjObject{IndexObj}.DisplayHandle.uvmat=plot_object(UvData.ProjObject{IndexObj},ObjectData,hobject,objectcolor);%draw the object in uvmat     
     5493        UvData.ProjObject{IndexObj}.DisplayHandle.uvmat=plot_object(UvData.ProjObject{IndexObj},ObjectData,hobject,objectcolor);%draw the object in uvmat
    54945494end
    54955495set(handles.uvmat,'UserData',UvData)
     
    55095509
    55105510%  desactivate the edit object mode
    5511 set(handles.CheckEditObject,'Value',0) 
    5512 % set(handles.CheckEditObject,'BackgroundColor',[0.7,0.7,0.7]) 
     5511set(handles.CheckEditObject,'Value',0)
     5512% set(handles.CheckEditObject,'BackgroundColor',[0.7,0.7,0.7])
    55135513
    55145514%------------------------------------------------------------------------
     
    55355535end
    55365536
    5537 %%  desactivate the edit object mode for security 
    5538 set(handles.CheckEditObject,'Value',0) 
     5537%%  desactivate the edit object mode for security
     5538set(handles.CheckEditObject,'Value',0)
    55395539
    55405540%% update the  plot on view_field if view_field is already openened
     
    55525552    [PlotType,PlotParam]=plot_field(ProjData,hhview_field.PlotAxes,read_GUI(hview_field));%read plotting parameters on the uvmat interface
    55535553    haxes=findobj(hview_field,'tag','axes3');
    5554     pos=get(hview_field,'Position'); 
     5554    pos=get(hview_field,'Position');
    55555555    if strcmp(get(haxes,'Visible'),'off')%sempty(PlotParam.Axes)% case of no plot display (pure text table)
    55565556        h_TableDisplay=findobj(hview_field,'tag','TableDisplay');
     
    56265626%-------------------------------------------------------------------
    56275627hset_object=findobj(allchild(0),'Tag','set_object');
    5628 if get(handles.CheckEditObject,'Value') 
    5629     %suppress the other options 
     5628if get(handles.CheckEditObject,'Value')
     5629    %suppress the other options
    56305630    set(handles.MenuObject,'checked','off')
    56315631    set(handles.CheckZoom,'Value',0)
     
    56405640    CheckViewObject_Callback(hObject, eventdata, handles)
    56415641else % desactivate object edit mode
    5642     if ~isempty(hset_object)% open the 
     5642    if ~isempty(hset_object)% open the
    56435643        set(get(hset_object,'children'),'Enable','off')
    56445644        hSAVE=findobj(hset_object,'Tag','SAVE');
     
    56545654check_view=get(handles.CheckViewObject,'Value');
    56555655
    5656 if check_view %activate set_object   
     5656if check_view %activate set_object
    56575657    IndexObj=get(handles.ListObject,'Value');
    56585658    list_object=get(handles.ListObject,'String');
     
    56765676        data.Type='plane';
    56775677    end
    5678    
     5678
    56795679    %% initiate the new projection object
    56805680    hset_object=set_object(data,[],ZBounds);
     
    56935693    end
    56945694end
    5695  
     5695
    56965696
    56975697%------------------------------------------------------------------------
     
    57195719    list_object=get(handles.ListObject,'String');
    57205720    UvData.ProjObject{IndexObj(end)}.Name=list_object{IndexObj(end)};
    5721    
     5721
    57225722    %% show the projection of the selected object on view_field
    57235723    [ProjData,errormsg]= proj_field(UvData.Field,UvData.ProjObject{IndexObj});%project the current field on ObjectData
     
    57725772% INPUT:
    57735773% hObject: object index (if integer) or handle of the graphic object. If
    5774 %          hObject is a subobject, the parent object is detected and deleted. 
     5774%          hObject is a subobject, the parent object is detected and deleted.
    57755775
    57765776function delete_object(IndexObj)
     
    58475847        else
    58485848            set(handles.CheckFixAspectRatio,'Value',0)
    5849  
     5849
    58505850        end
    58515851    end
     
    58745874    if isfield(PlotParam.Scalar,'MinA')
    58755875        set(handles.num_MinA,'String',num2str(PlotParam.Scalar.MinA,3));
    5876     end   
     5876    end
    58775877    if isfield(PlotParam.Scalar,'IncrA')
    58785878        set(handles.num_IncrA,'String',num2str(PlotParam.Scalar.IncrA,3))
     
    58805880    set(handles.CheckBW,'Value',PlotParam.Scalar.CheckBW)
    58815881    if isfield(PlotParam.Scalar,'Opacity')&&isfield(handles,'num_Opacity')
    5882         set(handles.num_Opacity,'String',num2str(PlotParam.Scalar.Opacity)) 
     5882        set(handles.num_Opacity,'String',num2str(PlotParam.Scalar.Opacity))
    58835883    end
    58845884else
Note: See TracChangeset for help on using the changeset viewer.