2 Replies - 1344 Views - Last Post: 24 April 2010 - 05:41 PM Rate Topic: -----

#1 fido_dido_do_it  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 15-December 08

Viewing an image from a jagged array

Posted 24 April 2010 - 03:17 PM

Hey Everyone,

I am developing a web application to view DICOM images. They are stored as pixels in the DICOM file.
According to the library i can either convert it to a byte[][] or object[].
Please anyone who knows how i can get either of these arrays to view them as an image.
Pleeeeeeeeeeeeease Heeeeeeeeelp , this is my Graduation Project in my senior year in Collage.
I appreciate the help.

This is what i have done so far:
namespace WebApplication2
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                Stream st = File.OpenRead("Img0000001.dcm");
                StreamReader sr = new StreamReader(st);
                DataElementDictionary dataElementDictionary = new DataElementDictionary();

                UidDictionary uidDictionary = new UidDictionary();

                dataElementDictionary.LoadFrom(@"D:\Grad.Proj\opendicom-sharp\dd\dicom-elements-2007.dic", DictionaryFileFormat.BinaryFile);

                uidDictionary.LoadFrom(@"D:\Grad.Proj\opendicom-sharp\dd\dicom-uids-2007.dic", DictionaryFileFormat.BinaryFile);

                
                DicomFile file = new DicomFile("Img0000001.dcm");
                
                DataSet ds = file.GetJointDataSets();
                Tag tag = new Tag("0002", "0000");
                
                PixelData pxd = new PixelData(ds);
                object[] obj = pxd.ToArray();
                byte[][] byt = pxd.ToBytesArray();
               
                
                byte[] sin = byt.SelectMany(x => x).ToArray();
                MemoryStream ms = new MemoryStream(sin);

                Image img = Image.FromStream(ms);




the last 5 lines is where i'm stuck

Thanx in advance :bigsmile:

Is This A Good Question/Topic? 0
  • +

Replies To: Viewing an image from a jagged array

#2 fido_dido_do_it  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 15-December 08

Re: Viewing an image from a jagged array

Posted 24 April 2010 - 03:19 PM

Hey Everyone,

I am developing a web application to view DICOM images. They are stored as pixels in the DICOM file.
According to the library i can either convert it to a byte[][] or object[].
Please anyone who knows how i can get either of these arrays to view them as an image.
Pleeeeeeeeeeeeease Heeeeeeeeelp , this is my Graduation Project in my senior year in Collage.
I appreciate the help.

This is what i have done so far:
namespace WebApplication2
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                Stream st = File.OpenRead("Img0000001.dcm");
                StreamReader sr = new StreamReader(st);
                DataElementDictionary dataElementDictionary = new DataElementDictionary();

                UidDictionary uidDictionary = new UidDictionary();

                dataElementDictionary.LoadFrom(@"D:\Grad.Proj\opendicom-sharp\dd\dicom-elements-2007.dic", DictionaryFileFormat.BinaryFile);

                uidDictionary.LoadFrom(@"D:\Grad.Proj\opendicom-sharp\dd\dicom-uids-2007.dic", DictionaryFileFormat.BinaryFile);

                
                DicomFile file = new DicomFile("Img0000001.dcm");
                
                DataSet ds = file.GetJointDataSets();
                Tag tag = new Tag("0002", "0000");
                
                PixelData pxd = new PixelData(ds);
                object[] obj = pxd.ToArray();
                byte[][] byt = pxd.ToBytesArray();
               
                
                byte[] sin = byt.SelectMany(x => x).ToArray();
                MemoryStream ms = new MemoryStream(sin);

                Image img = Image.FromStream(ms);




the bolded region is where i'm stuck

Thanx in advance :bigsmile:
Was This Post Helpful? 0
  • +
  • -

#3 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1632
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Viewing an image from a jagged array

Posted 24 April 2010 - 05:41 PM

Topics merged, please don't create duplicates
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1