Ignore:
Timestamp:
May 23, 2013, 12:33:04 AM (11 years ago)
Author:
sommeria
Message:

civ_input improved and small bug corrections

File:
1 edited

Legend:

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

    r640 r642  
    161161NomTypeOut=NomType;% output file index will indicate the first and last ref index in the series
    162162
     163%% mask (TODO: case of multilevels)
     164if Param.CheckMask
     165    MaskData=cell(NbView,1);
     166    MaskSubDir=regexprep(Param.InputTable{iview,2},'\..*','');%take the root part of SubDir, before the first dot '.'
     167    MaskName=fullfile(Param.InputTable{iview,1},[MaskSubDir '.mask'],'mask_1.png');
     168    if exist(MaskName,'file')
     169        [MaskData{iview},tild,errormsg] = read_field(MaskName,'image');
     170        if ~isempty(transform_fct) && nargin(transform_fct)>=2
     171            MaskData{iview}=transform_fct(MaskData,XmlData{iview});
     172        end
     173    end
     174end
     175
    163176%% Set field names and velocity types
    164177%use Param.InputFields for all views
     
    174187for index=1:NbField
    175188        update_waitbar(WaitbarHandle,index/NbField)
    176     if ~isempty(RUNHandle) &&ishandle(RUNHandle) && ~strcmp(get(RUNHandle,'BusyAction'),'queue')
     189    if ~isempty(RUNHandle) && ~strcmp(get(RUNHandle,'BusyAction'),'queue')
    177190        disp('program stopped by user')
    178191        return
     
    196209            Data{iview}.ZIndex=mod(i1_series{iview}(index)-1,NbSlice_calib{iview})+1;%Zindex for phys transform
    197210        end
    198 
     211       
    199212        %% transform the input field (e.g; phys) if requested (no transform involving two input fields)
    200213        if ~isempty(transform_fct)
     
    206219        end
    207220       
    208          %% calculate tps coefficients if needed
     221        %% calculate tps coefficients if needed
    209222        check_proj_tps= isfield(Param,'ProjObject')&&~isempty(Param.ProjObject)&& strcmp(Param.ProjObject.ProjMode,'interp_tps')&&~isfield(Data{iview},'Coord_tps');
    210223        Data{iview}=tps_coeff_field(Data{iview},check_proj_tps);
    211 
     224       
    212225        %% projection on object (gridded plane)
    213226        if Param.CheckObject
     
    220233       
    221234        %% mask
    222         if isfield(Param,'Mask')
    223             %TODO: introduce a table of masks for multiple views
    224             [MaskData{iview},tild,errormsg] = read_field(Param.Mask,'image');
    225             if ~isempty(transform_fct) && nargin(transform_fct)>=2
    226                     MaskData{iview}=transform_fct(MaskData,XmlData{iview});
    227             end
    228             [Data{iview},errormsg]=mask_proj(Data{iview},MaskData{iview});
     235        if Param.CheckMask && ~isempty(MaskData{iview})
     236             [Data{iview},errormsg]=mask_proj(Data{iview},MaskData{iview});
    229237        end
    230238    end
Note: See TracChangeset for help on using the changeset viewer.