An autofocus method for a TEM