Initial import of segmentation.py.