Shape sensing with inverse Finite Element Method for slender structures