Closed Daniel300000 closed 1 year ago
Hi @Daniel300000,
You are correct in that the doc-string for the encoding quality parameter is wrong. The correct should be, as you noted, that < 1 (or > 1000) results in lossless JPEG2000. Will fix this in #70.
@Daniel300000 can you test 0.9.2 and report if the transfer syntax is as expected (given the new argument doc-string that quality should be < 1 for lossless)?
Yes, I can confirm that the TransferSyntaxUID in the final .dcm file is "1.2.840.10008.1.2.4.90" when using "encoding_quality = 0.0".
I also found that there are two wrong doc-string comments left in "wsidicomizer.py" and "cli.py".
Thanks @Daniel300000 for finding the missed doc-strings. I have updated those in #73.
Hi!
According to the comments, one should use "encoding_quality = 100" for lossless JPEG2000:
However, in the class "Jpeg2000Encoder", the DICOM transfer syntax "JPEG2000Lossless" is used for values < 1 only:
When setting "encoding_quality = 100" and then debugging, encoder.transfer_syntax is "1.2.840.10008.1.2.4.91". For lossless JPEG2000, I would expect "1.2.840.10008.1.2.4.90".
Also, in _jpeg2k.pyx from the "imagecodecs" package, quality < 1 seems to be expected for lossless JPEG2000:
However, debugging shows that jpeg2k_encode() is also called with level = 100:
I guess the comments should be: "Use 0 for lossless jpeg2000"? Or am I missing something important?