Methods, apparatus and computer program products implement embodiments of the present invention that include receiving three-dimensional (3D) image data with respect to a 3D region including body tissue in a living body, and segmenting the 3D image data so as to identify a cavity within the body tissue and a wall surrounding the cavity. For each point among a plurality of points in the cavity, a respective minimum distance from the point to the wall is found, and among the plurality of the points, a set of one or more points for which the respective minimum distance is a local maximum relative to neighboring points in the plurality is found. One of the points in the set for which the respective minimum distance is minimal among the one or more points in the set is then identified as an entrance to the cavity.