Changeset 716 for trunk


Ignore:
Timestamp:
Feb 24, 2014, 10:51:40 PM (10 years ago)
Author:
sommeria
Message:

fct improved by reducing the input file check when selected.

Location:
trunk/src/series
Files:
6 edited

Legend:

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

    r673 r716  
    4242
    4343%% set the input elements needed on the GUI series when the action is selected in the menu ActionName
    44 if isstruct(Param) && isequal(Param.Action.RUN,0)
     44if isstruct(Param) && isequal(Param.Action.RUN,0)% function activated from the GUI series but not RUN
    4545    ParamOut.AllowInputSort='off';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
    4646    ParamOut.WholeIndexRange='off';% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
     
    5353    ParamOut.OutputDirExt='.stat';%set the output dir extension
    5454    ParamOut.OutputFileMode='NbSlice';% '=NbInput': 1 output file per input file index, '=NbInput_i': 1 file per input file index i, '=NbSlice': 1 file per slice
    55     filecell=get_file_series(Param);%check existence of the first input file
    56     if ~exist(filecell{1,1},'file')
    57         msgbox_uvmat('WARNING','the first input file does not exist')
     55    % check the existence of the first file in the series
     56    first_j=[];
     57    if isfield(Param.IndexRange,'first_j'); first_j=Param.IndexRange.first_j; end
     58    last_j=[];
     59    if isfield(Param.IndexRange,'last_j'); last_j=Param.IndexRange.last_j; end
     60    PairString='';
     61    if isfield(Param.IndexRange,'PairString'); PairString=Param.IndexRange.PairString; end
     62    [i1,i2,j1,j2] = get_file_index(Param.IndexRange.first_i,first_j,PairString);
     63    FirstFileName=fullfile_uvmat(Param.InputTable{1,1},Param.InputTable{1,2},Param.InputTable{1,3},...
     64        Param.InputTable{1,5},Param.InputTable{1,4},i1,i2,j1,j2);
     65    if ~exist(FirstFileName,'file')
     66        msgbox_uvmat('WARNING',['the first input file ' FirstFileName ' does not exist'])
     67    else
     68        [i1,i2,j1,j2] = get_file_index(Param.IndexRange.last_i,last_j,PairString);
     69        LastFileName=fullfile_uvmat(Param.InputTable{1,1},Param.InputTable{1,2},Param.InputTable{1,3},...
     70        Param.InputTable{1,5},Param.InputTable{1,4},i1,i2,j1,j2);
     71        if ~exist(FirstFileName,'file')
     72             msgbox_uvmat('WARNING',['the last input file ' LastFileName ' does not exist'])
     73        end
    5874    end
    5975    return
  • trunk/src/series/civ_input.m

    r711 r716  
    5757set(hObject,'WindowButtonDownFcn',{'mouse_down'}) % allows mouse action with right button (zoom for uicontrol display)
    5858hseries=findobj(allchild(0),'Tag','series');
    59 SeriesData.ParentHandle=hseries;
     59hhseries=guidata(hseries);
     60%SeriesData.ParentHandle=hseries;
    6061SeriesData=get(hseries,'UserData');
    6162% relevant data in gcbf:.FileType,.FileInfo,.Time,.TimeUnit,.GeometryCalib{1};
     
    8788NomTypeInput=Param.InputTable{1,4};
    8889FileExt=Param.InputTable{1,5};
     90FileType='image';%fdefault
     91FileInfo=[];
    8992if isfield(SeriesData,'FileType')&&isfield(SeriesData,'FileInfo')
    9093    FileType=SeriesData.FileType{1};%type of the first input file series
    9194    FileInfo=SeriesData.FileInfo{1};
    9295else
    93     msgbox_uvmat('ERROR','please refresh the input file series')
    94     return
     96    set(hhseries.REFRESH,'BackgroundColor',[1 0 1])
     97%     msgbox_uvmat('ERROR','please refresh the input file series')
     98%     return
    9599end
    96100
     
    127131            [PathCiv2_ImageB,Civ2_ImageB,FileExtA]=fileparts(Data.Civ2_ImageB);
    128132        end
    129         hhseries=guidata(hseries);
    130133        if size(Param.InputTable,1)==1
    131134            series('display_file_name',hhseries,Data.Civ1_ImageA,'append');%append the image series to the input list
     
    146149        return
    147150end
    148 if numel(SeriesData.FileType)>=2 && strcmp(SeriesData.FileType{end-1},'image') &&   strcmp(SeriesData.FileType{end},'image')
     151if isfield(SeriesData,'FileType') && numel(SeriesData.FileType)>=2 && strcmp(SeriesData.FileType{end-1},'image') &&   strcmp(SeriesData.FileType{end},'image')
    149152    set(handles.ListCompareMode,'Value',3)% we compare two image series term to term ('shift')
    150153    set(handles.PairIndices,'Visible','off')
     
    198201MaxIndex_j=1;%default
    199202MinIndex_j=1;
    200 if isfield(Param.IndexRange,'MaxIndex_j')&&isfield(Param.IndexRange,'MinIndex_j')
     203if isfield(Param.IndexRange,'MaxIndex_j')&&isfield(Param.IndexRange,'MinIndex_j')...
     204     && numel(Param.IndexRange.MaxIndex_j')>=iview_image &&numel(Param.IndexRange.MinIndex_j')>=iview_image 
    201205MaxIndex_j=Param.IndexRange.MaxIndex_j(iview_image);
    202206MinIndex_j=Param.IndexRange.MinIndex_j(iview_image);
     
    214218        set(handles.ListPairMode,'Value',1)% advice 'pair j1-j2' except in MaxIndex_j is large
    215219    end
    216 %elseif ~(strcmp(FileType,'video') || strcmp(FileType,'mmreader'))
    217220else
    218221    set(handles.ListPairMode,'String',{'pair j1-j2';'series(Dj)';'series(Di)'})%multiple choice
     
    284287%% introduce the stored parameters if relevant
    285288if isfield(Param,'ActionInput')
    286 fill_GUI(Param.ActionInput,hObject);%fill the GUI with the parameters retrieved from the input Param
     289    fill_GUI(Param.ActionInput,hObject);%fill the GUI with the parameters retrieved from the input Param
     290    hcheckgrid=findobj(handles.civ_input,'Tag','CheckGrid');
     291    for ilist=1:numel(hcheckgrid)
     292        if get(hcheckgrid(ilist),'Value')
     293            hparent=get(hcheckgrid(ilist),'parent');%handles of the parent panel
     294            hchildren=get(hparent,'children');
     295            handle_txtbox=findobj(hchildren,'tag','Grid');% look for the grid name box in the same panel
     296            handle_dx=findobj(hchildren,'tag','num_Dx');
     297            handle_dy=findobj(hchildren,'tag','num_Dy');
     298            handle_title_dx=findobj(hchildren,'tag','title_Dx');
     299            handle_title_dy=findobj(hchildren,'tag','title_Dy');
     300            set(handle_dx,'Visible','off');
     301            set(handle_dy,'Visible','off');
     302            set(handle_title_dy,'Visible','off');
     303            set(handle_title_dx,'Visible','off');
     304        end
     305    end
    287306end
    288307
     
    343362% detect the file type, get the movie object if relevant, and look for the corresponding file series:
    344363% the root name and indices may be corrected by including the first index i1 if a corresponding xml file exists
    345 %[RootPath,Civ1_ImageA,Civ2_ImageB,i1_series,tild,j1_series,tild,NomTypeIma,FileType,MovieObject]=find_file_series(FilePath,[FileName ImaExt]);
    346364switch Param.FileType{1}
    347365    case {'image','multimage','video','mmreader'}
  • trunk/src/series/civ_series.m

    r711 r716  
    4343addpath(fullfile(path_series,'series'))
    4444%% set the input elements needed on the GUI series when the action is selected in the menu ActionName or InputTable refreshed
    45 if isstruct(Param) && isequal(Param.Action.RUN,0)
     45if isstruct(Param) && isequal(Param.Action.RUN,0)% function activated from the GUI series but not RUN
    4646    Data=civ_input(Param);% introduce the civ parameters using the GUI civ_input
    4747    if isempty(Data)
     
    6060    Data.OutputSubDirMode='last'; %select the last subDir in the input table as root of the output subdir name (option 'all'/'first'/'last', 'all' by default)
    6161    Data.OutputFileMode='NbInput_i';% one output file expected per value of i index (used for waitbar)
    62     filecell=get_file_series(Param);%check existence of the first input file
    63     if ~exist(filecell{1,1},'file')
    64         msgbox_uvmat('WARNING','the first input file does not exist')
     62        % check the existence of the first file in the series
     63    first_j=[];
     64    if isfield(Param.IndexRange,'first_j'); first_j=Param.IndexRange.first_j; end
     65    last_j=[];
     66    if isfield(Param.IndexRange,'last_j'); last_j=Param.IndexRange.last_j; end
     67    PairString='';
     68    if isfield(Param.IndexRange,'PairString'); PairString=Param.IndexRange.PairString; end
     69    [i1,i2,j1,j2] = get_file_index(Param.IndexRange.first_i,first_j,PairString);
     70    FirstFileName=fullfile_uvmat(Param.InputTable{1,1},Param.InputTable{1,2},Param.InputTable{1,3},...
     71        Param.InputTable{1,5},Param.InputTable{1,4},i1,i2,j1,j2);
     72    if ~exist(FirstFileName,'file')
     73        msgbox_uvmat('WARNING',['the first input file ' FirstFileName ' does not exist'])
    6574    else
    66         FileType=get_file_type(filecell{1,1});
     75        FileType=get_file_type(FirstFileName);
    6776        if isempty(find(strcmp(FileType,{'civdata','image','multimage','mmreader','video'})));% =1 for images
    6877            msgbox_uvmat('ERROR',['bad input file type for ' mfilename ': an image or civdata file is needed'])
  • trunk/src/series/merge_proj.m

    r676 r716  
    5454    ParamOut.OutputDirExt='.mproj';%set the output dir extension
    5555    ParamOut.OutputFileMode='NbInput';% '=NbInput': 1 output file per input file index, '=NbInput_i': 1 file per input file index i, '=NbSlice': 1 file per slice
    56     filecell=get_file_series(Param);%check existence of the first input file
    57     if ~exist(filecell{1,1},'file')
    58         msgbox_uvmat('WARNING','the first input file does not exist')
     56      %check the input files
     57    first_j=[];
     58    if isfield(Param.IndexRange,'first_j'); first_j=Param.IndexRange.first_j; end
     59    last_j=[];
     60    if isfield(Param.IndexRange,'last_j'); last_j=Param.IndexRange.last_j; end
     61    PairString='';
     62    if isfield(Param.IndexRange,'PairString'); PairString=Param.IndexRange.PairString; end
     63    [i1,i2,j1,j2] = get_file_index(Param.IndexRange.first_i,first_j,PairString);
     64    FirstFileName=fullfile_uvmat(Param.InputTable{1,1},Param.InputTable{1,2},Param.InputTable{1,3},...
     65        Param.InputTable{1,5},Param.InputTable{1,4},i1,i2,j1,j2);
     66    if ~exist(FirstFileName,'file')
     67        msgbox_uvmat('WARNING',['the first input file ' FirstFileName ' does not exist'])
    5968    elseif isequal(size(Param.InputTable,1),1) && ~isfield(Param,'ProjObject')
    6069        msgbox_uvmat('WARNING','You may need a projection object of type plane for merge_proj')
  • trunk/src/series/sub_background.m

    r700 r716  
    6767   
    6868    %% root input file(s) and type
    69     [filecell,i1_series,i2_series,j1_series,j2_series]=get_file_series(Param);
    70     if ~exist(filecell{1,1},'file')
    71         msgbox_uvmat('WARNING','the first input file does not exist')
    72         return
    73     end
    74    
     69    % check the existence of the first file in the series
     70        first_j=[];
     71    if isfield(Param.IndexRange,'first_j'); first_j=Param.IndexRange.first_j; end
     72    last_j=[];
     73    if isfield(Param.IndexRange,'last_j'); last_j=Param.IndexRange.last_j; end
     74    PairString='';
     75    if isfield(Param.IndexRange,'PairString'); PairString=Param.IndexRange.PairString; end
     76    [i1,i2,j1,j2] = get_file_index(Param.IndexRange.first_i,first_j,PairString);
     77    FirstFileName=fullfile_uvmat(Param.InputTable{1,1},Param.InputTable{1,2},Param.InputTable{1,3},...
     78        Param.InputTable{1,5},Param.InputTable{1,4},i1,i2,j1,j2);
     79    if ~exist(FirstFileName,'file')
     80        msgbox_uvmat('WARNING',['the first input file ' FirstFileName ' does not exist'])
     81    else
     82        [i1,i2,j1,j2] = get_file_index(Param.IndexRange.last_i,last_j,PairString);
     83        LastFileName=fullfile_uvmat(Param.InputTable{1,1},Param.InputTable{1,2},Param.InputTable{1,3},...
     84        Param.InputTable{1,5},Param.InputTable{1,4},i1,i2,j1,j2);
     85        if ~exist(FirstFileName,'file')
     86             msgbox_uvmat('WARNING',['the last input file ' LastFileName ' does not exist'])
     87        end
     88    end
     89
    7590    %% check the validity of  input file types
    7691    ImageTypeOptions={'image','multimage','mmreader','video'};%allowed input file types(images)
    77     FileType=get_file_type(filecell{1,1});
     92    FileType=get_file_type(FirstFileName);
    7893    CheckImage=~isempty(find(strcmp(FileType,ImageTypeOptions), 1));% =1 for images
    7994    if ~CheckImage
     
    88103    end
    89104    %nbview=numel(i1_series);%number of input file series (lines in InputTable)
    90     nbfield_j=size(i1_series{1},1); %nb of fields for the j index (bursts or volume slices)
     105    nbfield_j=size(i1_series{1},1); %nb of fields for the j index (bursts or volume slices)%A CORRIGER !!!!!!!
    91106    nbfield_i=size(i1_series{1},2); %nb of fields for the i index
    92107    nbfield=nbfield_j*nbfield_i; %total number of fields
  • trunk/src/series/time_series.m

    r676 r716  
    4343
    4444%% set the input elements needed on the GUI series when the action is selected in the menu ActionName or InputTable refreshed
    45 if isstruct(Param) && isequal(Param.Action.RUN,0)
     45if isstruct(Param) && isequal(Param.Action.RUN,0)% function activated from the GUI series but not RUN
    4646    ParamOut.AllowInputSort='off';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
    4747    ParamOut.WholeIndexRange='off';% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
     
    5555    ParamOut.OutputDirExt='.tseries';%set the output dir extension
    5656    ParamOut.OutputFileMode='NbSlice';% '=NbInput': 1 output file per input file index, '=NbInput_i': 1 file per input file index i, '=NbSlice': 1 file per slice
    57     filecell=get_file_series(Param);%check existence of the first input file
    58     if ~exist(filecell{1,1},'file')
    59         msgbox_uvmat('WARNING','the first input file does not exist')
     57    % check the existence of the first file in the series
     58        first_j=[];
     59    if isfield(Param.IndexRange,'first_j'); first_j=Param.IndexRange.first_j; end
     60    last_j=[];
     61    if isfield(Param.IndexRange,'last_j'); last_j=Param.IndexRange.last_j; end
     62    PairString='';
     63    if isfield(Param.IndexRange,'PairString'); PairString=Param.IndexRange.PairString; end
     64    [i1,i2,j1,j2] = get_file_index(Param.IndexRange.first_i,first_j,PairString);
     65    FirstFileName=fullfile_uvmat(Param.InputTable{1,1},Param.InputTable{1,2},Param.InputTable{1,3},...
     66        Param.InputTable{1,5},Param.InputTable{1,4},i1,i2,j1,j2);
     67    if ~exist(FirstFileName,'file')
     68        msgbox_uvmat('WARNING',['the first input file ' FirstFileName ' does not exist'])
    6069    elseif isequal(size(Param.InputTable,1),1) && ~isfield(Param,'ProjObject')
    6170        msgbox_uvmat('WARNING','a projection object  needs to be introduced for time_series')
Note: See TracChangeset for help on using the changeset viewer.