title: Saving a DICOM image in PNG format
body: <p>I have a <code>dicom</code> image which I read in <code>matlab</code> as:</p>
  
  <pre><code>I=dicomread('xyz.dcm');
  </code></pre>
  
  <p>In displaying it, I used the following command:</p>
  
  <pre><code>imshow(I,[])
  </code></pre>
  
  <p>What I want to ask about is, how can I write it through <code>imwrite</code>, such that I get the image as seen using the above <code>imshow</code> command?</p>
  
  <p>I for instance tried this:</p>
  
  <pre><code>imwrite(I,'xyz.png','png');
  </code></pre>
  
  <p>but, get a <strong>dark</strong> image.</p>
  
  <p>Any ideas on that?</p>
  
  <p>Thanks.</p>