Changeset 957
- Timestamp:
- Jun 22, 2016, 8:27:38 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/transform_field/ima_filter.m
r956 r957 29 29 %======================================================================= 30 30 31 function DataOut=ima_filter(DataIn )31 function DataOut=ima_filter(DataIn,Param) 32 32 33 Origin_x=469; 33 %% request input parameters 34 if 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 47 end 48 34 49 DataOut=DataIn; %default 35 DataOut.A=36 50 37 51 %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];%52 ix=1/2-Param.TransformInput.FilterBoxSize_x/2:-1/2+Param.TransformInput.FilterBoxSize_x/2;% 53 iy=1/2-Param.TransformInput.FilterBoxSize_y/2:-1/2+Param.TransformInput.FilterBoxSize_y/2;% 40 54 %del=np/3; 41 55 %fct=exp(-(ix/del).^2); … … 51 65 DataOut.A=uint16(DataOut.A); %transform to 16 bit images 52 66 else 53 DataOut.A=filter2(Mfiltre,DataIn.A) 67 DataOut.A=filter2(Mfiltre,DataIn.A); 54 68 DataOut.A=feval(Atype,DataOut.A);%transform to the initial image format 55 69 end
Note: See TracChangeset
for help on using the changeset viewer.