[SciPy-User] ROI, the sequel

Thøger Emil Juul Thorsen thoeger@fys.ku...
Tue Aug 3 19:05:13 CDT 2010


Hello list; 

I need a tool for polygon clipping of 2d NumPy arrays, but I cannot seem
to find anything. Shapely will only export the vertices of the polygon.
NXutils and patches in matplotlib seem to be purely visual, in any case
I cannot see how they would be saved as arrays in data coordinates. 

There is a very neat IDL routine, POYFILLV which returns a 1d array of
the (1d) indices of the pixels that are inside the polygon, sort of like
a "where" function. Is there anything like it out there for numpy
arrays?

Best; 

Emil



More information about the SciPy-User mailing list