Changeset 84


Ignore:
Timestamp:
Apr 24, 2010, 2:07:22 PM (11 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

Location:
trunk/src
Files:
8 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
  • trunk/src/geometry_calib.m

    r83 r84  
    160160            case 'tsai'
    161161                set(handles.calib_type,'Value',3)
     162            case 'tsai_matlab'
     163                set(handles.calib_type,'Value',4)
    162164        end
    163165    end
     
    255257Coord_cell=get(handles.ListCoord,'String');
    256258Object=read_geometry_calib(Coord_cell);
    257 
     259X=Object.Coord(:,1);
     260Y=Object.Coord(:,2);
     261Z=Object.Coord(:,3);
    258262if isequal(calib_type,'rescale')
    259263    GeometryCalib=calib_rescale(Object.Coord);
     264    Z=0;%Z not taken into account
    260265elseif isequal(calib_type,'linear')
    261266    GeometryCalib=calib_linear(Object.Coord);
     267    Z=0; %Z not taken into account
    262268elseif isequal(calib_type,'tsai_cpp')
    263269    GeometryCalib=calib_tsai(Object.Coord);
     
    265271    GeometryCalib=calib_tsai2(Object.Coord);
    266272end
     273
     274%check error
     275if isfield(GeometryCalib,'dpx_dpy')
     276    Calib.dpx=GeometryCalib.dpx_dpy(1);
     277    Calib.dpy=GeometryCalib.dpx_dpy(2);
     278end
     279if isfield(GeometryCalib,'sx')
     280    Calib.sx=GeometryCalib.sx;
     281end
     282if isfield(GeometryCalib,'Cx_Cy')
     283    Calib.Cx=GeometryCalib.Cx_Cy(1);
     284    Calib.Cy=GeometryCalib.Cx_Cy(2);
     285end
     286if isfield(GeometryCalib,'kappa1')
     287    Calib.kappa1=GeometryCalib.kappa1;
     288end
     289if isfield(GeometryCalib,'focal')
     290    Calib.f=GeometryCalib.focal;
     291end
     292if isfield(GeometryCalib,'Tx_Ty_Tz')
     293    Calib.Tx=GeometryCalib.Tx_Ty_Tz(1);
     294    Calib.Ty=GeometryCalib.Tx_Ty_Tz(2);
     295    Calib.Tz=GeometryCalib.Tx_Ty_Tz(3);
     296end
     297if isfield(GeometryCalib,'R')
     298    Calib.R=GeometryCalib.R;
     299end
     300x_ima=Object.Coord(:,4);
     301y_ima=Object.Coord(:,5);
     302[Xpoints,Ypoints]=px_XYZ(Calib,X,Y,Z);
     303GeometryCalib.ErrorRms(1)=sqrt(mean((Xpoints-x_ima).*(Xpoints-x_ima)));
     304[GeometryCalib.ErrorMax(1),index(1)]=max(abs(Xpoints-x_ima));
     305GeometryCalib.ErrorRms(2)=sqrt(mean((Ypoints-y_ima).*(Ypoints-y_ima)));
     306[GeometryCalib.ErrorMax(2),index(2)]=max(abs(Ypoints-y_ima));
     307[EM,ind_dim]=max(GeometryCalib.ErrorMax);
     308index=index(ind_dim);
     309
    267310unitlist=get(handles.CoordUnit,'String');
    268311unit=unitlist{get(handles.CoordUnit,'value')};
     
    286329    outputfile=answer{1};
    287330end
    288 update_imadoc(GeometryCalib,outputfile)
    289 msgbox_uvmat('CONFIRMATION',{[outputfile ' updated with calibration data'];...
     331answer=msgbox_uvmat('INPUT_Y-N',{[outputfile ' updated with calibration data'];...
    290332    ['Error rms (along x,y)=' num2str(GeometryCalib.ErrorRms) ' pixels'];...
    291     ['Error max (along x,y)=' num2str(GeometryCalib.ErrorMax) ' pixels']})
    292 
    293 %display image with new calibration in the currently opened uvmat interface
    294 hhh=findobj(hhuvmat.axes3,'Tag','calib_marker');% delete calib points and markers
    295 if ~isempty(hhh)
    296     delete(hhh);
    297 end
    298 hhh=findobj(hhuvmat.axes3,'Tag','calib_points');
    299 if ~isempty(hhh)
    300     delete(hhh);
    301 end
    302 set(hhuvmat.FixedLimits,'Value',0)% put FixedLimits option to 'off'
    303 set(hhuvmat.FixedLimits,'BackgroundColor',[0.7 0.7 0.7])
    304 uvmat('RootPath_Callback',hObject,eventdata,hhuvmat); %file input with xml reading  in uvmat
    305 MenuPlot_Callback(hObject, eventdata, handles)
    306 figure(handles.geometry_calib)
     333    ['Error max (along x,y)=' num2str(GeometryCalib.ErrorMax) ' pixels']});
     334if isequal(answer,'Yes')
     335    update_imadoc(GeometryCalib,outputfile)
     336    %display image with new calibration in the currently opened uvmat interface
     337    hhh=findobj(hhuvmat.axes3,'Tag','calib_marker');% delete calib points and markers
     338    if ~isempty(hhh)
     339        delete(hhh);
     340    end
     341    hhh=findobj(hhuvmat.axes3,'Tag','calib_points');
     342    if ~isempty(hhh)
     343        delete(hhh);
     344    end
     345    set(hhuvmat.FixedLimits,'Value',0)% put FixedLimits option to 'off'
     346    set(hhuvmat.FixedLimits,'BackgroundColor',[0.7 0.7 0.7])
     347    uvmat('RootPath_Callback',hObject,eventdata,hhuvmat); %file input with xml reading  in uvmat
     348    MenuPlot_Callback(hObject, eventdata, handles)
     349    set(handles.ListCoord,'Value',index)% indicate in the list the point with max deviation (possible mistake)
     350    ListCoord_Callback(hObject, eventdata, handles)
     351    figure(handles.geometry_calib)
     352end
    307353
    308354%------------------------------------------------------------------
     
    395441GeometryCalib.R=[px(1),0,0;0,py(1),0;0,0,1];
    396442
    397 %check error
    398 Calib.dpx=1;
    399 Calib.dpy=1;
    400 Calib.sx=1;
    401 Calib.Cx=0;
    402 Calib.Cy=0;
    403 Calib.Tz=1;
    404 Calib.kappa1=0;
    405 Calib.f=GeometryCalib.focal;
    406 Calib.Tx=T_x;
    407 Calib.Ty=T_y;
    408 Calib.R=GeometryCalib.R;
    409 [Xpoints,Ypoints]=px_XYZ(Calib,X,Y,0);
    410 GeometryCalib.ErrorRms(1)=sqrt(mean((Xpoints-x_ima).*(Xpoints-x_ima)));
    411 GeometryCalib.ErrorMax(1)=max(abs(Xpoints-x_ima));
    412 GeometryCalib.ErrorRms(2)=sqrt(mean((Ypoints-y_ima).*(Ypoints-y_ima)));
    413 GeometryCalib.ErrorMax(2)=max(abs(Ypoints-y_ima));
     443% %check error
     444% Calib.dpx=1;
     445% Calib.dpy=1;
     446% Calib.sx=1;
     447% Calib.Cx=0;
     448% Calib.Cy=0;
     449% Calib.Tz=1;
     450% Calib.kappa1=0;
     451% Calib.f=GeometryCalib.focal;
     452% Calib.Tx=T_x;
     453% Calib.Ty=T_y;
     454% Calib.R=GeometryCalib.R;
     455% [Xpoints,Ypoints]=px_XYZ(Calib,X,Y,0);
     456% GeometryCalib.ErrorRms(1)=sqrt(mean((Xpoints-x_ima).*(Xpoints-x_ima)));
     457% GeometryCalib.ErrorMax(1)=max(abs(Xpoints-x_ima));
     458% GeometryCalib.ErrorRms(2)=sqrt(mean((Ypoints-y_ima).*(Ypoints-y_ima)));
     459% GeometryCalib.ErrorMax(2)=max(abs(Ypoints-y_ima));
    414460
    415461%------------------------------------------------------------------------
     
    436482GeometryCalib.R=[a_X1(2),a_X1(3),0;a_Y1(2),a_Y1(3),0;0,0,1];
    437483
    438 %check error
    439 GeometryCalib.ErrorRms(1)=sqrt(mean((x1-x_ima).*(x1-x_ima)));
    440 GeometryCalib.ErrorMax(1)=max(abs(x1-x_ima));
    441 GeometryCalib.ErrorRms(2)=sqrt(mean((y1-y_ima).*(y1-y_ima)));
    442 GeometryCalib.ErrorMax(2)=max(abs(y1-y_ima));
     484% %check error
     485% GeometryCalib.ErrorRms(1)=sqrt(mean((x1-x_ima).*(x1-x_ima)));
     486% GeometryCalib.ErrorMax(1)=max(abs(x1-x_ima));
     487% GeometryCalib.ErrorRms(2)=sqrt(mean((y1-y_ima).*(y1-y_ima)));
     488% GeometryCalib.ErrorMax(2)=max(abs(y1-y_ima));
    443489
    444490%------------------------------------------------------------------------
     
    463509run(fullfile(path_UVMAT,'toolbox_calib','go_calib_optim'));
    464510
    465 GeometryCalib.CalibrationType='tsai';
     511GeometryCalib.CalibrationType='tsai_matlab';
    466512GeometryCalib.focal=f(2);
    467513GeometryCalib.dpx_dpy=[1 1];
     
    472518GeometryCalib.Tx_Ty_Tz=Tc_1';
    473519GeometryCalib.R=Rc_1;
    474 Calib.dpx=GeometryCalib.dpx_dpy(1);
    475 Calib.dpy=GeometryCalib.dpx_dpy(2);
    476 Calib.sx=GeometryCalib.sx;
    477 Calib.Cx=GeometryCalib.Cx_Cy(1);
    478 Calib.Cy=GeometryCalib.Cx_Cy(2);
    479 Calib.kappa1=GeometryCalib.kappa1;
    480 Calib.f=GeometryCalib.focal;
    481 Calib.Tx=GeometryCalib.Tx_Ty_Tz(1);
    482 Calib.Ty=GeometryCalib.Tx_Ty_Tz(2);
    483 Calib.Tz=GeometryCalib.Tx_Ty_Tz(3);
    484 Calib.R=GeometryCalib.R;
    485 X=Coord(:,1);
    486 Y=Coord(:,2);
    487 Z=Coord(:,3);
    488 x_ima=Coord(:,4);
    489 y_ima=Coord(:,5);
    490 [Xpoints,Ypoints]=px_XYZ(Calib,X,Y,Z);
    491 
    492 GeometryCalib.ErrorRms(1)=sqrt(mean((Xpoints-x_ima).*(Xpoints-x_ima)));
    493 GeometryCalib.ErrorMax(1)=max(abs(Xpoints-x_ima));
    494 GeometryCalib.ErrorRms(2)=sqrt(mean((Ypoints-y_ima).*(Ypoints-y_ima)));
    495 GeometryCalib.ErrorMax(2)=max(abs(Ypoints-y_ima));
     520% Calib.dpx=GeometryCalib.dpx_dpy(1);
     521% Calib.dpy=GeometryCalib.dpx_dpy(2);
     522% Calib.sx=GeometryCalib.sx;
     523% Calib.Cx=GeometryCalib.Cx_Cy(1);
     524% Calib.Cy=GeometryCalib.Cx_Cy(2);
     525% Calib.kappa1=GeometryCalib.kappa1;
     526% Calib.f=GeometryCalib.focal;
     527% Calib.Tx=GeometryCalib.Tx_Ty_Tz(1);
     528% Calib.Ty=GeometryCalib.Tx_Ty_Tz(2);
     529% Calib.Tz=GeometryCalib.Tx_Ty_Tz(3);
     530% Calib.R=GeometryCalib.R;
     531% X=Coord(:,1);
     532% Y=Coord(:,2);
     533% Z=Coord(:,3);
     534% x_ima=Coord(:,4);
     535% y_ima=Coord(:,5);
     536% [Xpoints,Ypoints]=px_XYZ(Calib,X,Y,Z);
     537%
     538% GeometryCalib.ErrorRms(1)=sqrt(mean((Xpoints-x_ima).*(Xpoints-x_ima)));
     539% [GeometryCalib.ErrorMax(1),GeometryCalib.IndexMax(1)]=max(abs(Xpoints-x_ima));
     540% GeometryCalib.ErrorRms(2)=sqrt(mean((Ypoints-y_ima).*(Ypoints-y_ima)));
     541% [GeometryCalib.ErrorMax(2),GeometryCalib.IndexMax(2)]=max(abs(Ypoints-y_ima));
    496542
    497543function GeometryCalib=calib_tsai(Coord)
     
    558604GeometryCalib.R=[r1,r2,r3;r4,r5,r6;r7,r8,r9];
    559605%erreur a caracteriser?
    560 %check error
    561 Calib.dpx=GeometryCalib.dpx_dpy(1);
    562 Calib.dpy=GeometryCalib.dpx_dpy(2);
    563 Calib.sx=GeometryCalib.sx;
    564 Calib.Cx=GeometryCalib.Cx_Cy(1);
    565 Calib.Cy=GeometryCalib.Cx_Cy(2);
    566 Calib.kappa1=GeometryCalib.kappa1;
    567 Calib.f=GeometryCalib.focal;
    568 Calib.Tx=GeometryCalib.Tx_Ty_Tz(1);
    569 Calib.Ty=GeometryCalib.Tx_Ty_Tz(2);
    570 Calib.Tz=GeometryCalib.Tx_Ty_Tz(3);
    571 Calib.R=GeometryCalib.R;
    572 X=Coord(:,1);
    573 Y=Coord(:,2);
    574 Z=Coord(:,3);
    575 x_ima=Coord(:,4);
    576 y_ima=Coord(:,5);
    577 [Xpoints,Ypoints]=px_XYZ(Calib,X,Y,Z);
    578 
    579 GeometryCalib.ErrorRms(1)=sqrt(mean((Xpoints-x_ima).*(Xpoints-x_ima)));
    580 GeometryCalib.ErrorMax(1)=max(abs(Xpoints-x_ima));
    581 GeometryCalib.ErrorRms(2)=sqrt(mean((Ypoints-y_ima).*(Ypoints-y_ima)));
    582 GeometryCalib.ErrorMax(2)=max(abs(Ypoints-y_ima));
    583 % Nfx
    584 % dx
    585 % dy
    586 % 5 dpx
    587 % 6 dpy
    588 % cx
    589 % cy
    590 % sx
    591 % f
    592 % kappa1
    593 % tx
    594 % ty
    595 % tz
    596 % rx
    597 % ry
    598 % rz
    599 % p1
    600 % p2
    601 
    602 %calibcoeff=str2num(calibdat)
     606% %check error
     607% Calib.dpx=GeometryCalib.dpx_dpy(1);
     608% Calib.dpy=GeometryCalib.dpx_dpy(2);
     609% Calib.sx=GeometryCalib.sx;
     610% Calib.Cx=GeometryCalib.Cx_Cy(1);
     611% Calib.Cy=GeometryCalib.Cx_Cy(2);
     612% Calib.kappa1=GeometryCalib.kappa1;
     613% Calib.f=GeometryCalib.focal;
     614% Calib.Tx=GeometryCalib.Tx_Ty_Tz(1);
     615% Calib.Ty=GeometryCalib.Tx_Ty_Tz(2);
     616% Calib.Tz=GeometryCalib.Tx_Ty_Tz(3);
     617% Calib.R=GeometryCalib.R;
     618% X=Coord(:,1);
     619% Y=Coord(:,2);
     620% Z=Coord(:,3);
     621% x_ima=Coord(:,4);
     622% y_ima=Coord(:,5);
     623% [Xpoints,Ypoints]=px_XYZ(Calib,X,Y,Z);
     624%
     625% GeometryCalib.ErrorRms(1)=sqrt(mean((Xpoints-x_ima).*(Xpoints-x_ima)));
     626% GeometryCalib.ErrorMax(1)=max(abs(Xpoints-x_ima));
     627% GeometryCalib.ErrorRms(2)=sqrt(mean((Ypoints-y_ima).*(Ypoints-y_ima)));
     628% GeometryCalib.ErrorMax(2)=max(abs(Ypoints-y_ima));
    603629
    604630
  • trunk/src/px_XYZ.m

    r40 r84  
    1313    Zphys=0;
    1414end
    15 
     15if ~isfield(Calib,'f')
     16    Calib.f=1;
     17end
     18if ~isfield(Calib,'kappa1')
     19    Calib.kappa1=0;
     20end
     21if ~isfield(Calib,'sx')
     22    Calib.sx=1;
     23end
     24if ~isfield(Calib,'dpx')
     25    Calib.dpx=1;
     26end
     27if ~isfield(Calib,'dpy')
     28    Calib.dpy=1;
     29end
     30if ~isfield(Calib,'Cx')
     31    Calib.Cx=0;
     32end
     33if ~isfield(Calib,'Cy')
     34    Calib.Cy=0;
     35end
    1636%%%%%%%%%%%%%
    1737if isfield(Calib,'R')
  • trunk/src/set_grid.m

    r73 r84  
    2222function varargout = set_grid(varargin)
    2323
    24 % Last Modified by GUIDE v2.5 04-Feb-2008 16:05:02
    25 
    26 % Begin initialization code - DO NOT EDIT
     24% Last Modified by GUIDE v2.5 23-Apr-2010 15:44:47
     25
     26% Begin initialization code - DO NOT PLOT
    2727gui_Singleton = 1;
    2828gui_State = struct('gui_Name',       mfilename, ...
     
    4141    gui_mainfcn(gui_State, varargin{:});
    4242end
    43 % End initialization code - DO NOT EDIT
     43% End initialization code - DO NOT PLOT
    4444
    4545%-------------------------------------------------------------------
     
    5858%  if =[] or absent, no plot (mask mode in uvmat)
    5959% parameters on the uvmat interface (obtained by 'get_plot_handle.m')
    60 function set_grid_OpeningFcn(hObject, eventdata, handles,inputfile)
     60function set_grid_OpeningFcn(hObject, eventdata, handles,inputfile,CoordType)
    6161
    6262% Choose default command line output for set_grid
     
    7070% set(hObject,'Position',[0.7 0.1 0.25 0.5])%set the position of the set_grid interface
    7171set(hObject,'DeleteFcn',@closefcn)
    72 set(handles.TITLE,'Value',1)
    73 set(handles.ObjectStyle,'Value',1)
    74 set(handles.ProjMode,'Value',1)
     72% set(handles.TITLE,'Value',1)
     73%set(handles.ObjectStyle,'Value',1)
     74%set(handles.ProjMode,'Value',1)
    7575set(handles.MenuCoord,'ListboxTop',1)
    7676set(handles.MenuCoord,'Value',1);
     
    8080   set(handles.image_2,'String',inputfile)
    8181end
    82 
     82if exist('CoordType','var')
     83    if strcmp(CoordType,'px')
     84        set(handles.MenuCoord,'Value',2)
     85    end
     86end
    8387
    8488% --- Outputs from this function are returned to the command line.
    8589function varargout = set_grid_OutputFcn(hObject, eventdata, handles)
    86 % varargout  cell array for returning output args (see VARARGOUT);
    87 % hObject    handle to figure
    88 % eventdata  reserved - to be defined in a future version of MATLAB
    89 % handles    structure with handles and user data (see GUIDATA)
    90 
    9190% Get default command line output from handles structure
    9291varargout{1} = handles.output;
    9392varargout{2}=handles;
    94 
    95 % --- Executes on selection change in ObjectStyle.
    96 function ObjectStyle_Callback(hObject, eventdata, handles)
    97 
    98 ProjMode_Callback(hObject, eventdata, handles)
    99 
    100 %----------------------------------------------
    101 function xObject_Callback(hObject, eventdata, handles)
    102 
    103 
    104 function yObject_Callback(hObject, eventdata, handles)
    105 
    106 
    107 % --- Executes on selection change in zObject.
    108 function zObject_Callback(hObject, eventdata, handles)
    109 
    110 
    111 %---------------------------------------------------
    112 % --- Executes on selection change in ProjMode.
    113 function ProjMode_Callback(hObject, eventdata, handles)
    114 menu=get(handles.ProjMode,'String');
    115 value=get(handles.ProjMode,'Value');
    116 ProjMode=menu{value};
    117 menu=get(handles.ObjectStyle,'String');
    118 value=get(handles.ObjectStyle,'Value');
    119 ObjectStyle=menu{value};
    120 test3D=isequal(get(handles.ZObject,'Visible'),'on');%3D case
    121 if isequal(ObjectStyle,'plane')||isequal(ObjectStyle,'volume')
    122     set(handles.Phi,'Visible','on')
    123     if test3D%3D case
    124         set(handles.Theta,'Visible','on')
    125         set(handles.Psi,'Visible','on')
    126     end
    127     set(handles.XMin,'Visible','on')
    128     set(handles.XMax,'Visible','on')
    129     set(handles.YMin,'Visible','on')
    130     set(handles.YMax,'Visible','on')
    131     if test3D
    132         set(handles.Theta,'Visible','on')
    133         set(handles.Psi,'Visible','on')
    134         set(handles.ZMin,'Visible','on')
    135         set(handles.ZMax,'Visible','on')
    136     end
    137 else
    138     set(handles.Phi,'Visible','off')
    139     set(handles.Theta,'Visible','off')
    140     set(handles.Psi,'Visible','off')
    141     set(handles.XMin,'Visible','off')
    142     set(handles.XMax,'Visible','off')
    143     set(handles.YMin,'Visible','off')
    144     if isequal(ProjMode,'interp')
    145         set(handles.YMax,'Visible','off')
    146     else
    147         set(handles.YMax,'Visible','on')
    148     end
    149     if isequal(ObjectStyle,'rectangle')|isequal(ObjectStyle,'ellipse')
    150         set(handles.XMax,'Visible','on')
    151     else
    152        set(handles.XMax,'Visible','off')
    153     end
    154     set(handles.ZMin,'Visible','off')
    155     set(handles.ZMax,'Visible','off')
    156 end
    157 if isequal(ProjMode,'projection')|isequal(ProjMode,'inside')|isequal(ProjMode,'outside')|isequal(ObjectStyle,'points')
    158     set(handles.DX,'Visible','off')
    159     set(handles.DY,'Visible','off')
    160     set(handles.DZ,'Visible','off')   
    161 else
    162     set(handles.DX,'Visible','on')
    163     set(handles.DY,'Visible','on')
    164     if test3D%3D case
    165         set(handles.DZ,'Visible','on')
    166     end
    167 end
    168 
    169 %---------------------------------------------
    170 % --- Executes on selection change in TITLE.
    171 function TITLE_Callback(hObject, eventdata, handles)
    172 hsetobject=get(handles.TITLE,'parent');
    173 SetData=get(hsetobject,'UserData');%get the hidden interface data
    174 %      function named CALLBACK in UNTITLED.M with the given input arguments.
    175 menu=get(handles.TITLE,'String');
    176 value=get(handles.TITLE,'Value');
    177 titl=menu{value};
    178 if isequal(titl,'POINTS')
    179      menu_style={'points'};
    180      menu_proj={'projection';'interp';'filter';'none'};
    181 elseif isequal(titl,'LINE')
    182      menu_style={'line';'polyline';'rectangle';'polygon';'ellipse'};%'line' =default
    183      menu_proj={'projection';'interp';'filter';'none'};
    184 elseif isequal(titl,'PATCH')
    185      menu_style={'rectangle';'polygon';'ellipse'};%'line' =default
    186      menu_proj={'inside';'outside';'none'};
    187  elseif isequal(titl,'PLANE')
    188      menu_style={'plane'};
    189      menu_proj={'projection';'interp'};
    190 elseif isequal(titl,'VOLUME')
    191      menu_style={'volume'};
    192      menu_proj={'none'};
    193  
    194 end
    195 set(handles.ObjectStyle,'String',menu_style)
    196 set(handles.ObjectStyle,'Value',1)
    197 set(handles.ProjMode,'String',menu_proj)
    198 set(handles.ProjMode,'Value',1)
    199 if isfield(SetData,'ParentButton')
    200     update_parentbutton(SetData.ParentButton,titl)
    201 end
    202 ObjectStyle_Callback(hObject, eventdata, handles) 
    203 
    204 %-----------
    205 function update_parentbutton(ParentButton,titl)
    206 
    207 if isstruct(ParentButton)
    208     parentfields=fields(ParentButton);
    209     for ibutton=1:length(parentfields)
    210         buttonhandle=eval(['ParentButton.' parentfields{ibutton}]);
    211         if ishandle(buttonhandle)
    212             set(buttonhandle,'Value',0)
    213             set(buttonhandle,'BackgroundColor',[0 1 0])%put unactivated buttons to green
    214         end
    215     end
    216     if isfield(ParentButton,titl)
    217        buttonhandle=eval(['ParentButton.' titl]);
    218        if ishandle(buttonhandle)
    219             set(buttonhandle,'Value',1)
    220             set(buttonhandle,'BackgroundColor',[1 1 0])%put activated button to yellow
    221        end
    222     end
    223 end
    224 %------------
    225 function Phi_Callback(hObject, eventdata, handles)
    226 update_slider(hObject, eventdata,handles)
    227 
    228 function Theta_Callback(hObject, eventdata, handles)
    229 update_slider(hObject, eventdata,handles)
    230 
    231 function update_slider(hObject, eventdata,handles)
    232 %rotation angles
    233 Phi=(pi/180)*str2num(get(handles.Phi,'String'));%first Euler angle in radian
    234 Theta=(pi/180)*str2num(get(handles.Theta,'String'));%second Euler angle in radian
    235 
    236 %components of the unitiy vector normal to the projection plane
    237 NormVec_X=-sin(Phi)*sin(Theta);
    238 NormVec_Y=cos(Phi)*sin(Theta);
    239 NormVec_Z=cos(Theta);
    240 huvmat=findobj('Tag','uvmat');%find the current uvmat interface handle
    241 UvData=get(huvmat,'UserData');%Data associated to the current uvmat interface
    242 Z=NormVec_X *(UvData.X)+NormVec_Y *(UvData.Y)+NormVec_Z *(UvData.Z);
    243 set(handles.z_slider,'Min',min(Z))
    244 set(handles.z_slider,'Max',max(Z))
    245 ZMax_Callback(hObject, eventdata, handles)
    246 
    247 function DX_Callback(hObject, eventdata, handles)
    248 
    249 
    250 function DY_Callback(hObject, eventdata, handles)
    251 
    252 
    253 function DZ_Callback(hObject, eventdata, handles)
    254 
    25593
    25694
     
    362200
    363201%-----------------------------------------------------------------------
    364 % --- Executes on button press in edit: PLOT the defined object and its projected field
    365 function edit_Callback(hObject, eventdata, handles)
    366 hsetobject=get(hObject,'parent');
    367 SetData=get(hsetobject,'UserData');%get the hidden interface data
    368 %IndexObj=SetData.IndexObj%index of the current projection object in the list of projection objects (UvData.ProjObject)
    369 huvmat=findobj('Tag','uvmat');%find the current uvmat interface handle
    370 UvData=get(huvmat,'UserData');%Data associated to the current uvmat interface
    371 if isfield(UvData,'CuurentObjectIndex')
    372     IndexObj=UvData.CurrentObjectIndex;
    373 else
    374     IndexObj=[];
    375 end
    376 ObjectData=read_set_grid(handles);%read the interface input parameters defining the object
    377 [UvData,IndexObj]=update_obj(UvData,IndexObj,ObjectData,SetData.PlotHandles);
    378 uvmat('write_plot_param',PlotHandles,UvData.Object{IndexObj}.PlotParam); %update the display of plotting parameters for the current object
    379 SetData.IndexObj=IndexObj;
    380 set(gcbf,'UserData',SetData)%update object index in the set_grid interface
    381 set(huvmat,'UserData',UvData)%update the data in the uvmat interface
     202% --- Executes on button press in plot: PLOT the defined object and its projected field
     203function plot_Callback(hObject, eventdata, handles)
     204grid_pix_A=get_grid(handles);
     205huvmat=uvmat(get(handles.image_1,'String'));
     206hhuvmat=guidata(huvmat);
     207set(hhuvmat.transform_fct,'Value',1)
     208uvmat('run0_Callback',hObject,eventdata,hhuvmat); %file input with xml reading  in uvmat
     209axes(hhuvmat.axes3);
     210hold on
     211plot(grid_pix_A(:,1),grid_pix_A(:,2),'.')
     212
     213% --- Executes on button press in plot_2.
     214function plot_2_Callback(hObject, eventdata, handles)
     215[grid_pix_A,grid_pix_B]=get_grid(handles);
     216huvmat=uvmat(get(handles.image_2,'String'));
     217hhuvmat=guidata(huvmat);
     218set(hhuvmat.transform_fct,'Value',1)
     219uvmat('run0_Callback',hObject,eventdata,hhuvmat); %file input with xml reading  in uvmat
     220axes(hhuvmat.axes3);
     221hold on
     222plot(grid_pix_B(:,1),grid_pix_B(:,2),'.')
     223
    382224
    383225
     
    401243delete_object(IndexObj);
    402244
    403 %----------------------------------------------------
    404 function YMin_Callback(hObject, eventdata, handles)
    405 % hObject    handle to YMin (see GCBO)
    406 % eventdata  reserved - to be defined in a future version of MATLAB
    407 % handles    structure with handles and user data (see GUIDATA)
    408 
    409 % Hints: get(hObject,'String') returns contents of YMin as text
    410 %        str2double(get(hObject,'String')) returns contents of YMin as a double
    411 
    412 
    413 function ZMin_Callback(hObject, eventdata, handles)
    414 
    415 
    416 function ZMax_Callback(hObject, eventdata, handles)
    417 DZ=str2num(get(handles.ZMax,'String'));
    418 ZMin=get(handles.z_slider,'Min');
    419 ZMax=get(handles.z_slider,'Max');
    420 rel_step(1)=DZ/(ZMax-ZMin);
    421 rel_step(2)=0.2;
    422 set(handles.z_slider,'SliderStep',rel_step)
    423 
    424 function YMax_Callback(hObject, eventdata, handles)
    425 
    426 
    427 function XMin_Callback(hObject, eventdata, handles)
    428 
    429 
    430 function XMax_Callback(hObject, eventdata, handles)
    431 
    432245
    433246% ------------------------------------------------------
    434247function save_Callback(hObject, eventdata, handles)
    435248% ------------------------------------------------------
    436 Object=read_set_object(handles);%read the set_grid interface;
    437 DX=Object.DX;
    438 DY=Object.DY;
    439 RangeX=Object.RangeX;
    440 RangeY=Object.RangeY;
    441  array_realx=[RangeX(2):DX:RangeX(1)];
    442  array_realy=[RangeY(2):DY:RangeY(1)];
    443  nx_patch=length(array_realx);
    444  ny_patch=length(array_realy);
    445  [grid_realx,grid_realy]=meshgrid(array_realx,array_realy);
    446  grid_real(:,1)=reshape(grid_realx,nx_patch*ny_patch,1);
    447  grid_real(:,2)=reshape(grid_realy,nx_patch*ny_patch,1);
    448  grid_real(:,3)=zeros(nx_patch*ny_patch,1);
     249[grid_pix_A,grid_pix_B]=get_grid(handles);
     250
     251 %ECRIRE FICHIERS
     252nbpointsA=size(grid_pix_A);
     253XA=grid_pix_A(:,1);
     254YA=grid_pix_A(:,2);
     255unitcolumn=32*ones(size(XA));
     256Xchar=num2str(XA);
     257blanc=char(unitcolumn);
     258Ychar=num2str(YA);
     259tete=['1 ' num2str(nbpointsA(1))];
     260txt=[Xchar blanc Ychar];
     261textgrid={tete;txt};
     262textout=char(textgrid);
     263imageA=get(handles.image_1,'String');
     264[Pathsub]=name2display(imageA);
     265Answer = msgbox_uvmat('INPUT_TXT','grid file name (*.grid)',fullfile(Pathsub,'gridA.grid'));
     266% Answer = inputdlg('grid file name (*.grid)',' ',1,{fullfile(Pathsub,'gridA.grid')},'on');
     267dlmwrite(Answer,textout,'');
     268msgbox_uvmat('CONFIRMATION',[Answer ' written as ASCII text file']);
     269if ~isempty(grid_pix_B)
     270    nbpointsB=size(grid_pix_B);
     271    XB=grid_pix_B(:,1);
     272    YB=grid_pix_B(:,2);
     273    unitcolumn=32*ones(size(XB));
     274    Xchar=num2str(XB);
     275    blanc=char(unitcolumn);
     276    Ychar=num2str(YB);
     277    tete=['1 ' num2str(nbpointsB(1))];
     278    txt=[Xchar blanc Ychar];
     279    textgrid={tete;txt};
     280    textout=char(textgrid);
     281    Answer = msgbox_uvmat('INPUT_TXT','grid file name (*.grid)',fullfile(Pathsub,'gridB.grid'));
     282    dlmwrite(Answer,textout,'');
     283    msgbox_uvmat('CONFIRMATION',[Answer ' written as ASCII text file']);
     284end
     285
     286%-------------------------
     287function [grid_pix_A,grid_pix_B]=get_grid(handles);
     288%Object=read_set_object(handles);%read the set_grid interface;
     289grid_pix_B=[];%default
     290DX=str2num(get(handles.DX,'String'));
     291DY=str2num(get(handles.DY,'String'));
     292XMin=str2num(get(handles.XMin,'String'));
     293XMax=str2num(get(handles.XMax,'String'));
     294YMin=str2num(get(handles.YMin,'String'));
     295YMax=str2num(get(handles.YMax,'String'));
     296array_realx=[XMin:DX:XMax];
     297array_realy=[YMin:DY:YMax];
     298nx_patch=length(array_realx);
     299ny_patch=length(array_realy);
     300[grid_realx,grid_realy]=meshgrid(array_realx,array_realy);
     301grid_real(:,1)=reshape(grid_realx,nx_patch*ny_patch,1);
     302grid_real(:,2)=reshape(grid_realy,nx_patch*ny_patch,1);
     303grid_real(:,3)=zeros(nx_patch*ny_patch,1);
    449304 
    450305imageA=get(handles.image_1,'String');
     
    482337     tsaiA=[];
    483338end
    484 size(grid_real)
    485 tsaiA
    486 if isempty(tsaiA)
     339MenuCoord=get(handles.MenuCoord,'String');
     340val=get(handles.MenuCoord,'Value');
     341if isempty(tsaiA)||strcmp(MenuCoord{val},'px')
    487342    grid_imaA(:,1)=grid_real(:,1);
    488343    grid_imaA(:,2)=grid_real(:,2);
     
    544399grid_real2(:,2)=grid_real_y;
    545400grid_real2(:,3)=zeros(nx_patch_new,1);
    546 if isempty(tsaiA)
     401if isempty(tsaiA)||strcmp(MenuCoord{val},'px')
    547402    grid_pix_A(:,1)=grid_real2(:,1);
    548403   grid_pix_A(:,2)= grid_real2(:,2);
     
    554409end
    555410
    556  %ECRIRE FICHIERS
    557 nbpointsA=size(grid_pix_A);
    558 XA=grid_pix_A(:,1);
    559 YA=grid_pix_A(:,2);
    560 unitcolumn=32*ones(size(XA));
    561 Xchar=num2str(XA);
    562 blanc=char(unitcolumn);
    563 Ychar=num2str(YA);
    564 tete=['1 ' num2str(nbpointsA(1))];
    565 txt=[Xchar blanc Ychar];
    566 textgrid={tete;txt};
    567 textout=char(textgrid);
    568 Answer = msgbox_uvmat('INPUT_TXT','grid file name (*.grid)',fullfile(Pathsub,'gridA.grid'));
    569 % Answer = inputdlg('grid file name (*.grid)',' ',1,{fullfile(Pathsub,'gridA.grid')},'on');
    570 dlmwrite(Answer,textout,'');
    571 msgbox_uvmat('CONFIRMATION',[Answer ' written as ASCII text file']);
    572 if testB
    573     nbpointsB=size(grid_pix_B);
    574     XB=grid_pix_B(:,1);
    575     YB=grid_pix_B(:,2);
    576     unitcolumn=32*ones(size(XB));
    577     Xchar=num2str(XB);
    578     blanc=char(unitcolumn);
    579     Ychar=num2str(YB);
    580     tete=['1 ' num2str(nbpointsB(1))];
    581     txt=[Xchar blanc Ychar];
    582     textgrid={tete;txt};
    583     textout=char(textgrid);
    584     Answer = msgbox_uvmat('INPUT_TXT','grid file name (*.grid)',fullfile(Pathsub,'gridB.grid'));
    585     dlmwrite(Answer,textout,'');
    586     msgbox_uvmat('CONFIRMATION',[Answer ' written as ASCII text file']);
    587 end
    588 
    589 
    590 % --- Executes on slider movement.
    591 function z_slider_Callback(hObject, eventdata, handles)
    592 %A ADAPTER
    593 Z_value=get(handles.z_slider,'Value');
    594 
    595 %rotation angles
    596 Phi=(pi/180)*str2num(get(handles.Phi,'String'));%first Euler angle in radian
    597 Theta=(pi/180)*str2num(get(handles.Theta,'String'));%second Euler angle in radian
    598 
    599 %components of the unity vector normal to the projection plane
    600 NormVec_X=-sin(Phi)*sin(Theta);
    601 NormVec_Y=cos(Phi)*sin(Theta);
    602 NormVec_Z=cos(Theta);
    603 
    604 %set new plane position and update graph
    605 set(handles.XObject,'String',num2str(NormVec_X*Z_value))
    606 set(handles.YObject,'String',num2str(NormVec_Y*Z_value))
    607 set(handles.ZObject,'String',num2str(NormVec_Z*Z_value))
    608 edit_Callback(hObject, eventdata, handles)
    609 
    610 
    611 
    612 function XObject_Callback(hObject, eventdata, handles)
    613 
    614 
    615 function YObject_Callback(hObject, eventdata, handles)
    616 
    617 
    618 
    619 
    620 function ZObject_Callback(hObject, eventdata, handles)
    621 
    622 
    623 function image_2_Callback(hObject, eventdata, handles)
    624 % hObject    handle to image_2 (see GCBO)
    625 % eventdata  reserved - to be defined in a future version of MATLAB
    626 % handles    structure with handles and user data (see GUIDATA)
    627 
    628 % Hints: get(hObject,'String') returns contents of image_2 as text
    629 %        str2double(get(hObject,'String')) returns contents of image_2 as a double
    630 
    631 
    632 
    633 function image_1_Callback(hObject, eventdata, handles)
    634 % hObject    handle to image_1 (see GCBO)
    635 % eventdata  reserved - to be defined in a future version of MATLAB
    636 % handles    structure with handles and user data (see GUIDATA)
    637 
    638 % Hints: get(hObject,'String') returns contents of image_1 as text
    639 %        str2double(get(hObject,'String')) returns contents of image_1 as a double
    640 
    641 
     411
     412
     413%------------------------------------------------------------------------
    642414% --- Executes on button press in HELP.
    643415function HELP_Callback(hObject, eventdata, handles)
     416%------------------------------------------------------------------------
    644417path_to_uvmat=which ('uvmat');% check the path of uvmat
    645418pathelp=fileparts(path_to_uvmat);
    646 helpfile=fullfile(pathelp,'UVMAT_DOC','uvmat_doc.html');
     419helpfile=fullfile(pathelp,'uvmat_doc','uvmat_doc.html');
    647420if isempty(dir(helpfile)), errordlg('Please put the help file uvmat_doc.html in the directory UVMAT/UVMAT_DOC')
    648421else
     
    650423end
    651424
     425
     426
  • trunk/src/update_imadoc.m

    r29 r84  
    3838    end
    3939end
     40%create a new xml file
    4041if ~testappend
    4142    t=xmltree;
    4243    t=set(t,1,'name','ImaDoc');
    43     [t,uid_calib]=add(t,1,'element','GeometryCalib');
     44    % in case of movie (avi file), copy timing info in the new xml file
     45    [pp,outputroot]=fileparts(outputfile);
     46    info=[];
     47    if exist(fullfile(pp,[outputroot '.avi']),'file')
     48        info=aviinfo(fullfile(pp,[outputroot '.avi']));
     49    elseif exist(fullfile(pp,[outputroot '.AVI']),'file')
     50        info=fullfile(pp,[outputroot '.AVI']);
     51    end
     52    if ~isempty(info)
     53        [t,uid_camera]=add(t,1,'element','Camera');
     54        Camera.TimeUnit='s';
     55%         Camera.BurstTiming.FrameFrequency=info.FramesPerSecond;
     56        Camera.BurstTiming.Time=0;
     57        Camera.BurstTiming.Dti=1/info.FramesPerSecond;
     58        Camera.BurstTiming.NbDti=info.NumFrames-1;
     59        t=struct2xml(Camera,t,uid_camera)
     60    end
     61   [t,uid_calib]=add(t,1,'element','GeometryCalib');
    4462end
    4563t=struct2xml(GeometryCalib,t,uid_calib);
  • trunk/src/uvmat.m

    r82 r84  
    788788    nbfield=size(XmlData.Time,1);
    789789    nburst=size(XmlData.Time,2);
     790    %transform .Time to a column vector if it is a line vector the nomenclature uses a single index
     791    if isequal(nbfield,1) && ~isequal(nburst,1)% .Time is a line vector
     792        NomType=get(handles.FileIndex,'UserData');
     793        if numel(NomType)>=2 &&(strcmp(NomType,'_i')||strcmp(NomType(1:2),'%0')||strcmp(NomType(1:2),'_%'))
     794            XmlData.Time=(XmlData.Time)';
     795            nbfield=nburst;
     796            nburst=1;
     797        end
     798    end
    790799end
    791800last_i_cell=get(handles.last_i,'String');
     
    822831            set(handles.pycm,'String',num2str(pixcmy))
    823832        end
    824         set(handles.transform_fct,'Value',2); % phys transform by default
     833        if ~get(handles.FixedLimits,'Value')
     834            set(handles.transform_fct,'Value',2); % phys transform by default if fixedLimits is off
     835        end
    825836        if isfield(GeometryCalib,'SliceCoord')
    826837           siz=size(GeometryCalib.SliceCoord);
     
    21222133     switch FileType
    21232134        case 'movie'
    2124             A=read(UvData.MovieObject,num_i1);
     2135            try
     2136                A=read(UvData.MovieObject,num_i1);
     2137            catch
     2138                errormsg=lasterr;
     2139                return
     2140            end
    21252141        case 'avi'
    2126             mov=aviread(filename,num_i1);
     2142            try
     2143                mov=aviread(filename,num_i1);
     2144            catch
     2145                errormsg=lasterr;
     2146                return
     2147            end
    21272148            A=frame2im(mov(1));
    21282149        case 'vol'
     
    28142835else
    28152836    set(handles.FixedLimits,'BackgroundColor',[0.7 0.7 0.7])
     2837    update_plot(handles);
    28162838end
    28172839
     
    42084230% --- Executes on button press in grid.
    42094231function grid_Callback(hObject, eventdata, handles)
    4210 %-------------------------------------------------------------------
    4211 
    4212 UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface
    4213 
    4214 %suppress the other options if grid is chosen
    4215 set(handles.edit_vect,'Value',0)
    4216 edit_vect_Callback(hObject, eventdata, handles)
    4217 set(handles.edit,'BackgroundColor',[0.7 0.7 0.7])
    4218 set(handles.edit_vect,'Value',0) 
    4219 edit_vect_Callback(hObject, eventdata, handles)
    4220 set(handles.edit,'BackgroundColor',[0.7 0.7 0.7])
    4221 set(handles.list_object_1,'Value',1)     
    4222 
    4223 %prepare display of the set_grid GUI
    4224 data.fixedtitle=1;
    4225 FileName=read_file_boxes(handles);
    4226 [hset_object,UvData.sethandles]=set_grid(FileName);% call the set_object interface
    4227 set(handles.uvmat,'UserData',UvData);
     4232
    42284233
    42294234
     
    47064711%-- open the GUI set_grid.fig to create grid
    47074712function MenuGrid_Callback(hObject, eventdata, handles)
    4708 set(handles.TOOLS_txt,'Visible','on')
    4709 set(handles.frame_tools,'Visible','on')
    4710 grid_Callback(hObject,eventdata,handles)
     4713%UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface
     4714
     4715%suppress the other options if grid is chosen
     4716set(handles.edit_vect,'Value',0)
     4717edit_vect_Callback(hObject, eventdata, handles)
     4718set(handles.edit,'BackgroundColor',[0.7 0.7 0.7])
     4719set(handles.edit_vect,'Value',0) 
     4720edit_vect_Callback(hObject, eventdata, handles)
     4721set(handles.edit,'BackgroundColor',[0.7 0.7 0.7])
     4722set(handles.list_object_1,'Value',1)     
     4723
     4724%prepare display of the set_grid GUI
     4725FileName=read_file_boxes(handles);
     4726CoordList=get(handles.transform_fct,'String');
     4727val=get(handles.transform_fct,'Value');
     4728set_grid(FileName,CoordList{val});% call the set_object interface
     4729%set(handles.uvmat,'UserData',UvData);
    47114730
    47124731%----------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.