Changeset 757 for trunk/src


Ignore:
Timestamp:
Apr 29, 2014, 10:10:30 AM (11 years ago)
Author:
sommeria
Message:

a few bug repairs

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/geometry_calib.m

    r755 r757  
    816816end
    817817
    818 
    819818% --------------------------------------------------------------------
    820819function MenuHelp_Callback(hObject, eventdata, handles)
    821 path_to_uvmat=which('uvmat');% check the path of uvmat
    822 pathelp=fileparts(path_to_uvmat);
    823 helpfile=fullfile(pathelp,'uvmat_doc','uvmat_doc.html');
    824 if isempty(dir(helpfile)), msgbox_uvmat('ERROR','Please put the help file uvmat_doc.html in the sub-directory /uvmat_doc of the UVMAT package')
    825 else
    826    addpath (fullfile(pathelp,'uvmat_doc'))
    827    web([helpfile '#geometry_calib'])
    828 end
     820web('http://servforge.legi.grenoble-inp.fr/projects/soft-uvmat/wiki/UvmatHelp#a8-Geometriccalibration')
     821% path_to_uvmat=which('uvmat');% check the path of uvmat
     822% pathelp=fileparts(path_to_uvmat);
     823% helpfile=fullfile(pathelp,'uvmat_doc','uvmat_doc.html');
     824% if isempty(dir(helpfile)), msgbox_uvmat('ERROR','Please put the help file uvmat_doc.html in the sub-directory /uvmat_doc of the UVMAT package')
     825% else
     826%    addpath (fullfile(pathelp,'uvmat_doc'))
     827%    web([helpfile '#geometry_calib'])
     828% end
    829829
    830830% --------------------------------------------------------------------
    831831function MenuSetScale_Callback(hObject, eventdata, handles)
    832832
    833  answer=msgbox_uvmat('INPUT_TXT','scale pixel/cm?','');
    834  %create test points
    835  huvmat=findobj(allchild(0),'Name','uvmat');%find the current uvmat interface handle
    836 UvData=get(huvmat,'UserData');%Data associated to the current uvmat interface
    837 npy=size(UvData.Field.A,1);
    838 npx=size(UvData.Field.A,2);
     833answer=msgbox_uvmat('INPUT_TXT','scale pixel/cm?','');
     834%create test points
     835huvmat=findobj(allchild(0),'Name','uvmat');%find the current uvmat interface handle
     836hhuvmat=guidata(huvmat);
     837if ~strcmp(get(hhuvmat.Scalar,'Visible'),'on')
     838    msgbox_uvmat('ERROR','An image needs to be opened in uvmat for calibration')
     839    return
     840end
     841set(handles.calib_type,'Value',1)% set calib option to 'rescale'
     842npx=str2num(get(hhuvmat.num_Npx,'String'))/2;
     843npy=str2num(get(hhuvmat.num_Npy,'String'))/2;
    839844Xima=[0.25*npx 0.75*npx 0.75*npx 0.25*npx]';
    840845Yima=[0.25*npy 0.25*npy 0.75*npy 0.75*npy]';
  • trunk/src/get_file_series.m

    r754 r757  
    1 %'get_file_series': determine the list of file names and file indices for functions called by 'series'.
     1%'get_file_series': determine the list of input file names and file indices for functions called by 'series'.
    22%------------------------------------------------------------------------
    33% [filecell,i1_series,i2_series,j1_series,j2_series]=get_file_series(Param)
     
    1515function [filecell,i1_series,i2_series,j1_series,j2_series]=get_file_series(Param)
    1616
    17 filecell={};i1_series={};i2_series={};j1_series={};j2_series={};
     17filecell={};
    1818InputTable=Param.InputTable;
    1919first_i=Param.IndexRange.first_i;
    2020incr_i=Param.IndexRange.incr_i;
    2121last_i=Param.IndexRange.last_i;
    22 % ref_i=first_i:incr_i:last_i;
    23 %ref_j=[];
    2422first_j=[];last_j=[];incr_j=1;%default
    2523if isfield(Param.IndexRange,'first_j')&& isfield(Param.IndexRange,'last_j')
     
    3230
    3331%% determine the list of input file names
    34 nbmissing=0;
     32% nbmissing=0;
    3533NbView=size(InputTable,1);
    3634i1_series=cell(NbView,1);% initiate index series with empty cells
  • trunk/src/series.m

    r752 r757  
    757757        set(handles.num_incr_i,'String',num2str(diff_i_max(1)))% detect an increment to dispaly by default
    758758    end
    759     if isequal (diff_j_max,diff_j_max(1)*ones(size(diff_j_max)))
     759    if ~isempty(diff_j_max) && isequal (diff_j_max,diff_j_max(1)*ones(size(diff_j_max)))
    760760        set(handles.num_incr_j,'String',num2str(diff_j_max(1)))
    761761    end
     
    771771MaxIndex_i_table=get(handles.MaxIndex_i,'Data');%retrieve the min indices in the table MinIndex
    772772MaxIndex_j_table=get(handles.MaxIndex_j,'Data');%retrieve the min indices in the table MinIndex
     773if ~isempty(MinIndex_i)&&~isempty(MaxIndex_i)
    773774MinIndex_i_table(iview,1)=MinIndex_i;
     775MaxIndex_i_table(iview,1)=MaxIndex_i;
     776end
     777if ~isempty(MinIndex_j)&&~isempty(MaxIndex_j)
    774778MinIndex_j_table(iview,1)=MinIndex_j;
    775 MaxIndex_i_table(iview,1)=MaxIndex_i;
    776779MaxIndex_j_table(iview,1)=MaxIndex_j;
     780end
    777781set(handles.MinIndex_i,'Data',MinIndex_i_table)%display the min indices in the table MinIndex
    778782set(handles.MinIndex_j,'Data',MinIndex_j_table)%display the max indices in the table MaxIndex
     
    969973    pair_max=squeeze(max(SeriesData.i1_series{iview},[],1)); %max on pair index
    970974    j_max{iview}=max(pair_max,[],1);%max on j index
     975    if ~isempty(j_max{iview})
    971976    MaxIndex_i(iview)=max(find(j_max{iview}))-1;% max ref index i
    972977    MinIndex_i(iview)=min(find(j_max{iview}))-1;% min ref index i
     978    end
    973979end
    974980MinIndex_i=min(MinIndex_i);
     
    11351141pos_first=(ref_i_1-MinIndex_i)/(MaxIndex_i-MinIndex_i+1);
    11361142pos_last=(ref_i_2-MinIndex_i+1)/(MaxIndex_i-MinIndex_i+1);
     1143if isempty(pos_first), pos_first=0; end
     1144if isempty(pos_last), pos_last=1; end
    11371145Position=get(handles.Waitbar,'Position');% position of the waitbar:= [ x,y, width, height]
    11381146Position_status=get(handles.FileStatus,'Position');
    11391147Position(1)=Position_status(1)+Position_status(3)*pos_first;
    1140 Position(3)=Position_status(3)*(pos_last-pos_first);
     1148Position(3)=max(Position_status(3)*(pos_last-pos_first),0.001);% width must remain positive
    11411149set(handles.Waitbar,'Position',Position)
    11421150update_waitbar(handles.Waitbar,0)
Note: See TracChangeset for help on using the changeset viewer.