Learning based Curvilinear Structure Analysis in Medical Images