Tuesday, September 07, 2010
Google Custom Search

Go to...

Recent Forum Posts

Our Community

Membership Membership:
Latest New User Latest: mendes
New Today New Today: 8
New Yesterday New Yesterday: 20
User Count Overall: 10692

People Online People Online:
Visitors Visitors: 6
Members Members: 2
Total Total: 8

Online Now Online Now:
01: fagamendi
02: a28wong

ClearCanvas Community Forums

Help required in for writing Imageviewer in WPF
Last Post 2010-06-09 11:08 AM by stewart. 1 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Saghar
New Member
New Member
Posts:1

--
2010-05-31 05:46 AM  

Hi all, 

I am developing Image viewer in WPF. I am new to DICOM and also to clearcanvas. I went through lot of posts of this forum and in result created a WPF Project which load DICOM images using the followin.

LocalSopDataSource dicomDataSource = new LocalSopDataSource(m_filePath);

                    ImageSop imageSop = new ImageSop(dicomDataSource);

                    IEnumerable images = PresentationImageFactory.Create(imageSop).ToArray();

                    int i = 1;

                    foreach (IPresentationImage presentationImage in images)

                    {

                        int Width = imageSop.Frames[i].Columns;

                        int height = imageSop.Frames[i].Rows;

                        

                        Bitmap bmp = presentationImage.DrawToBitmap(Width, height);

                        m_imageList.Add(Imaging.CreateBitmapSourceFromHBitmap(bmp.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty,

                                                                              BitmapSizeOptions.FromWidthAndHeight(Width, height)));

                        i++;

                    }

 

Now I have to add support for the following things.

  • window leveling
  • zoom
  • pan
  • full screen view
  • rotation
  • flip

Which projects from clearcanvas code are usable for me. Where to start. Is there any sample project available in WPF?

Thanks in advance.

 

Tags: Imageviwer WPF
stewart
Senior Member
Senior Member
Posts:1425

--
2010-06-09 11:08 AM  
Those are all handled internally by the presentation image renderer each time the image draws, and you manipulate those things by changing properties of the presentation image itself. Have a look in the CC.ImageViewer.Tools.Standard project, which is where all of these things are done and you should just be able to take the code and paste it into your viewer. One exception is the "full screen" view, but that is handled by passing the desired size to the PresentationImage.DrawToBitmap method.

Best regards,
Stewart
You are not authorized to post a reply.

Active Forums 4.1
Copyright 2010 ClearCanvas Inc.