added some segmentation helper scripts for IPW