Voxels to Line

I have a set of voxels that I have identified as an edge and I can convert it into a line, but when the edge is a couple voxels thick my algorithm produces junk.
Here’s a 2D example:
(this I have no problem)
(this I have a problem)

I need to strip away the voxels and make it one voxel thick. How can I do this?


This sounds like a typical line fitting problem. Try a search on line fitting to see how this is done. This problem is quite common in fitting lines (or other curves in its generla case) over scientific data. It should apply to what you’re doing, unless you’ve got some sort of special situation there.