Yeah, well. You can combine the masking with unfold to get a series of patches.
For “extracting the right thing if you don’t know what it is” (which is how the first paragraph sounds to me) you likely need someone more competent to answer.
Best regards
Thomas