Changeset 1120 for trunk/src


Ignore:
Timestamp:
Dec 15, 2022, 6:21:53 PM (2 years ago)
Author:
sommeria
Message:

various corrections

Location:
trunk/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/find_file_series.m

    r1107 r1120  
    4949
    5050%% get input root name and info on the input file
    51 if isempty(regexp(FilePath,'^http://'))
     51if isempty(regexp(FilePath,'^http://','once'))
    5252fullfileinput=fullfile(FilePath,fileinput);% input file name with path
    5353else
  • trunk/src/geometry_calib.m

    r1115 r1120  
    190190end
    191191
    192 %% read coordinates of the calibration poinnts: Coord(:,1-3) in phys, Coord(:,4-5) image
     192%% read coordinates of the calibration points: Coord(:,1-3) in phys, Coord(:,4-5) image
    193193Coord=get(handles.ListCoord,'Data');
     194if isempty(Coord)
     195    msgbox_uvmat('ERROR','introduce calibration points in the table Coord, or use the Tools Set scale')
     196    return
     197end
    194198
    195199
  • trunk/src/get_file_info.m

    r1107 r1120  
    6262    FileInfo.FileName=fileinput;
    6363    FileInfo.FileType='txt'; %default
    64 else
    65     return %input file does not exist.
     64% else
     65%     return %input file does not exist.
    6666end
    6767[tild,tild,FileExt]=fileparts(fileinput);%get the file extension FileExt
     
    117117            if ~isempty(FileExt)
    118118                if ~isempty(imformats(FileExt))%case of images
     119                    FileInfo.FileType='image';
    119120                    try
    120121                        imainfo=imfinfo(fileinput);
  • trunk/src/series.m

    r1119 r1120  
    621621ActionInput_Callback([],[], handles)
    622622
    623 
     623%------------------------------------------------------------------------
     624% --- check the input file series.
    624625function check_input_file_series(handles)
     626%------------------------------------------------------------------------
    625627InputTable=get(handles.InputTable,'Data');
    626628set(handles.series,'Pointer','watch') % set the mouse pointer to 'watch'
     
    629631empty_line=false(size(InputTable,1),1);
    630632for iline=1:size(InputTable,1)
    631     empty_line(iline)= isempty(cell2mat(InputTable(iline,1:3)));
     633    empty_line(iline)= isempty(cell2mat(InputTable(iline,1:3)));%check the empty lines in the input table
    632634end
    633635if ~isempty(find(empty_line,1))
     
    649651        RootFile='';
    650652    else %scan the input folder
    651         InputTable{iview,3}=regexprep(InputTable{iview,3},'^/','');
     653        InputTable{iview,3}=regexprep(InputTable{iview,3},'^/','');%suppress '/' at the beginning of the input name
     654        i1=str2num(get(handles.num_first_i,'String'));
     655        j1=str2num(get(handles.num_first_j,'String'));
     656        InputFile=fullfile_uvmat('','',InputTable{iview,3},InputTable{iview,5},InputTable{iview,4},i1,[],j1,[])
    652657            [RootPath,~,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileInfo,MovieObject]=...
    653                 find_file_series(fullfile(InputTable{iview,1},InputTable{iview,2}),[InputTable{iview,3} InputTable{iview,4} InputTable{iview,5}]);
     658                find_file_series(fullfile(InputTable{iview,1},InputTable{iview,2}),InputFile);
    654659    end
    655660    % if no file is found, open a browser
  • trunk/src/series/stereo_civ.m

    r1118 r1120  
    1 %'civ_series': PIV function activated by the general GUI series
     1%'stereo_series': PIV function activated by the general GUI series
    22% --- call the sub-functions:
    33%   civ: PIV function itself
     
    4141Data=[];
    4242errormsg='';
     43
    4344%% set the input elements needed on the GUI series when the action is selected in the menu ActionName or InputTable refreshed
    4445if isstruct(Param) && isequal(Param.Action.RUN,0)% function activated from the GUI series but not RUN
     
    4950    path_series=fileparts(which('series'));
    5051    addpath(fullfile(path_series,'series'))
    51     Data=stereo_input(Param);% introduce the civ parameters using the GUI civ_input
     52    Data=stereo_input(Param);% introduce the civ parameters using the GUI stereo_input
    5253    if isempty(Data)
    5354        Data=Param;% if  civ_input has been cancelled, keep previous parameters
     
    13091310mtz=(XmlData{1}.GeometryCalib.Tx_Ty_Tz(1,3)+XmlData{2}.GeometryCalib.Tx_Ty_Tz(1,3))/2;
    13101311
    1311 Error=(sqrt(mfx^2+mfy^2)/(2*sqrt(2)*mtz)).*(((Dyb-Dya).*(-u)-(Dxb-Dxa).*(-v))./Den);
    1312 
     1312%Error=(sqrt(mfx^2+mfy^2)/(2*sqrt(2)*mtz)).*(((Dyb-Dya).*(-u)-(Dxb-Dxa).*(-v))./sqrt(Den));
     1313Error=(((Dyb-Dya).*(-u)-(Dxb-Dxa).*(-v))./sqrt(Den));
    13131314z=((Dxb-Dxa).*(-u)+(Dyb-Dya).*(-v))./Den;
    13141315
  • trunk/src/uvmat.m

    r1118 r1120  
    12091209UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface
    12101210Slice=[];
     1211Check_slice=0;
    12111212if isfield(UvData,'XmlData')
     1213    if isfield(UvData.XmlData{1},'GeometryCalib') && strcmp(UvData.XmlData{1}.GeometryCalib.CalibrationType(1:3),'3D_')
     1214        Check_slice=1;
     1215    end
    12121216    if isfield(UvData.XmlData{1},'GeometryCalib')&& isfield(UvData.XmlData{1}.GeometryCalib,'SliceCoord')
    12131217        Slice=UvData.XmlData{1}.GeometryCalib;%old convention < 2022
     
    12151219        Slice=UvData.XmlData{1}.Slice;% new convention ( 2022)
    12161220    end
     1221end
     1222if ~Check_slice
     1223    msgbox_uvmat('ERROR','3D calibration not available, use Tools/geometric calibration with 3D option');
     1224    return
    12171225end
    12181226% default input
     
    12951303
    12961304uicontrol('Style','edit','Units','normalized', 'Position', [3*ii+ww 0.95-5*ii-4.2*hh ww hh],'tag','num_SliceCoord_1','BackgroundColor',[1 1 1],...
    1297     'String',num2str(Slice.SliceCoord(1)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_SliceCoord_1'':x position of the tild origin');%edit box
     1305    'String',num2str(Slice.SliceCoord(1,1)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_SliceCoord_1'':x position of the tild origin');%edit box
    12981306uicontrol('Style','edit','Units','normalized', 'Position', [3*ii+ww 0.95-6*ii-5.2*hh ww hh],'tag','num_SliceCoord_2','BackgroundColor',[1 1 1],...
    1299     'String',num2str(Slice.SliceCoord(2)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_SliceCoord_2'':y position of the tild origin');%edit box
     1307    'String',num2str(Slice.SliceCoord(1,2)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_SliceCoord_2'':y position of the tild origin');%edit box
    13001308
    13011309uicontrol('Style','text','Units','normalized', 'Position', [ii 0.95-5*ii-4*hh 1.3*ww hh/2],'BackgroundColor',BackgroundColor,'Tag','Angle_title_1',...
     
    13531361[RootPath,SubDir,RootFile,tild,tild,tild,tild,FileExt]=fileparts_uvmat(FileName);
    13541362XmlFile=find_imadoc(RootPath,SubDir,RootFile,FileExt);%find name of the relevant xml file
    1355 % [s,errormsg]=imadoc2struct(XmlFile,'Slice');%read the xml file
    1356 % if~isempty(errormsg)
    1357 %     msgbox_uvmat('ERROR',errormsg)
    1358 %     return
    1359 % end
    1360 % Slice=s.Slice;% get thegeometric calibration data
     1363if isempty(XmlFile)
     1364    msgbox_uvmat('ERROR','an xml file with calibration parameters must be first created, use Tools/geometric calibration');
     1365    return
     1366end
     1367[s,RootTag,errormsg]=xml2struct(XmlFile);
    13611368
    13621369%% read the content of the GUI set_slice
     
    13701377    Z_plane=linspace(SliceData.Z(1),SliceData.Z(2),SliceData.NbSlice);
    13711378else
    1372     set(hZ,'String',num2str(Z_plane))% restitute the display qfter reqding by read_GUI
     1379    set(hZ,'String',num2str(Z_plane))% restitute the display after reading by read_GUI
    13731380end
    13741381Slice.SliceCoord=Z_plane'*[0 0 1];
     
    33153322        elseif ref_i_1+1>size(UvData.i1_series{2},3)&&~isempty(InputFile.NomType_1)
    33163323            errormsg='maximum i index reached for the second series (reload the input file to update the index bound)';
    3317         elseif ref_j_1+1>size(UvData.i1_series{2},2)&&~isempty(InputFile.NomType_1)
    3318             errormsg='maximum j index reached for the second series(reload the input file to update the index bound)';
     3324        %elseif ref_j_1+1>size(UvData.i1_series{2},2)&&~isempty(InputFile.NomType_1)
     3325         %   errormsg='maximum j index reached for the second series(reload the input file to update the index bound)';
    33193326        end
    33203327        if ~isempty(errormsg),return,end
Note: See TracChangeset for help on using the changeset viewer.