Basic segmentation and area measurement macro