Apr-04-2019, 12:24 PM
Hi,
I have below the circle, and I want to pick three regions of interest.
I created a filled circle with center at (0,0), a radius is 20. Now I want to select four ROI (region of interest) and mask the region outside the ROI with black color
ROI 1: A semicircle with center at (0,0), and with radius 5 (to the right side, meaning opened to right side)
ROI 2: A semicircle with center at (0,0), and with radius 5 (to the left side, meaning open to the left side)
ROI 3: A semicircle with center at (0,0), and with radius 5 (to bottom, meaning open to bottom)
ROI 4: A semicircle with center at (1,1), and with radius 3 (opened upside)
I could not be able to attach the figures.
I have below the circle, and I want to pick three regions of interest.
I created a filled circle with center at (0,0), a radius is 20. Now I want to select four ROI (region of interest) and mask the region outside the ROI with black color
ROI 1: A semicircle with center at (0,0), and with radius 5 (to the right side, meaning opened to right side)
ROI 2: A semicircle with center at (0,0), and with radius 5 (to the left side, meaning open to the left side)
ROI 3: A semicircle with center at (0,0), and with radius 5 (to bottom, meaning open to bottom)
ROI 4: A semicircle with center at (1,1), and with radius 3 (opened upside)
I could not be able to attach the figures.
import matplotlib.pyplot as plt def create_circle(): circle= plt.Circle((0,0), radius= 20) return circle def show_shape(patch): ax=plt.gca() ax.add_patch(patch) plt.axis('scaled') plt.show() if __name__== '__main__': c= create_circle() show_shape(c)