%%% Credit
% (ISR-2/LANL)%
%% See also% Ressembles:
% ,% ,
% ,% ,
% .% Requires:
% .
%% Function implementationfunction F = tenscaledirfilt(I,T,varargin)
%%
% parsing and checking parameterserror(nargchk(2, 13, nargin, 'struct'));
error(nargoutchk(1, 1, nargout, 'struct'));
if ~isnumeric(I) error('tenscaledirfilt:errorinput','a matrix is required in input');
elseif size(T,4)>2 error('tenscaledirfilt:errorinput','T must be a tensor field or a vector field');
end
p = createParser('TENSCALEDIRFILT'); p.addOptional('S',[], @(x)isnumeric(x) && all(x(:)>0));
p.addParamValue('sig1',8, @(x)isscalar(x) && x>0); p.addParamValue('sig2',3, @(x)isscalar(x) && x>0);
p.addParamValue('nthe', 12, @(x)isscalar(x) && round(x)==x);p.addParamValue('nsig', 5, @(x)isscalar(x) && round(x)==x);
p.addParamValue('nani', 4, @(x)isscalar(x) && round(x)==x);p.addParamValue('aecc', 0.5, @(x)isscalar(x) && round(x)==x);
p.addParamValue('ani', false, @(x)islogical(x));
% parse and validate all input argumentsp.parse(varargin{:});
p = getvarParser(p);
%%% main computation
F = tenscaledirfilt_base(I, T, p.S, p.sig1, p.sig2, ...
p.nsig, p.nthe, p.nani, p.aecc, p.ani);
if p.disp figure, imagesc(rescale(F,0,1)), axis image off;
if size(F,3)==1, colormap gray; end; title('adaptively filtered image');
end
end % end of tenscaledirfilt
##### SOURCE END #####-->