title: Extracting the elements matching the filter
body: <p>I want to filter the indices whose footprint (3,3) consists of 1s.</p>
  
  <pre><code>import numpy as np
  data = np.array([[1, 1 , 0 , 0 , 0 , 0 , 1 , 0],
                   [1, 1 , 1 , 0 , 0 , 1 , 1 , 0],
                   [1, 1 , 1 , 1 , 1 , 0 , 0 , 0],
                   [0, 0 , 1 , 1 , 1 , 0 , 0 , 0],
                   [0, 0 , 1 , 1 , 1 , 1 , 0 , 1],
                   [1, 1 , 0 , 0 , 0 , 1 , 1 , 1],
                   [1, 1 , 0 , 0 , 0 , 1 , 1 , 1]])
  </code></pre>
  
  <p>The expected answer is below, unwanted positions are set to 0s:</p>
  
  <pre><code>answer = np.array([[0, 0 , 0 , 0 , 0 , 0 , 0 , 0],
                   [0, 0 , 0 , 0 , 0 , 0 , 0 , 0],
                   [0, 0 , 1 , 1 , 1 , 0 , 0 , 0],
                   [0, 0 , 1 , 1 , 1 , 0 , 0 , 0],
                   [0, 0 , 1 , 1 , 1 , 0 , 0 , 0],
                   [0, 0 , 0 , 0 , 0 , 0 , 0 , 0],
                   [0, 0 , 0 , 0 , 0 , 0 , 0 , 0]])
  </code></pre>