An elasticity measuring system determines tissue displacement between a pre-deformation and post-deformation image by a matching process using a cost function accepting as its arguments continuity of the tissue motion and correlation of the tissue in making the block matching. The invention allows the selection among different cost functions for different imaging situations or tissue types, to provide improved displacement calculations using a priori knowledge about the tissue and structure of tissue interfaces or information derived during the scanning process.