Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 428991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:43:52+00:00 2026-05-12T19:43:52+00:00

This is a very narrow and specific question, but I know there are someone

  • 0

This is a very narrow and specific question, but I know there are someone else out there using this, so I’ll keep my fingers crossed and hope anyone of you pics this question up.

I’m working on a WPF application where one part of it is a Dicom viewer. We’d like to use a 3rd party component to handle the Dicom stuff, and ClearCanvas is the one we’ve got the best impression of this far. We’re able to load a Dicom file and fetch the attributes, but we’re having problems putting the image data on the Source property of an Image control to show it. Anyone with hints on how to make this happen?

Here’s the code I use for extracting the image data:

var file = new DicomFile(dicomFilePath);
var patientName = file.DataSet.GetAttribute(DicomTags.PatientsName);
var imageData = file.DataSet.GetAttribute(DicomTags.PixelData);

Have also tried using the ImageViewer library, but it is still the same data..

var localSopDataSource = new LocalSopDataSource(new DicomFile(dicomFilePath));
var patientName = localSopDataSource.File.DataSet.GetAttribute(DicomTags.PatientsName);
var imageData = localSopDataSource.File.DataSet.GetAttribute(DicomTags.PixelData);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T19:43:52+00:00Added an answer on May 12, 2026 at 7:43 pm

    Okay, I figured it out.. There might be some more ways of achieving this, but this is what I did. Now I have a Wpf Image bound to a property which provides the bitmap data. The following is the property used to provide the Bitmap data.

    public BitmapSource CurrentFrameData
    {
        get
        {
            LocalSopDataSource _dicomDataSource = 
                new LocalSopDataSource(_dicomFilePath);
            var imageSop = new ImageSop(_dicomDataSource);
    
            IPresentationImage presentationImage = 
                PresentationImageFactory.Create(imageSop.Frames[CurrentFrame]);
    
            int width = imageSop.Frames[CurrentFrame].Columns;
            int height = imageSop.Frames[CurrentFrame].Rows;
    
            Bitmap bmp = presentationImage.DrawToBitmap(width, height);
            BitmapSource output = Imaging.CreateBitmapSourceFromHBitmap(
              bmp.GetHbitmap(),
              IntPtr.Zero,
              Int32Rect.Empty,
              BitmapSizeOptions.FromWidthAndHeight(width, height));
    
              return output;
        }
    }
    

    Note that this is a very straight forward solution. One might e.g. want to do stuff like preloading the pictures etc to avoid heavy load when scrolling multiframe images. But for the “howto display the image” question – this should answer it..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question goes beoynd just programming, but I'd like to get some input on
There are plenty of performance questions on this site already, but it occurs to
I'm playing around with a little jquery animation and trying to achieve a very
I just fixed a memory leak caused by someone forgetting to call the superclass's
On this page , I have a 2-tone background. The structure of the page
I'm working on some out transitions on image when a user presses the button
When defining a customer-accessible API, what is the preferred industry practice between the following:
I'm looking for an editor - not an IDE - that has just syntax
Several times in my career, I have worked in a software group that determined

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.