Add a separate function OrientFit( ) to estimate the local orientation on curve. Curvature.m and extractBranches.m are modified correspondingly.