% function [newImg,pre,imgSize,grid_size,v] = MLS(oldImg, type, alpha, p, q, v, imgSize, grid_size, pre)
%UNTITLED2 Summary of this function goes hereall(size(a) == [5,2])
%   oldImg = img to deform
%   type = 'Affine', 'Similarity', 'Rigid'
%   alpha = MLS parameter - pass 1 
%   p = control point position
%   q = control point deformed position
%   PRECOMPUTED loopback
%   v = evaluation points (grid) - pass [stepX,stepY] if you want to
%       precompute or pass output of MLS_getPoints
%   imgSize = will get overwritten if you pass v as [stepX,stepY] or pass output of MLS_getPoints
%   grid_size
%   pre - output of MLS_precompute


            alpha = 1;
            %m2dlp.MLS.pre = MLS_precompute(p,m2dlp.MLS.v,alpha,m2dlp.MLS.size_of_img,m2dlp.MLS.type);


            [m2dlp.MLS.f,m2dlp.MLS.pre] = MLS_getDeform(p,q,m2dlp.MLS.v,1,m2dlp.MLS.type,m2dlp.MLS.pre,m2dlp.MLS.size_of_img);

             [m2dlp.MLS.imgDeformed,m2dlp.MLS.Interpf] = MLS_applyDeform(m2dlp.MLS.img,m2dlp.MLS.f,m2dlp.MLS.v,m2dlp.MLS.grid_size);
                
