| Author |
Topic  |
|
|
PincoPallino

Italy
13 Posts |
Posted - Feb 07 2026 : 13:32:35
|
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
    
39450 Posts |
Posted - Feb 08 2026 : 14:02:02
|
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
|
 |
|
|
PincoPallino

Italy
13 Posts |
Posted - Feb 09 2026 : 04:02:20
|
I sent you (using SwissTransfer) a Dicom.
|
 |
|
|
xequte
    
39450 Posts |
Posted - Feb 09 2026 : 15:31:01
|
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
|
 |
|
|
PincoPallino

Italy
13 Posts |
Posted - Feb 10 2026 : 04:57:57
|
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!
|
 |
|
|
xequte
    
39450 Posts |
Posted - Feb 11 2026 : 03:13:18
|
Hi Pinco
Can you forward me some samples where BitsPerSample it is internally recorded as 14?
Nigel Xequte Software www.imageen.com
|
 |
|
|
PincoPallino

Italy
13 Posts |
Posted - Feb 11 2026 : 07:50:25
|
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 |
 |
|
|
xequte
    
39450 Posts |
Posted - Feb 11 2026 : 21:15:50
|
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
|
 |
|
|
PincoPallino

Italy
13 Posts |
|
|
xequte
    
39450 Posts |
Posted - Feb 13 2026 : 14:18:48
|
Thanks Pinco,
Please email me to test the beta.
Nigel Xequte Software www.imageen.com
|
 |
|
|
PincoPallino

Italy
13 Posts |
Posted - May 18 2026 : 05:51:09
|
Hi, I see that in V 15.0 the tags BitsStored are HighBit are now correct.
What is still wrong is the default value of $0028, $1050, '32768'); // Window center $0028, $1051, '65535'); // Window Width
Where the correct default values has to be: Window center := 1 shl (Adida.BitsStored -1); Window Width := 1 shl Adida.BitsStored -1;
This in the case the user has not already set a value.
Best regards PP
|
 |
|
|
xequte
    
39450 Posts |
Posted - May 27 2026 : 02:17:18
|
Thanks Pinco, that is fixed in the latest beta, which you can email us for.
Nigel Xequte Software www.imageen.com
|
 |
|
|
PincoPallino

Italy
13 Posts |
Posted - Jun 05 2026 : 03:18:38
|
Hi, just got another problem. Sorry for reporting only a drop a month but who test my software with a real dataset works as is...
The Param.DICOM_Range actually has 2 possible values and in both cases when saving a Dicom image the save procedure does something with bitmap or with tags. This is problematic because all we know that Dicom is a "standard" so... is not enough standard! I set some tags before saving that are being stripped by AdjustTags(). What that procedure does is very important but, of course, can not take all things in account.
The last concrete example: it strips tags if ctx.Params.DICOM_Range = iedrAdjust then begin ctx.Params.DICOM_Tags.DeleteTag($0028, $1052, true); // remove Rescale intercept ctx.Params.DICOM_Tags.DeleteTag($0028, $1053, true); // remove Rescale slope end But these tags are required by some applications.
I propose a new value for Params.DICOM_Range: iedrMaintain. With this value the saving code does little work on image, colors and tags and simply saves as is. Best regards PP
|
 |
|
|
xequte
    
39450 Posts |
Posted - Jun 18 2026 : 14:51:51
|
Hi Pinco
Essentially that would be iedrSetBlackWhite but without setting the white and Black values:
http://www.imageen.com/help/TIEBitmap.BlackValue.html
I.e. iedrMaintain would be the same as using iedrSetBlackWhite, but resetting both BlackValue and WhiteValue to 0 to after loading.
Is that what you mean?
Nigel Xequte Software www.imageen.com
|
 |
|
| |
Topic  |
|