Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If I am not entirely mistaken, part of the code above is taken from the <a href="http://evildicom.rexcardan.com/" rel="nofollow noreferrer">Evil DICOM</a> library, from the <code>ImageHelper.GetBitmap</code> method.</p> <p>I have myself made an attempt to port this code to <em>Metro</em> (or whatever Microsoft is going to call it eventually), and here is what the Metro analogue of <code>ImageHelper.GetBitmap</code> looks like in my port:</p> <pre><code>public static BitmapSource GetBitmap(float[] pixels, ImageProperties properties) { var bmp = new WriteableBitmap(properties.Rows, properties.Columns); using (var stream = bmp.PixelBuffer.AsStream()) { var bytes = new byte[4 * pixels.Length]; for (int i = 0; i &lt; pixels.Length; i++) { var greyness = properties.WindowAndLevel.GetValue(pixels[i]); bytes[4 * i] = greyness; bytes[4 * i + 1] = greyness; bytes[4 * i + 2] = greyness; bytes[4 * i + 3] = 0xff; } stream.Write(bytes, 0, bytes.Length); } return bmp; } </code></pre> <p>(Actually, I am using <code>stream.WriteAsync</code> in my own code, requiring the method to be declared as <code>async</code>. However, this is irrelevant for the above question as such.)</p> <p>This answer is similar to Diogo's, but if you are not already "there" hopefully this answer can lead you more directly to your goal.</p> <p><strong>UPDATE</strong></p> <p>I have now published my Evil Dicom port to Metro on Github. You can find the repository <a href="https://github.com/cureos/Evil-DICOM" rel="nofollow noreferrer">here</a>, and here is also a display from a very simple Metro application where I have used this Evil Dicom Metro port:</p> <p><img src="https://i.stack.imgur.com/VdOuM.png" alt="Metro DICOM Viewer"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload