For this purpose, we use "Analysis K-SVD" to train the dictionary and find the sparse coefficients. 
Analysis K-SVD
We utilize image patches to construct the analysis dictionary and then we employ the proposed sparse similarity measure to find a non-rigid transformation using free form deformation (FFD). 
FFD