Created masks instead of extracting rois.
code clean up.