1. A flexible needle comprising: a shape sensor and a connector adapted for connecting the shape sensor to a processor for determining the shape of the flexible needle based on data from the shape sensor.