ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder
ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 IEvolution DICOM to JPEG conversion issue
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

spurgeon

48 Posts

Posted - Jul 13 2020 :  08:47:36  Show Profile  Reply
When converting DICOM to JPEG with IEImage 8.0.0, the resulting image doesn't look right. Is there a way to fix this? For what it's worth, we do not have this issue with ImageEn (Delphi).


IEImage ieImage = new IEImage();
ieImage.LoadImage("brain_001.dcm");
ieImage.SaveImage("brain_001.jpg");
ieImage.Dispose();


Attached are a source DICOM image (brain_001.dcm) and the converted JPEG.

attach/spurgeon/202071384728_brain_001.zip
98.23 KB

xequte

5390 Posts

Posted - Jul 15 2020 :  21:04:10  Show Profile  Reply
Hi

What is the value for DicomRange:

https://www.imageen.com/ievolutionhelp/html/0f7063e1-f3e8-6908-ba24-bbe10f01149e.htm

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

spurgeon

48 Posts

Posted - Jul 17 2020 :  10:05:44  Show Profile  Reply
The value of ieImage.IOParams.DICOM_Range after loading brain_001.dcm is 0 (DicomRange.Adjust).

I don't know if this is helpful, but if I load the image into an IEViewer, it renders properly. EDIT: However, when saving the image from the IEViewer, it looks funny again. For example:


    public partial class Form1 : Form
    {
        IEViewer ieViewer;

        public Form1()
        {
            InitializeComponent();
        }

        private async void Form1_Load(object sender, EventArgs e)
        {
            IEImage ieImage = new IEImage();
            ieImage.LoadImage("brain_001.dcm");
            Console.WriteLine("ieImage.IOParams.DICOM_Range:"+ieImage.IOParams.DICOM_Range);
            ieImage.IOParams.DICOM_Range = DicomRange.SetBlackWhite;
            ieImage.SaveImage("brain_001.jpg"); // rendered strangely
            ieImage.SaveImage("brain_001.png"); // rendered strangely
            ieImage.Dispose();

            ieViewer = new IEViewer();
            ieViewer.Dock = DockStyle.Fill;
            ieViewer.Parent = this;
            this.Controls.Add(ieViewer);
            ieViewer.Image.LoadImage("brain_001.dcm"); // Looks great in IEViewer when loaded
            await Task.Delay(TimeSpan.FromSeconds(3));
            ieViewer.Image.SaveImage("ieviewer_brain_001.jpg"); // After saving, the IEViewer is now rendered strangely
            this.Size = new Size(Size.Width + 1, Size.Height); // have to "force" a refresh since IEViewer.Refresh() doesn't seem to work
        }
    }
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To: