Ignore:
Timestamp:
Aug 16, 2022, 2:02:02 PM (2 years ago)
Author:
sommeria
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/transform_field/ima_filter.m

    r1107 r1119  
    2929%=======================================================================
    3030
    31 function DataOut=ima_filter(DataIn,Param)
     31function DataOut=ima_filter(DataIn,Param,DataIn_1)
    3232
    3333%% request input parameters
     
    7676    end
    7777end
     78if exist('DataIn_1','var')
     79    [CellInfo,NbDim,errormsg]=find_field_cells(DataIn_1);
     80for icell=1:numel(CellInfo)
     81    if isfield(CellInfo{icell},'CoordType')&& strcmp(CellInfo{icell}.CoordType,'grid')
     82        for ivar=1:numel(CellInfo{icell}.VarIndex)
     83            VarName=DataIn_1.ListVarName{CellInfo{icell}.VarIndex(ivar)};
     84            Atype=class(DataIn_1.(VarName));% detect integer 8 or 16 bits
     85            if numel(size(DataIn_1.(VarName)))==3
     86                DataOut.(VarName)=filter2(Mfiltre,sum(DataIn_1.(VarName),3));%filter the input image, after summation on the color component (for color images)
     87                DataOut.(VarName)=uint16(DataOut.(VarName)); %transform to 16 bit images
     88            else
     89                DataOut.(VarName)=filter2(Mfiltre,DataIn_1.(VarName));
     90                DataOut.(VarName)=feval(Atype,DataOut.(VarName));%transform to the initial image format
     91            end
     92        end
     93    end
     94end
     95end
     96
    7897 
Note: See TracChangeset for help on using the changeset viewer.