Here's what I see:
private async void Form1_Load(object sender, EventArgs e)
{
IEImage ieImage = new IEImage();
ieImage.LoadImage("brain_001.dcm");
// Format:ie16g
// IOParams.BitsPerSample:16
// IOParams.SamplesPerPixel:1
printDicomData(ieImage);
ieImage.SaveImage("brain_001.jpg"); // rendered strangely
// Format:ie24RGB
// IOParams.BitsPerSample:16
// IOParams.SamplesPerPixel:1
printDicomData(ieImage);
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
// Format:ie16g
// IOParams.BitsPerSample:16
// IOParams.SamplesPerPixel:1
printDicomData(ieViewer.Image);
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
// Format:ie24RGB
// IOParams.BitsPerSample:16
// IOParams.SamplesPerPixel:1
printDicomData(ieViewer.Image);
}
private void printDicomData(IEImage ieImage)
{
Console.WriteLine("Format:" + ieImage.Format);
Console.WriteLine("IOParams.BitsPerSample:" + ieImage.IOParams.BitsPerSample);
Console.WriteLine("IOParams.SamplesPerPixel:" + ieImage.IOParams.SamplesPerPixel);
}
Using IEImage.ConvertToTrueColor() doesn't affect the output when invoked anywhere in this code. I apologize but I don't know what you mean by updating the other values to "full color." Since I have provided a sample project and a sample file, would you be able to look at it on your side to see why this conversion is not working?
With Delphi, I do something similar like this and have no issues with a DICOM -> JPEG conversion:
io := TImageEnIO.Create(nil);
iebmp := TIEBitmap.Create;
io.AttachedIEBitmap := iebmp;
io.LoadFromFile('brain_001.dcm');
io.SaveToFile('brain_001.jpg');