Ignore:
Timestamp:
May 28, 2020, 5:30:08 PM (3 years ago)
Author:
sommeria
Message:

phys_polar corrected

File:
1 edited

Legend:

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

    r1071 r1081  
    6060Mfiltre=Mfiltre/(sum(sum(Mfiltre)));%normalize filter
    6161
    62 Atype=class(DataIn.A);% detect integer 8 or 16 bits
    63 if numel(size(DataIn.A))==3
    64     DataOut.A=filter2(Mfiltre,sum(DataIn.A,3));%filter the input image, after summation on the color component (for color images)
    65     DataOut.A=uint16(DataOut.A); %transform to 16 bit images
    66 else
    67     DataOut.A=filter2(Mfiltre,DataIn.A);
    68     DataOut.A=feval(Atype,DataOut.A);%transform to the initial image format
     62[CellInfo,NbDim,errormsg]=find_field_cells(DataIn)
     63for icell=1:numel(CellInfo)
     64    if isfield(CellInfo{icell},'CoordType')&& strcmp(CellInfo{icell}.CoordType,'grid')
     65        for ivar=1:numel(CellInfo{icell}.VarIndex)
     66            VarName=DataIn.ListVarName{CellInfo{icell}.VarIndex(ivar)};
     67            Atype=class(DataIn.(VarName));% detect integer 8 or 16 bits
     68            if numel(size(DataIn.(VarName)))==3
     69                DataOut.(VarName)=filter2(Mfiltre,sum(DataIn.(VarName),3));%filter the input image, after summation on the color component (for color images)
     70                DataOut.(VarName)=uint16(DataOut.(VarName)); %transform to 16 bit images
     71            else
     72                DataOut.(VarName)=filter2(Mfiltre,DataIn.(VarName));
     73                DataOut.(VarName)=feval(Atype,DataOut.(VarName));%transform to the initial image format
     74            end
     75        end
     76    end
    6977end
    7078 
Note: See TracChangeset for help on using the changeset viewer.