Changeset 84 for trunk/src/civ.m


Ignore:
Timestamp:
Apr 24, 2010, 2:07:22 PM (14 years ago)
Author:
sommeria
Message:

-update_imadoc: copy the timing information of the movie file avi in the new xml file when a geometry_calibration is performed
-set_grid: modified to produce grids in px coordiantes and to display the produced grid
-geometry_calib: display the point with max error
-civ: bug corrected for copying avi movies to png files
-uvmat: small bug fixes
-px_XYZ: introduce default values for Calib parameters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/civ.m

    r82 r84  
    5151% handles    structure with handles and user data (see GUIDATA)
    5252% varargin   command line arguments to civ (see VARARGIN)
    53 global test_batch patch_newBin CivBin%=1 if patch processing available
     53global patch_newBin %=1 if new patch processing available
    5454%filebase: root name
    5555%nom_type: nomencalture used ('png_old','_i_j'...)
     
    127127    test_batch=strcmp(sparam.BatchParam.BatchMode,'sge'); %sge is currently the only implemented batch mod
    128128end
    129 % if isfield(sparam,'PatchNewBin')
    130 %     patch_newBin=sparam.PatchNewBin;
    131 % end
    132 % if isfield(sparam,'SGE')
    133 %     sge=str2double(sparam.SGE);
    134 % end   
    135 % test_batch=sge;%default
    136129if test_batch==0
     130    set(handles.BATCH,'Enable','off')% put the BATCH button in grey (unactivated)
    137131    set(handles.BATCH,'BackgroundColor',[0.831 0.816 0.784])% put the BATCH button in grey (unactivated)
    138132end
     
    297291[RootPath,RootFile,str1,str2,str_a,str_b,ext,nom_type,subdir]=name2display(fileinput);
    298292filebase=fullfile(RootPath,RootFile);
    299 % if isequal(nom_type,'*')% all fields in a single file ( movie files)
    300 %     num_i1=1;num_i2=1;num_j1=1;num_j2=1;
    301 % else
    302293num_i1=stra2num(str1);
    303294if isempty(num_i1),num_i1=1;end
     
    318309    browse.nom_type_ima=nom_type;
    319310    browse.field_count=num_i1;
    320 %     A=imread(fileinput);
    321 %     npxy=size(A);
    322 %     set(handles.ImaExt,'UserData',npxy)
    323311end
    324312set(handles.ImaDoc,'String',ext);
     
    437425function RootName_Callback(hObject, eventdata, handles)
    438426%------------------------------------------------------------------------
    439 global test_batch
    440427set(handles.compare,'Visible','on')
    441428ext_ima=get(handles.ImaExt,'String');
     
    510497
    511498%%%%%%%%   read image documentation file  %%%%%%%%%%%%%%%%%%%%%%%%%%%
    512     mode=''; %default
    513     set(handles.ImaDoc,'BackgroundColor',[1 1 0])
    514     drawnow
    515     %read the image documentation file if found
     499mode=''; %default
     500set(handles.ImaDoc,'BackgroundColor',[1 1 0])
     501drawnow
    516502if isequal(ext,'.civxml') || isequal(ext,'.xml')|| isequal(ext,'.civ')
    517503    set(handles.ref_i,'Visible','On')%use a reference index
    518504    set(handles.ref_j,'Visible','On')
    519 %     set(handles.dt,'Visible','Off')
    520  %   set(handles.root_txt,'String','')
    521505elseif isequal(ext,'.avi') || isequal(ext,'.AVI')
    522506    set(handles.ref_j,'Visible','Off')
    523  %   set(handles.dt,'Visible','Off')
    524  %   set(handles.root_txt,'String','ref. ind.')
    525507else
    526508    set(handles.ref_i,'Visible','Off')
    527509    set(handles.ref_j,'Visible','Off')
    528  %   set(handles.dt,'Visible','On')
    529  %   set(handles.root_txt,'String','dt(ms)=')
    530510end
    531511testima_xml=0;
     
    538518elseif isequal(ext,'.xml')
    539519    [XmlData,warntext]=imadoc2struct([filebase '.xml']);
    540     if isfield(XmlData,'Time')
    541         time=XmlData.Time;
    542         nbfield=size(time,1);
    543         nburst=size(time,2);
    544     end
    545520    ext_ima_read=[];
    546521    nom_type_read=[];
     
    550525        if ~exist(fullname,'file')
    551526            msgbox_uvmat('WARNING',['FirstImage ' fullname ' defined in the xml file does not exist'])
     527        end
     528    end
     529    if isfield(XmlData,'Time')
     530        time=XmlData.Time
     531        nbfield=size(time,1);
     532        nburst=size(time,2);
     533        %transform .Time to a column vector if it is a line vector the nomenclature uses a single index
     534        if isequal(nbfield,1) && ~isequal(nburst,1)% .Time is a line vector
     535            if numel(nom_type_read)>=2 && (strcmp(nom_type_read,'_i')||strcmp(nom_type_read(1:2),'%0')||strcmp(nom_type_read(1:2),'_%'))
     536                time=time';
     537                nbfield=nburst;
     538                nburst=1;
     539            end
    552540        end
    553541    end
     
    748736set(handles.RUN, 'Enable','On')
    749737set(handles.RUN,'BackgroundColor',[1 0 0])
    750 if isequal(test_batch,1)%if batch installation is available
    751     set(handles.BATCH, 'Enable','On')
     738if isequal(get(handles.BATCH, 'Enable'),'On')
    752739    set(handles.BATCH,'BackgroundColor',[1 0 0])
    753740end
     
    33743361                    filename=name_generator(filebase_ima1,num1_civ2(ifile),num_a_civ2(j),'.png',nom_type_imanew1);
    33753362                    if ~exist(filename,'file')
    3376                         A=read_image(cell2mat(filecell.ima1.civ2(ifile,j)),nom_type_ima2,num1_civ2(ifile));
     3363                        A=read_image(cell2mat(filecell.ima1.civ2(ifile,j)),type_ima2,num1_civ2(ifile));
    33773364                        imwrite(A,filename,'BitDepth',16);
    33783365                    end
     
    33803367                    filename=name_generator(filebase_ima2, num2_civ2(ifile),num_b_civ2(j),'.png',nom_type_imanew2);
    33813368                    if ~exist(filename,'file')
    3382                         A=read_image(cell2mat(filecell.ima2.civ2(ifile,j)),nom_type_ima2,num2.civ1(ifile));
     3369                        A=read_image(cell2mat(filecell.ima2.civ2(ifile,j)),type_ima2,num2_civ2(ifile));
    33833370                        imwrite(A,filename,'BitDepth',16);
    33843371                    end
Note: See TracChangeset for help on using the changeset viewer.