A method for three-dimensional (3D) mapping includes acquiring a plurality of two-dimensional (2D) ultrasonic images of a cavity in a body of a living subject, the 2D images having different, respective positions in a 3D reference frame. In each of the 2D ultrasonic images, pixels corresponding to locations within an interior of the cavity are identified. The identified pixels from the plurality of the 2D images are registered in the 3D reference frame so as to define a volume corresponding to the interior of the cavity. An outer surface of the volume is reconstructed, representing an interior surface of the cavity.