A method for estimating a thickness of tissue includes receiving multiple measurements, each measurement indicating (i) a respective mechanical pressure applied to the tissue, and (ii) one or more round-trip propagation times of an ultrasound wave traversing the tissue in the presence of the respective mechanical pressure. A set of the measurements is selected, having mechanical pressures that fall in a specified partial subrange of mechanical-pressure values. The thickness of the tissue is estimated based on the round-trip propagation times in the selected set of the measurements.