title: trying to show image of a mammograms with pydicom
body: <p><code>plt.imshow(datasetP2.pixel_array, cmap=plt.cm.bone)</code></p>
  <p>tried this code on a file provided to me and ended up with this error</p>
  <pre><code>---------------------------------------------------------------------------
  AttributeError                            Traceback (most recent call last)
  ~\AppData\Local\Temp/ipykernel_28228/3373097283.py in &lt;module&gt;
  ----&gt; 1 plt.imshow(datasetP2.pixel_array, cmap=plt.cm.bone)
  
  ~\anaconda3\lib\site-packages\pydicom\dataset.py in __getattr__(self, name)
      834             return {}
      835         # Try the base class attribute getter (fix for issue 332)
  --&gt; 836         return object.__getattribute__(self, name)
      837 
      838     @property
  
  ~\anaconda3\lib\site-packages\pydicom\dataset.py in pixel_array(self)
     1880             :class:`numpy.ndarray`.
     1881         &quot;&quot;&quot;
  -&gt; 1882         self.convert_pixel_data()
     1883         return cast(&quot;numpy.ndarray&quot;, self._pixel_array)
     1884 
  
  ~\anaconda3\lib\site-packages\pydicom\dataset.py in convert_pixel_data(self, handler_name)
     1442             self._convert_pixel_data_using_handler(handler_name)
     1443         else:
  -&gt; 1444             self._convert_pixel_data_without_handler()
     1445 
     1446     def _convert_pixel_data_using_handler(self, name: str) -&gt; None:
  
  ~\anaconda3\lib\site-packages\pydicom\dataset.py in _convert_pixel_data_without_handler(self)
     1554             .format(&quot;, &quot;.join([str(hh) for hh in available_handlers]))
     1555         )
  -&gt; 1556         raise last_exception  # type: ignore[misc]
     1557 
     1558     def _do_pixel_data_conversion(self, handler: Any) -&gt; None:
  
  ~\anaconda3\lib\site-packages\pydicom\dataset.py in _convert_pixel_data_without_handler(self)
     1534         for handler in available_handlers:
     1535             try:
  -&gt; 1536                 self._do_pixel_data_conversion(handler)
     1537                 return
     1538             except Exception as exc:
  
  ~\anaconda3\lib\site-packages\pydicom\dataset.py in _do_pixel_data_conversion(self, handler)
     1561         # Use the handler to get a 1D numpy array of the pixel data
     1562         # Will raise an exception if no pixel data element
  -&gt; 1563         arr = handler.get_pixeldata(self)
     1564         self._pixel_array = reshape_pixel_array(self, arr)
     1565 
  
  ~\anaconda3\lib\site-packages\pydicom\pixel_data_handlers\numpy_handler.py in get_pixeldata(ds, read_only)
      281     px_keyword = [kw for kw in keywords if kw in ds]
      282     if len(px_keyword) != 1:
  --&gt; 283         raise AttributeError(
      284             &quot;Unable to convert the pixel data: one of Pixel Data, Float &quot;
      285             &quot;Pixel Data or Double Float Pixel Data must be present in &quot;
  
  AttributeError: Unable to convert the pixel data: one of Pixel Data, Float Pixel Data or Double Float Pixel Data must be present in the dataset```
  </code></pre>