Changeset 957


Ignore:
Timestamp:
Jun 22, 2016, 8:27:38 PM (8 years ago)
Author:
sommeria
Message:

ima_filter restored

File:
1 edited

Legend:

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

    r956 r957  
    2929%=======================================================================
    3030
    31 function DataOut=ima_filter(DataIn)
     31function DataOut=ima_filter(DataIn,Param)
    3232
    33 Origin_x=469;
     33%% request input parameters
     34if isfield(DataIn,'Action') && isfield(DataIn.Action,'RUN') && isequal(DataIn.Action.RUN,0)
     35    prompt = {'npx';'npy'};
     36    dlg_title = 'get the filter size in x and y';
     37    num_lines= 2;
     38    def     = { '20';'20'};
     39    if isfield(Param,'TransformInput')&&isfield(Param.TransformInput,'FilterBoxSize_x')&&...
     40            isfield(Param.TransformInput,'FilterBoxSize_y')
     41        def={num2str(Param.TransformInput.FilterBoxSize_x);num2str(Param.TransformInput.FilterBoxSize_y)};
     42    end
     43    answer = inputdlg(prompt,dlg_title,num_lines,def);
     44    DataOut.TransformInput.FilterBoxSize_x=str2num(answer{1}); %size of the filtering window
     45    DataOut.TransformInput.FilterBoxSize_y=str2num(answer{2}); %size of the filtering window
     46    return
     47end
     48
    3449DataOut=DataIn; %default
    35 DataOut.A=
    3650
    3751%definition of the cos shape matrix filter
    38 ix=[1/2-Param.TransformInput.FilterBoxSize_x/2:-1/2+Param.TransformInput.FilterBoxSize_x/2];%
    39 iy=[1/2-Param.TransformInput.FilterBoxSize_y/2:-1/2+Param.TransformInput.FilterBoxSize_y/2];%
     52ix=1/2-Param.TransformInput.FilterBoxSize_x/2:-1/2+Param.TransformInput.FilterBoxSize_x/2;%
     53iy=1/2-Param.TransformInput.FilterBoxSize_y/2:-1/2+Param.TransformInput.FilterBoxSize_y/2;%
    4054%del=np/3;
    4155%fct=exp(-(ix/del).^2);
     
    5165    DataOut.A=uint16(DataOut.A); %transform to 16 bit images
    5266else
    53     DataOut.A=filter2(Mfiltre,DataIn.A)
     67    DataOut.A=filter2(Mfiltre,DataIn.A);
    5468    DataOut.A=feval(Atype,DataOut.A);%transform to the initial image format
    5569end
Note: See TracChangeset for help on using the changeset viewer.