Apparatus and methods are described for use with an imaging device that acquires an external image of a multi-lumen structure within a subjects body. A tool with a location sensor coupled thereto is moved along branches of the structure. The multi-lumen structure is registered with the external image, such that the multi-lumen structure and the external image of the multi-lumen structure have a common frame of coordinates, by sensing the location coordinates of the tool while the tool moves along a plurality of branch lines within the multi-lumen structure, the branch lines defining a plurality of paths within the multi-lumen structure. The branch lines are identified within the image, and a correspondence between the sensed location coordinates of the tool and the plurality of branch lines within the image is determined. Other applications are also described.