Updated extract contour script to allow extraction of (N-1)D contours.