scikit-image/scikit-image — pull request #882 by JDWarner (2014-02-09 19:35:57+00:00)
Title: Correct mesh orientation

This is a feature requested [on the mailing list recently](https://groups.google.com/forum/#!topic/scikit-image/y-bZ2R0NuJE), which corrects the orientation of faces returned from `skimage.measure.marching_cubes` such that they are all oriented in a coherent manner.

The function finds normalized gradient vectors at the centroid of every triangular face returned from `marching_cubes`, then compares them to normalized vectors defining each triangular face (found via cross product) using a dot product. The comparison does require some additional user input via the `gradient_direction` kwarg.

Right now it's a separate utility function exposed in `skimage.measure`. I'd appreciate opinions on if this warrants folding into the `marching_cubes` algorithm itself - either as the default or an option - as well as feedback on if it is working correctly, as I don't have an easy workflow to view single-sided meshes.