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

New Topic/Question
Reply




MultiQuote



|