adding ArraySegment class to morphology.py