For example in the image shown below, the left side is the (bit masked) image, and I want to create a closed ROI with their vertex connecting the contour of the virtual aperture, shown on the right side (which is drawn by hand, not precise to the shape). Of course the ROI can be on the existing image or on a new image.
This is related in an application to virtual aperture to 4D-STEM datasets using scripts, I need to convert a bit masked image (like a virtual aperture, having only zeros and ones) to an ROI, and then apply the SI-Map function so to speed up the calculation and automation (the other question I raised here some time ago, and a partial answer here).
I'm wondering how to do this with a script? Any hints are appreciated!