-
Notifications
You must be signed in to change notification settings - Fork 640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[.NetCore]Encoding to JPEG2000Lossless is not handled correctly #1099
Comments
Refer to Native codecs on .NET TranscoderManager.SetImplementation(Efferent.Native.Codec.NativeTranscoderManager.Instance);
string file = @"Input.dcm";
DicomFile dicomFile = DicomFile.Open(file);
DicomTranscoder transcoder = new DicomTranscoder(dicomFile.Dataset.InternalTransferSyntax,
DicomTransferSyntax.JPEG2000Lossless);
transcoder.Transcode(dicomFile).Save("output.dcm"); It works well. Converted DicomFile: |
I agree that for .NET core the recommended transcoder is the codecs by Efferent, but if we provide a managed decoder it should work. @gofal provided this decoder, so he's probably in the best position to investigate this problem. Do note that the efferent transcoders do not seem to support multithreading on the same image, but that's still under investigation. See here Efferent-Health/fo-dicom.Codecs#9 |
No the latest stable release of the efferent codecs should be fine, they've been around for a while. You shouldn't need any pre-release versions, neither from fo-dicom or efferent. It's just that starting from fo-dicom 5.x, the efferent codecs will be the officially endorsed codecs and we will phase out the old codecs that are embedded in fo-dicom. That's why the efferent codecs are changing names, so that it's obvious they are the "official ones" going from 5.x forward. |
@amoerie Perfect, I'm not aware they have a different name before! |
@gofal quick summary so far: there seems to be an issue in the managed decoder of JPEG Lossless, sample DICOM file can be found at the top. There is an easy workaround: use the latest stable efferent codecs. But perhaps we should also fix this issue in the managed decoder, no? |
@amoerie where is this managed JpegLossless decoder invoked? The issue is about encoding from uncompressed to J2kLosless. Then the output is rendered wrong, wo fo-dicom uses the j2kLossless decoder to render. JpegLossless is not involved in this all? |
I was mixing J2K with JPEG lossless, and misread the issue as a decoding problem instead of an encoding one. Please disregard what I said 😳 |
related to #1083? |
It will be hard to fix this in Jpeg2k codec. If there is anyone who knows how to fix it, then you are welcome. Please reopen this if you think there is still something left open to do. |
Describe the bug
When transcode from ExplicitVRLittleEndian to JPEG2000Lossless, the image is not converted correctly
To Reproduce
Expected:
The converted image should be same as original
Actual:
It looks like over exposed
Screenshots or test DICOM files
Original Image:
Converted Image:
Original dicomFile:
Input.zip
Converted DicomFile:
Output.zip
Environment
Fellow Oak DICOM version: ( 4.0.6)
OS: Windows 10 x64
Platform: .NetCore 3.1
The text was updated successfully, but these errors were encountered: