0

I'm having a DICOM image data, which holds 16bit gray values. To visualize the data I need to apply a windowing method that cuts out pieces of the 16bits values. Therefore I have two properties, like WindowCenter and WindowWidth.

Since I want to use the WPF mechanisms I decided to create a DicomImage class which derives from BitmapSource. Since BitmapSource has no direct access to the internal pixeldata, I created a private WriteableBitmap (InternalImage) member where I can manipulate the data whenever WindowCenter and WindowWidth is changed.

To see the results I attach to Image.Source = DicomImage and the image is shown. But when I change the WindowCenter/WindowWidth the image is not updated. When I attach the WriteableBitmap directly (Image.Source = InternalImage) everything works as it should.

What I'm I doing wrong?

Thanks Marti

msedi
  • 1,437
  • 15
  • 25
  • Why dont you make your DicomImage deriving from WritableBitmap? – Florian Gl Sep 11 '13 at 13:48
  • I could, but I don't want the user to modify the WriteableBitmap. The last step would be your suggestion. But I also want to understand how the Image knows when something has changed. Since it works for WriteableBitmap there must be some unknown mechanism I cannot find. – msedi Sep 11 '13 at 16:15

0 Answers0