Ignore:
Timestamp:
Mar 10, 2010, 11:03:36 AM (11 years ago)
Author:
sommeria
Message:

-relabel_i_j: improve the question dlg box for image transform
-aver_stat,time_series,merge_proj: include modification of field transform and call of set_object.
-series: introduce a browser for set_object
-ima2vol: create volume images (png images of a slice concacened along y) for PIV 3D
-set_object: suppress TITLE, introduce Tooltip helps for parameters
-civ: fixed bug on BATCH sequences

File:
1 edited

Legend:

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

    r38 r41  
    3232WaitbarPos=get(hseries.waitbar_frame,'Position');
    3333%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     34
     35%projection object
     36test_object=get(hseries.GetObject,'Value');
     37if test_object%isfield(Series,'sethandles')
     38    hset_object=findobj(allchild(0),'Name','set_object');
     39    ProjObject=read_set_object(guidata(hset_object));
     40    %answeryes=questdlg({['field series projected on ' Series.ProjObject.Style]});
     41    answeryes=msgbox_uvmat('INPUT_Y-N',['field series projected on ' ProjObject.Style ' before averaging']);
     42    if ~isequal(answeryes,'Yes')
     43        return
     44    end
     45end
     46
    3447%root input file and type
    3548if ~iscell(Series.RootPath)% case of a single input field series
     
    145158end
    146159if ~isequal(FieldName,{'get_field...'})
     160    if isequal(FieldName,{''}) && ~testima
     161        msgbox_uvmat('ERROR','an input field needs to be selected')
     162        return
     163    end
    147164    testcivx=testnc;
    148165end
     
    235252% Root name of output files (TO GENERALISE FOR TWO INPUT SERIES)
    236253subdir_result='aver_stat';
    237 % filebasesub=fullfile(RootPath{1},subdir_result,RootFile{1});
    238 % if isempty(SubDir{1}) % create a subdirectory '/aver_stat'
    239 %     subdir_result='aver_stat';
    240 %     filebasemean=fullfile(RootPath{1},subdir_result);
    241254if ~exist(fullfile(RootPath{1},subdir_result),'dir')
    242255    dircur=pwd; %record current working directory
     
    249262end
    250263filebase_out=filebase{1};
    251 % else
    252 %    subdir_result=SubDir{1};
    253 %    filebase_out=[filebase{1} '_mean'];% output root name obtained by adding the suffix _mean to the input
    254 % end
    255 %output nomtype (to generalise)
    256264NomTypeOut=nomtype2pair(NomType{1},num_i2{end}(end)-num_i1{1}(1),num_j2{end}(end)-num_j1{1}(1));
    257    
    258 % if NbSlice==1 
    259 %     filebase_out=[filebasesub '_mean'];
    260 % else
    261 %     filebase_out=[filebasesub '_' NbSlice_name 'mean'];
    262 %     answeryes=questdlg({['will make average in ' num2str(NbSlice) ' slices'];['results stored as files ' filebase_out ' ...']});
    263 %     if ~isequal(answeryes,'Yes')
    264 %         return
    265 %     end
    266 % end
    267265
    268266% coordinate transform or other user defined transform
    269 Coord_menu=get(hseries.CoordType,'String');
    270 menu_val=get(hseries.CoordType,'Value');
    271 usrfct=Coord_menu{menu_val};
    272 testfct=~isequal(usrfct,'');
     267transform_fct=[];%default
     268if isfield(Series,'transform_fct')
     269    transform_fct=Series.transform_fct;
     270end
    273271
    274272%slice loop
     
    312310             end   
    313311             % coordinate transform (or other user defined transform)
    314              if ~isequal(Series.CoordType,'')
     312             if ~isempty(transform_fct)
    315313                 % z index
    316314                if ~isempty(NbSlice_calib)
     
    318316                end
    319317                if nbview==2
    320                     [Data{1},Data{2}]=feval(Series.CoordType,Data{1},XmlData{1},Data{2},XmlData{2});
     318                    [Data{1},Data{2}]=transform_fct(Data{1},XmlData{1},Data{2},XmlData{2});
    321319                    if isempty(Data{2})
    322320                        Data(2)=[];
    323321                    end
    324322                else
    325                     Data{1}=feval(Series.CoordType,Data{1},XmlData);
     323                    Data{1}=transform_fct(Data{1},XmlData);
    326324                end
    327325             end     
     
    338336                Field=Data{1};
    339337            end
    340             if isfield(Series,'ProjObject')
    341                 [Field,errormsg]=proj_field(Field,Series.ProjObject);
     338            if test_object
     339                [Field,errormsg]=proj_field(Field,ProjObject);
    342340                 if ~isempty(errormsg)
    343341                    msgbox_uvmat('ERROR',['error in aver_stat/proj_field:' errormsg])
Note: See TracChangeset for help on using the changeset viewer.