SourceForge logo
SourceForge logo
Menu

matplotlib-users

From: S. N. <sor...@gm...> - 2008年10月30日 01:10:39
Hi,
I'm making a masking function that can mask out certain areas of an image
using different types of masks, and display them using patches. I want to
add a function where a user can move a mask that has already been created.
I can use the picker = True to have it return the patch being clicked on..
but how do I know which mask was clicked on if I have two identical masks?
or even worse, if I have two identical masks almost lying ontop of each
other.. returning both patches at the same time?? I've tried different
things using == to compare.. but that didn't work.. any suggestions??
Soren
From: Pierre GM <pgm...@gm...> - 2008年10月30日 14:01:16
Søren,
Why wouldn't you allocate a 'zorder' to each mask, corresponding to a layer 
nb. That way, if a same pixel is shared by 2 masks or more, you take the one 
with the highest zorder.
That could be done as easily as definind a `maskstack` list, with element `i` 
the mask with zorder `i`.
Now, the global mask is simply
np.logical_or.reduce(maskstack).
That way, you could leave any masked data in the original dataset alone and 
not mix it with your stack of patches.
Let me know how it goes.
On Wednesday 29 October 2008 21:10:34 Søren Nielsen wrote:
> Hi,
>
> I'm making a masking function that can mask out certain areas of an image
> using different types of masks, and display them using patches. I want to
> add a function where a user can move a mask that has already been created.
>
> I can use the picker = True to have it return the patch being clicked on..
> but how do I know which mask was clicked on if I have two identical masks?
> or even worse, if I have two identical masks almost lying ontop of each
> other.. returning both patches at the same time?? I've tried different
> things using == to compare.. but that didn't work.. any suggestions??
>
> Soren
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /