Changeset 1147 for trunk/src/series


Ignore:
Timestamp:
May 29, 2024, 7:08:52 PM (7 months ago)
Author:
sommeria
Message:

merge_proj repaired with multimask possibility

Location:
trunk/src/series
Files:
3 edited

Legend:

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

    r1143 r1147  
    268268    end
    269269else  %case of netcdf file opening, start with the stage read in the file if the input file is being refreshed
    270     if isequal(get(hhseries.REFRESH,'BackgroundColor'),[1 1 0]) &&...
    271             ~(isfield(Param,'ActionInput') && isfield(Param.ActionInput,'ConfigSource'))
     270%     if isequal(get(hhseries.REFRESH,'BackgroundColor'),[1 1 0]) &&...
     271%             ~(isfield(Param,'ActionInput') && isfield(Param.ActionInput,'ConfigSource'))
    272272            for index = 1:min(ind_opening,5)
    273273                set(handles.(ListOptions{index}),'value',0)
    274274                fill_civ_input(Data,handles); %fill civ_input with the parameters retrieved from an input Civ file
    275275            end
     276            if isempty(FileInfo)
     277            FileInfo.FileName='';
     278end
    276279            set(handles.ConfigSource,'String',FileInfo.FileName);
    277280            set(handles.(ListOptions{min(ind_opening+1,6)}),'value',1)
     
    280283            end
    281284            checkrefresh=1;
    282     end
     285%     end
    283286    if ind_opening>=3
    284287        set(handles.CheckCiv3,'Visible','on')% make visible the switch 'iterate/repet' for Civ2.
  • trunk/src/series/civ_series.m

    r1146 r1147  
    5353    path_series=fileparts(which('series'));
    5454    addpath(fullfile(path_series,'series'))
     55
     56
    5557    Data=civ_input(Param);% introduce the civ parameters using the GUI civ_input
    5658    %Data=civ_input_App(Param);% introduce the civ parameters using the GUI civ_input
  • trunk/src/series/merge_proj.m

    r1137 r1147  
    232232end
    233233
    234 %% mask (TODO: case of multilevels)
    235 MaskData=cell(NbView,1);
    236 if Param.CheckMask
    237     if ischar(Param.MaskTable)% case of a single mask (char chain)
    238         Param.MaskTable={Param.MaskTable};
    239     end
    240     for iview=1:numel(Param.MaskTable)
    241         if exist(Param.MaskTable{iview},'file')
    242             [MaskData{iview},tild,errormsg] = read_field(Param.MaskTable{iview},'image');
    243             if ~isempty(transform_fct) && nargin(transform_fct)>=2
    244                 MaskData{iview}=transform_fct(MaskData{iview},XmlData{iview});
    245             end
    246         end
    247     end
    248 end
    249234
    250235%% Set field names and velocity types
     
    319304        %% transform the input field iview (e.g; phys) if requested (no transform involving two input fields at this stage)
    320305        if ~isempty(transform_fct)&& checksub==0
    321             checksub=nargin(transform_fct);
    322306            if nargin(transform_fct)>=2
    323307                Data{iview}=transform_fct(Data{iview},XmlData{iview});
     
    345329       
    346330        %% mask
    347         if Param.CheckMask && ~isempty(MaskData{iview})
    348              [Data{iview},errormsg]=mask_proj(Data{iview},MaskData{iview});
     331        if Param.CheckMask % introduce multilevel mask like for civ
     332            NbSlice=Param.MaskTable{iview,2};
     333            [RootPath_mask,SubDir_mask,RootFile_mask,i1_mask,i2_mask,j1_mask,j2_mask,Ext_mask]=fileparts_uvmat(Param.MaskTable{iview,1});
     334            i1_mask=mod(i1-1,NbSlice)+1;
     335            maskname=fullfile_uvmat(RootPath_mask,SubDir_mask,RootFile_mask,Ext_mask,'_1',i1_mask);
     336            if ~exist(maskname,'file')
     337                maskname=Param.MaskTable{iview,1};
     338            end
     339            [MaskData,~,errormsg] = read_field(maskname,'image');
     340            if ~isempty(transform_fct) && nargin(transform_fct)>=2
     341                MaskData=transform_fct(MaskData,XmlData{iview});
     342            end
     343            if  ~isempty(MaskData)
     344                [Data{iview},errormsg]=mask_proj(Data{iview},MaskData);
     345            end
    349346        end
    350347    end
Note: See TracChangeset for help on using the changeset viewer.