If I have a selection, for simplicity sake we'll start with a 50 pixel wide line at a 45 degree angle from top left to bottom right (see below), how do I create a path that traverses the approximate center of the selection and is one pixel wide?

Click image for larger version. 

Name:	45_degree_line.JPG 
Views:	25 
Size:	29.0 KB 
ID:	126198

I know how to create a selection, shrink a selection, create a path from a selection. But simply shrinking will either end you up with gaps in the path or with areas that are wider than a pixel in the path. I am fine if this is something I need to do programatically if someone can point me in the right direction or the terminology to look for to execute this type of operation. I am no great mathematician, but I can muddle through most geometry and basic trig. And I am fine with putting in time to experiment as necessary.

- Ernie