Made changes to roiFromPatch so that the config struct can be passed directly or loaded from file.