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
 DICOM_Compression
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

AlphaUniform

30 Posts

Posted - Apr 27 2018 :  10:59:04  Show Profile  Reply
Hi,
I'm using ImageEn 6.3.0 and I want to save a Bitmap as DICOM with JPEG Compression.

I tried this code

io->LoadFromFile("D:\\image.bmp");

	io->Params->DICOM_Compression = iedcLSJPEG1;
	io->Params->DICOM_JPEGQuality = 100;
	io->SaveToFileDICOM("C:\\temp\\dcm\\1.dcm");


	img->IO->LoadFromFile("D:\\image.bmp");
	img->IO->Params->DICOM_Compression = iedcLSJPEG1;
	img->IO->Params->DICOM_JPEGQuality = 100;
	img->IO->SaveToFileDICOM("C:\\temp\\dcm\\2.dcm");


Where io = TImageEnIO.
img = TImageEnView.

Both functions produce an uncompressed DICOM file (iedcUncompressed).
If I go through with the debuger I see that Params->DICOM_Compression "fall back" to iedcUncompressed.

Could anybody tell me what i'm doing wrong?

Thanks in advance
Alex

xequte

38131 Posts

Posted - May 10 2018 :  20:00:14  Show Profile  Reply
Hi Alex

Please see the list of supported DICOM save formats at:

https://www.imageen.com/help/TIEDicomCompression.html

It was decided not to implement lossless JPEG because it is not a recommended or widely used format. For compressed, lossless support iedcLosslessJPEG2000 is the recommended format.

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

AlphaUniform

30 Posts

Posted - May 11 2018 :  01:48:53  Show Profile  Reply
Hi Nigel,
thank you very much!
J2K works.

Best regards
Alex
Go to Top of Page

MilfordMac

United Kingdom
1 Posts

Posted - May 28 2018 :  07:55:35  Show Profile  Reply
Hi Nigel, are there plans to enable more formats in the future? I'm just curious.
Go to Top of Page

xequte

38131 Posts

Posted - May 28 2018 :  16:30:29  Show Profile  Reply
Hi

As with all features, we are driven by our users. If there is demand, then we will endeavour to implement it.

In this case, we would advise users that the alternative (Lossless JPEG2000) is better, but if they still have a good reason for wanting Lossless JPEG, we'd like to hear it.

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

AlphaUniform

30 Posts

Posted - May 24 2020 :  10:11:53  Show Profile  Reply
Hi again,
I'm now using ImageEn 8.7.6.
When I load a 24rgb jpg an try to save it as compressed DICOM:

TIEBitmap *bmp = new TIEBitmap();

	TImageEnIO *pIO = new TImageEnIO(bmp);
	pIO->NativePixelFormat = false;
	pIO->LoadFromFile(as);
	pIO->Params->DICOM_J2000Rate = 0.05;
	pIO->Params->DICOM_Compression = iedcJPEG2000;

	pIO->SaveToFileDICOM("C:\\temp\\t.dcm");
	delete pIO;
	delete bmp;


pIO->Params->DICOM_Compression after SaveToFileDICOM jumps back to iedcUncompressed.

Can anybody tell, me what is wrong with this?

Thanks in advance
Alex
Go to Top of Page

AlphaUniform

30 Posts

Posted - May 25 2020 :  04:54:29  Show Profile  Reply
Hi again,
I checked the same code and the same jpg with ImageEn 8.1.2 here the compression works.

Best regards
Alex
Go to Top of Page

xequte

38131 Posts

Posted - May 25 2020 :  20:31:20  Show Profile  Reply
Hi Alex

Sorry, you need to initiate DICOM_Tags before setting compression if the file is not DICOM:

IO.Params.DICOM_Tags;
IO.Params.DICOM_J2000Rate := 0.05;
IO.Params.DICOM_Compression := iedcJPEG2000;

I will fix this limitation for the next release.

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

AlphaUniform

30 Posts

Posted - May 26 2020 :  09:50:45  Show Profile  Reply
Hi Nigel,
thanks for the reply.

I switched the project (and all the connected projects ) in the meantime back to 8.1.2.

Are there any major benefits in 8.7.6 regarding DICOM?


8.5.0:
Many optimization and new properties for JPEG 2000 support, including support for loading and saving very large images

Does this affect DICOM J2k compression although?


Best regards
Alex
Go to Top of Page

xequte

38131 Posts

Posted - May 29 2020 :  01:44:39  Show Profile  Reply
Hi Alex

There have been a number of DICOM fixes and new properties since 8.1.2.

The updated JPEG2000 code is used with DICOM J2K compression, so there may be some improvement there.


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

AlphaUniform

30 Posts

Posted - May 29 2020 :  09:58:57  Show Profile  Reply
Thank you very much!
I updated back to 8.7.6 and inserted the initiate DICOM_Tags.

Compression works :)

Best regards
Alex
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: