roiphot code ran on each region