title: plotting an image in Hyperspy using Python to filter the pixel intensity
body: <p>I am using HyperSpy software for image processing using python code below.</p>
  <p>I am trying to plot the grayscale image shown below (SI[3]) but after filtering out unwanted pixels values (background noise).
  so the shells shown in the image have a pixel intensity of 24,400 and above, while the background hvae less than that.</p>
  <p>I want to re-plot the image such that the scalebar is cropped from 0-24,400 (only the bright pixels remain in the image while the rest are set to 0).</p>
  <p>Another thing is I plan count the number of these pixels with value of 24,400 and above.
  how can i count the number of pixels?</p>
  <pre><code>import hyperspy.api as hs
  import numpy as np
  #load the data
  SI = hs.load(&quot;SI HAADF 0945 230 nm.emd&quot;)
  #plot the image
  SI[3].plot()
  </code></pre>
  <p>output:</p>
  <p><a href="https://i.stack.imgur.com/3Z2h4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3Z2h4.png" alt="enter image description here" /></a></p>