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
 Create Dicom: problem with standard tags and default value
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

PincoPallino

Italy
11 Posts

Posted - Feb 07 2026 :  13:32:35  Show Profile  Reply
Hi,
using version 14.0.1.
I read a group of images with TImageEnMIO with
IoParams.BitsPerSample := 14;
IoParams.SamplesPerPixel := 1;
Bitmap.PixelFormat := ie16g;
then I save in Dicom format.
The problem is that the code in iemio.pas from line 5114 overwrites the BitsPerSample in Dicom image even if (like very often) it already has a different value.
The right values for this information would be the BitsStored for internal Dicom context.

And then, in file iedicom.pas
from line 8746
if (ctx.Params.SamplesPerPixel = 1) and (ctx.Params.BitsPerSample = 16) then
begin
// Gray scale 16 bit
ctx.Params.DICOM_Tags.SetTagString($0028, $0004, IEDICOM_PHOTOMETINTERPRET_MONOCHROME_ZEROISBLACK); // Photometric interpretation
ctx.Params.DICOM_Tags.SetTagNumeric($0028, $0100, 16); // Bits allocated
ctx.Params.DICOM_Tags.SetTagNumeric($0028, $0101, 16); // Bits stored
ctx.Params.DICOM_Tags.SetTagNumeric($0028, $0102, 15); // High bit

The values for BitAllocated and BitsStored are fixed and I haven't found a way to change. Except editing the dicom file directly.
This is a problem with medical images because having a wrong value leads to displaying ugly images.

It would be very usefull at least a new property in TIOParams
property DICOM_BitsStored: Integer read fDICOM_BitsStored write fDICOM_BitsStored;
Best regards
PP

xequte

39327 Posts

Posted - Feb 08 2026 :  14:02:02  Show Profile  Reply
Hi

We have been doing a lot of work with PixelFormats in our current beta. Can you forward us some of your BPP14 images so we can test this?

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

PincoPallino

Italy
11 Posts

Posted - Feb 09 2026 :  04:02:20  Show Profile  Reply
I sent you (using SwissTransfer) a Dicom.
Go to Top of Page

xequte

39327 Posts

Posted - Feb 09 2026 :  15:31:01  Show Profile  Reply
Thanks, so at this time, ImageEn will always save ie16g images as SamplesPerPixel = 1 and BitsPerSample = 16. Are you seeing invalid images being created in this way?


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

PincoPallino

Italy
11 Posts

Posted - Feb 10 2026 :  04:57:57  Show Profile  Reply
Hi Nigel,
the image is not invalid. It can be read by all software.
But saying that has 16 bit "used" when are only 14 or 12 create some problem in visualization.
It's an incorrect information!
Go to Top of Page

xequte

39327 Posts

Posted - Feb 11 2026 :  03:13:18  Show Profile  Reply
Hi Pinco

Can you forward me some samples where BitsPerSample it is internally recorded as 14?



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

PincoPallino

Italy
11 Posts

Posted - Feb 11 2026 :  07:50:25  Show Profile  Reply
Hi Nigel,
the image I already sent you was recorded at 14 bit, the original was divided in some hundreds raw files that I loaded with TImageEnMIO than saved to Dicom and finally patched by hand the tags BitsStored and HighBit.
All (not many) images I've are near identical :-(
I will ask them to give me more material to work with.
PP
Go to Top of Page

xequte

39327 Posts

Posted - Feb 11 2026 :  21:15:50  Show Profile  Reply
Sorry Pinco, I was meaning a file created by a third party application, but it is OK, I have found one. Can you please email me to test a DICOM_BitsStored property.

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

PincoPallino

Italy
11 Posts

Posted - Feb 13 2026 :  02:29:18  Show Profile  Reply
Attached one image.

NB: File extension .dcm - this extension is not allowed
So change the extension!


attach/PincoPallino/202621322842_508_anon.DCM.zip
513.67 KB
Go to Top of Page

xequte

39327 Posts

Posted - Feb 13 2026 :  14:18:48  Show Profile  Reply
Thanks Pinco,

Please email me to test the beta.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: