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/time_series.m

    r38 r41  
    3434%projection object
    3535test_object=get(hseries.GetObject,'Value');
    36 if test_object%isfield(Series,'sethandles')
    37     Series.ProjObject=read_set_object(Series.sethandles);
     36if test_object
     37    hset_object=findobj(allchild(0),'Name','set_object');
     38    ProjObject=read_set_object(guidata(hset_object));
    3839    %answeryes=questdlg({['field series projected on ' Series.ProjObject.Style]});
    39     answeryes=msgbox_uvmat('INPUT_Y-N',['field series projected on ' Series.ProjObject.Style]);
     40    answeryes=msgbox_uvmat('INPUT_Y-N',['field series projected on ' ProjObject.Style]);
    4041    if ~isequal(answeryes,'Yes')
    4142        return
     
    170171
    171172% Root name of output files (TO GENERALISE FOR TWO INPUT SERIES)
    172 filebasesub=fullfile(RootPath{1},RootFile{1});
    173 if NbSlice==1
    174     filebase_out=[filebasesub '_time'];
    175 else
    176     filebase_out=[filebasesub '_' NbSlice_name 'mtim'];
    177     increment=num_i1{1}(2)-num_i1{1}(1);
    178     if ~isequal(increment,1) % if an increment is set
    179         answeryes=msgbox_uvmat('INPUT_Y-N',['will take time series in ' num2str(NbSlice) 'slices with increment = ' num2str(increment) '!']);
    180     else   
    181         answeryes=msgbox_uvmat('INPUT_Y-N',{['will take time series in ' num2str(NbSlice) ' slices'];['results stored as files ' filebase_out ' ...']});
    182     end
    183     if ~isequal(answeryes,'Yes')
    184         return
    185     end
    186 end
     173% filebasesub=fullfile(RootPath{1},RootFile{1});
     174% if NbSlice==1
     175%     filebase_out=[filebasesub '_time'];
     176% else
     177%     filebase_out=[filebasesub '_' NbSlice_name 'mtim'];
     178%     increment=num_i1{1}(2)-num_i1{1}(1);
     179%     if ~isequal(increment,1) % if an increment is set
     180%         answeryes=msgbox_uvmat('INPUT_Y-N',['will take time series in ' num2str(NbSlice) 'slices with increment = ' num2str(increment) '!']);
     181%     else   
     182%         answeryes=msgbox_uvmat('INPUT_Y-N',{['will take time series in ' num2str(NbSlice) ' slices'];['results stored as files ' filebase_out ' ...']});
     183%     end
     184%     if ~isequal(answeryes,'Yes')
     185%         return
     186%     end
     187% end
    187188VelType_str=get(hseries.VelTypeMenu,'String');
    188189VelType_val=get(hseries.VelTypeMenu,'Value');
     
    269270end
    270271
    271 % image or scalar processing programme set by user
    272 Coord_menu=get(hseries.CoordType,'String');
    273 menu_val=get(hseries.CoordType,'Value');
    274 usrfct=Coord_menu{menu_val};
    275 testfct=~isequal(usrfct,'');
     272% Root name of output files (TO GENERALISE FOR TWO INPUT SERIES)
     273subdir_result='time_series';
     274% filebasesub=fullfile(RootPath{1},subdir_result,RootFile{1});
     275% if isempty(SubDir{1}) % create a subdirectory '/aver_stat'
     276%     subdir_result='aver_stat';
     277%     filebasemean=fullfile(RootPath{1},subdir_result);
     278if ~exist(fullfile(RootPath{1},subdir_result),'dir')
     279    dircur=pwd; %record current working directory
     280    cd(RootPath{1})% goes to the iamge directory
     281    [m1,m2,m3]=mkdir(subdir_result);
     282    if ~isequal(m2,'')
     283         msgbox_uvmat('CONFIRMATION',m2);%error message for directory creation
     284    end
     285    cd(dircur) %back to the initial working directory
     286end
     287filebase_out=filebase{1};
     288NomTypeOut=nomtype2pair(NomType{1},num_i2{end}(end)-num_i1{1}(1),num_j2{end}(end)-num_j1{1}(1));
     289
     290% coordinate transform or other user defined transform
     291transform_fct=[];%default
     292if isfield(Series,'transform_fct')
     293    transform_fct=Series.transform_fct;
     294end
    276295
    277296% to update:
     
    331350                end
    332351             end
    333             % geometry transform or other user defined transform
    334             if ~isequal(Series.CoordType,'')           
     352             
     353             % coordinate transform (or other user defined transform)
     354            if ~isempty(transform_fct)
     355                 % z index
     356                if ~isempty(NbSlice_calib)
     357                    Data{iview}.ZIndex=mod(num_i1{iview}(ifile)-1,NbSlice_calib{1})+1;%Zindex for phys transform
     358                end
    335359                if nbview==2
    336                     [Data{1},Data{2}]=feval(Series.CoordType,Data{1},XmlData{1},Data{2},XmlData{2});
     360                    [Data{1},Data{2}]=transform_fct(Data{1},XmlData{1},Data{2},XmlData{2});
    337361                    if isempty(Data{2})
    338362                        Data(2)=[];
    339363                    end
    340364                else
    341                     Data{1}=feval(Series.CoordType,Data{1},XmlData{1});
    342                 end
    343             end
     365                    Data{1}=transform_fct(Data{1},XmlData);
     366                end
     367            end     
    344368            if testcivx
    345369                    Data{iview}=calc_field(FieldName,Data{iview});%calculate field (vort..)
     
    354378                Field=Data{1};
    355379            end
    356             if isfield(Series,'ProjObject')
    357                 Series.ProjObject
    358                 [Field,errormsg]=proj_field(Field,Series.ProjObject);
     380            if test_object
     381                [Field,errormsg]=proj_field(Field,ProjObject);
    359382                if ~isempty(errormsg)
    360383                    msgbox_uvmat('ERROR',['error in time_series/proj_field:' errormsg])
     
    393416                                end
    394417                                % check whether the variable ivar is a dimension variable
    395                                 %index=Field.VarDimIndex{ivar};%dimension indices of the variable #ivar
    396418                                DimCell=Field.VarDimName{ivar};
    397419                                if ischar(DimCell)
     
    416438                    if testsum(ivar)==2% test for recorded variable
    417439                        eval(['VarVal=Field.' VarName ';']);
    418                         if isequal(Series.ProjObject.ProjMode,'inside')% take the average in the domain for 'inside' mode
     440                        if isequal(ProjObject.ProjMode,'inside')% take the average in the domain for 'inside' mode
    419441                            if isempty(VarVal)
    420442                                msgbox_uvmat('ERROR',['empty result at frame index ' num2str(num_i1{iview}(ifile))])
Note: See TracChangeset for help on using the changeset viewer.