Image guided surgery has established as a valuable routine methodology in modern operation theatres, especially when targeting obscured morphology or for exact positioning of tools. In cerebral surgery image guidance has a long tradition, even in orthopedics; recently it also extends to abdominal surgery. The software packages are highly task specific and complex, thus the systems are hardly extendible. But in a research environment, an open software architecture is highly desirable. In this work a surgical navigation framework is presented based on a hardware abstraction layer, with a DeviceServer as a central service. It allows seamless communication with any type of tracking, video, and haptic devices via network and makes the actual application platform and language independent. The top software layer is a generic surgical navigation framework based on the Matlab® scripting language. The great functionality and easy handling of Matlab® facilitates rapid prototyping of new components in image guided surgery. The development needs no highly specialized software experts and is suitable for the interdisciplinary staff of a research lab. As a showcase for the newly developed system, a registration algorithm to match the coordinate systems of an optical tracking system and patient image data is implemented. It is a surface-to-points algorithm, characterized by robustness, stability and usability. Iterative registration is implemented as a steepest gradient procedure and distances are measured with a three dimensional chamfer map. The registration yields accurate overlay of the coordinates, allowing exact positioning of surgical tools. Because of the easy handling and extensibility, the developed rapid prototyping environment has high potential in clinical research facilities.