The invention uses light to determine the distance from the tip of a probe
to the internal wall of the canal, and based on the position of the
probe, this information is used to generate information about the shape
of the canal. Light with a first and a second wavelength range is
directed onto a semi-transparent mirror surface at the distal portion of
the probe. Light in the first wavelength range is reflected from the
mirror surface to illuminate a circumferential area of the internal
surface of the canal, and light in the second wavelength range is
transmitted through the mirror surface to illuminate an area in front of
the distal portion of the probe. The received light is analyzed in the
first wavelength range to determine the distance from the probe to the
internal surface of the canal at points of the circumference, and
analyzed in the second wavelength range to determine the distance from
the probe to an object in front of the probe. Thereby it is ensured, that
the bottom surface of the canal is not touched or injured while the
internal surface of the canal is measured.