modifications to deriveAllROIs