Efferent-Health / fo-dicom.Codecs

Cross-platform Dicom native codecs for fo-dicom
Other
64 stars 22 forks source link

DllNotFoundException "Dicom.Native.dll" in DicomJpegNativeCodec #47

Closed jnlycklama closed 1 year ago

jnlycklama commented 1 year ago

Describe the bug

Trandcoding a dataset, we see exception with message:

Unable to load shared library 'Dicom.Native.dll' or one of its dependencies. In order to help diagnose loading problems, consider using a tool like strace. If you're using glibc, consider setting the LD_DEBUG environment variable: 
/app/runtimes/linux-x64/native/Dicom.Native.dll.so: cannot open shared object file: No such file or directory
/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.5/Dicom.Native.dll.so: cannot open shared object file: No such file or directory
/app/Dicom.Native.dll.so: cannot open shared object file: No such file or directory
/app/runtimes/linux-x64/native/libDicom.Native.dll.so: cannot open shared object file: No such file or directory

Message: Failed to transcode frame 0 from 1.2.840.10008.1.2.4.70 to 1.2.840.10008.1.2.1

Stack trace:

   at FellowOakDicom.Imaging.NativeCodec.Jpeg.JpegCodec.jpeg_create_decompress_12(j_decompress_ptr& dinfo)
   at FellowOakDicom.Imaging.NativeCodec.Jpeg.JpegCodec.Decode(DicomPixelData oldPixelData, DicomPixelData newPixelData, DicomJpegParams jpegParams, Int32 frame)
   at FellowOakDicom.Imaging.NativeCodec.DicomJpegNativeCodec.Decode(DicomPixelData oldPixelData, DicomPixelData newPixelData, DicomCodecParams parameters)
   at FellowOakDicom.Imaging.Codec.DicomTranscoder.Decode(DicomDataset oldDataset, DicomTransferSyntax outSyntax, IDicomCodec codec, DicomCodecParams parameters)
   at FellowOakDicom.Imaging.Codec.DicomTranscoder.Transcode(DicomDataset dataset)
   at Microsoft.Health.Dicom.Core.Features.Retrieve.Transcoder.TranscodeFrame(DicomDataset dataset, Int32 frameIndex, DicomTransferSyntax targetSyntax)

To Reproduce The code that is calling the fo-dicom Transcode method is here: https://github.com/microsoft/dicom-server/blob/c6d6b553934a58788d83b61d4da1e77266fee196/src/Microsoft.Health.Dicom.Core/Features/Retrieve/Transcoder.cs#L76

Expected behavior fo-dicom is able to transcode the frame from 1.2.840.10008.1.2.4.70 to 1.2.840.10008.1.2.1

Screenshots or test DICOM files This failure is happening with customer data, so we are unable to see any more details about the dataset, or provide similar test dataset.

Environment Fellow Oak DICOM version: "fo-dicom" Version="5.1.0" "fo-dicom.Codecs" Version="5.10.6" OS: linux x64 Platform: .NET 7.0

cbeltran1306 commented 1 year ago

Hello @jnlycklama, this bug has been fixed, please you can use new nuget published https://www.nuget.org/packages/fo-dicom.Codecs/5.10.7, this nuget is using the latest release fo-dicom v5.1.1 nuget version.