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

checking of file input improved do deal with holes in files series

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series/civ_input.m

    r716 r758  
    8282
    8383%% input file info
    84 RootPath=Param.InputTable{1,1};
    85 %set(handles.RootPath,'String',RootPath)
    86 RootFile=Param.InputTable{1,3};
    87 SubDir=Param.InputTable{1,2};
     84% RootPath=Param.InputTable{1,1};
     85% %set(handles.RootPath,'String',RootPath)
     86% RootFile=Param.InputTable{1,3};
     87% SubDir=Param.InputTable{1,2};
    8888NomTypeInput=Param.InputTable{1,4};
    89 FileExt=Param.InputTable{1,5};
     89% FileExt=Param.InputTable{1,5};
    9090FileType='image';%fdefault
    9191FileInfo=[];
     
    293293            hparent=get(hcheckgrid(ilist),'parent');%handles of the parent panel
    294294            hchildren=get(hparent,'children');
    295             handle_txtbox=findobj(hchildren,'tag','Grid');% look for the grid name box in the same panel
     295            %handle_txtbox=findobj(hchildren,'tag','Grid');% look for the grid name box in the same panel
    296296            handle_dx=findobj(hchildren,'tag','num_Dx');
    297297            handle_dy=findobj(hchildren,'tag','num_Dy');
     
    901901function ListPairCiv2_Callback(hObject, eventdata, handles)
    902902%------------------------------------------------------------------------
    903 index_pair=get(handles.ListPairCiv2,'Value');%get the selected position index in the menu
    904 
    905 %update MinIndex_i and last_i according to the chosen image pairs
    906 mode_list=get(handles.ListPairMode,'String');
    907 mode_value=get(handles.ListPairMode,'Value');
    908 mode=mode_list{mode_value};
    909 if isequal(mode,'series(Di)')
    910     first_i=str2double(get(handles.MinIndex_i,'String'));
    911     last_i=str2double(get(handles.last_i,'String'));
    912     incr_i=str2double(get(handles.incr_i,'String'));
    913     num_i=first_i:incr_i:last_i;
    914     lastfield=str2double(get(handles.MaxIndex_i,'String'));
    915     if ~isnan(lastfield)
    916         test_find=(num_i-floor(index_pair/2)*ones(size(num_i))>0)& ...
    917             (num_i+ceil(index_pair/2)*ones(size(num_i))<=lastfield);
    918         num_i=num_i(test_find);
    919     end
    920     set(handles.MinIndex_i,'String',num2str(num_i(1)));
    921     set(handles.last_i,'String',num2str(num_i(end)));
    922 elseif isequal(mode,'series(Dj)')
    923     first_j=str2double(get(handles.MinIndex_j,'String'));
    924     last_j=str2double(get(handles.last_j,'String'));
    925     incr_j=str2double(get(handles.incr_j,'String'));
    926     num_j=first_j:incr_j:last_j;
    927     lastfield2=str2double(get(handles.MaxIndex_j,'String'));
    928     if ~isnan(lastfield2)
    929         test_find=(num_j-floor(index_pair/2)*ones(size(num_j))>0)& ...
    930             (num_j+ceil(index_pair/2)*ones(size(num_j))<=lastfield2);
    931         num_j=num_j(test_find);
    932     end
    933     set(handles.MinIndex_j,'String',num2str(num_j(1)));
    934     set(handles.last_j,'String',num2str(num_j(end)));
    935 end
     903% index_pair=get(handles.ListPairCiv2,'Value');%get the selected position index in the menu
     904%
     905% %update MinIndex_i and last_i according to the chosen image pairs
     906% mode_list=get(handles.ListPairMode,'String');
     907% mode_value=get(handles.ListPairMode,'Value');
     908% mode=mode_list{mode_value};
     909% if isequal(mode,'series(Di)')
     910%     first_i=str2double(get(handles.MinIndex_i,'String'));
     911%     last_i=str2double(get(handles.MaxIndex_i,'String'));
     912%     incr_i=str2double(get(handles.incr_i,'String'));
     913%     num_i=first_i:incr_i:last_i;
     914%    % lastfield=str2double(get(handles.MaxIndex_i,'String'));
     915%     if ~isnan(last_i)
     916%         test_find=(num_i-floor(index_pair/2)*ones(size(num_i))>0)& ...
     917%             (num_i+ceil(index_pair/2)*ones(size(num_i))<=last_i);
     918%         num_i=num_i(test_find);
     919%     end
     920%     set(handles.MinIndex_i,'String',num2str(num_i(1)));
     921%     set(handles.MaxIndex_i,'String',num2str(num_i(end)));
     922% elseif isequal(mode,'series(Dj)')
     923%     first_j=str2double(get(handles.MinIndex_j,'String'));
     924%     last_j=str2double(get(handles.last_j,'String'));
     925%     incr_j=str2double(get(handles.incr_j,'String'));
     926%     num_j=first_j:incr_j:last_j;
     927%     lastfield2=str2double(get(handles.MaxIndex_j,'String'));
     928%     if ~isnan(lastfield2)
     929%         test_find=(num_j-floor(index_pair/2)*ones(size(num_j))>0)& ...
     930%             (num_j+ceil(index_pair/2)*ones(size(num_j))<=lastfield2);
     931%         num_j=num_j(test_find);
     932%     end
     933%     set(handles.MinIndex_j,'String',num2str(num_j(1)));
     934%     set(handles.last_j,'String',num2str(num_j(end)));
     935% end
    936936
    937937%------------------------------------------------------------------------
     
    10951095end
    10961096
    1097 %% determine the default selection in the pair menu
     1097%% determine the default selection in the pair menu for Civ1
    10981098ichoice=find(select,1);% index of selected pair
    10991099if (isempty(ichoice) || ichoice < 1); ichoice=1; end;
     
    11021102    set(handles.ListPairCiv1,'Value',ichoice);% first valid pair proposed by default in the menu
    11031103end
    1104 initial=get(handles.ListPairCiv2,'Value');
    1105 if initial>length(displ_pair')%|~isequal(select(initial),1)
    1106     if ichoice <= length(displ_pair')
    1107         set(handles.ListPairCiv2,'Value',ichoice);% same pair proposed by default for civ2
    1108     else
    1109         set(handles.ListPairCiv2,'Value',1);% same pair proposed by default for civ2
    1110     end
     1104
     1105%% determine the default selection in the pair menu for Civ2
     1106if strcmp(get(handles.ListPairCiv2,'Visible'),'on')
     1107    initial=get(handles.ListPairCiv2,'Value');
     1108    if initial>length(displ_pair')%|~isequal(select(initial),1)
     1109        if ichoice <= length(displ_pair')
     1110            set(handles.ListPairCiv2,'Value',ichoice);% same pair proposed by default for civ2
     1111        else
     1112            set(handles.ListPairCiv2,'Value',1);% same pair proposed by default for civ2
     1113        end
     1114    end
     1115else
     1116    set(handles.ListPairCiv2,'Value',get(handles.ListPairCiv1,'Value'))% initiate the choice of Civ2 as a reproduction of if civ1
    11111117end
    11121118set(handles.ListPairCiv2,'String',displ_pair');
    1113 set(gcf,'Pointer','arrow')
     1119set(gcf,'Pointer','arrow')% Indicate that the process is finished
    11141120
    11151121
Note: See TracChangeset for help on using the changeset viewer.