Structural analysis for pre-surgery planning: two applications in dentistry and urology