ChangeTransferSyntax does not decompress pixel data

543 views
Skip to first unread message

RSWE

unread,
Apr 14, 2016, 4:41:56 AM4/14/16
to Fellow Oak DICOM
I did use the ChangeTransferSyntax(DicomTransferSyntax.ExplicitVRLittleEndian) way to decompress compressed dicom files.
The code runs fine, but the saved dicom file still shows the same (small) file size as its original, compressed source.

It looks like the PixelData has not been modified.....

(FO DICOM 2.0.2)

Anders Gustafsson Cureos AB

unread,
Apr 14, 2016, 6:31:59 AM4/14/16
to Fellow Oak DICOM
Hi!

Please note that the modified DICOM file is in the return value of the ChangeTransferSyntax method. The original DICOM file is left unmodified.
(I admit that the method name could be confusing...)

Regards,
Anders @ Cureos

RSWE

unread,
Apr 14, 2016, 7:32:13 AM4/14/16
to Fellow Oak DICOM
Gotcha!

It works, thank You.

RSWE

unread,
Oct 26, 2017, 7:48:05 AM10/26/17
to Fellow Oak DICOM
A follow up problem occurs.

In order to decompress JPEG2000 files we do the mentioned ChangeTransferSyntax(DicomTransferSyntax.ExplicitVRLittleEndian).

This works for source files with following TransferSyntax:


Files with following TransferSyntax result in an exception "Error in JPEG 2000 code stream":



Is this type not supported for decompression?







Anders Gustafsson Cureos AB

unread,
Oct 30, 2017, 4:59:13 PM10/30/17
to Fellow Oak DICOM
It should work equally well to transcode lossy and lossless JPEG2000 e.g. to Explicit LE. I have a vague feeling that there was some problem in earlier versions of fo-dicom though for this particular transfer syntax. Have you checked whether the latest release is behaving differently?

Regards,
Anders @ Cureos

RSWE

unread,
Nov 8, 2017, 4:46:32 AM11/8/17
to Fellow Oak DICOM
I did update to 3.0.2 Desktop, but this release seems to have new bugs, e.g. while reading a DicomTag.PatientBirthdate:


results in an Exception: "Element empty or index: 0 exceeds element count: 0"

Any hint?


RSWE

unread,
Nov 8, 2017, 5:30:59 AM11/8/17
to Fellow Oak DICOM
Looks like issue:

DicomDataset.Get<T[]> on empty tag should not throw#392


Reported as closed?

RSWE

unread,
Nov 9, 2017, 5:12:30 AM11/9/17
to Fellow Oak DICOM
Version 3.0.2 does not support decompressing lossless J2K either:

Exception: {"Error in JPEG 2000 code stream!"} System.Exception {Dicom.Imaging.Codec.DicomCodecException}

Stack:
   bei Dicom.Imaging.Codec.DicomJpeg2000NativeCodec.Decode(DicomPixelData oldPixelData, DicomPixelData newPixelData, DicomCodecParams parameters)
   bei Dicom.Imaging.Codec.DicomTranscoder.Decode(DicomDataset oldDataset, DicomTransferSyntax outSyntax, IDicomCodec codec, DicomCodecParams parameters) in C:\fo-dicom\DICOM\Imaging\Codec\DicomTranscoder.cs:Zeile 228.
   bei Dicom.Imaging.Codec.DicomTranscoder.Transcode(DicomDataset dataset) in C:\fo-dicom\DICOM\Imaging\Codec\DicomTranscoder.cs:Zeile 141.
   bei Dicom.Imaging.Codec.DicomTranscoder.Transcode(DicomFile file) in C:\fo-dicom\DICOM\Imaging\Codec\DicomTranscoder.cs:Zeile 90.
   bei Dicom.Imaging.Codec.DicomCodecExtensions.Clone(DicomFile file, DicomTransferSyntax syntax, DicomCodecParams parameters) in C:\fo-dicom\DICOM\Imaging\Codec\DicomCodecExtensions.cs:Zeile 26.
   bei Dicom.Imaging.Codec.DicomCodecExtensions.ChangeTransferSyntax(DicomFile file, DicomTransferSyntax syntax, DicomCodecParams parameters) in C:\fo-dicom\DICOM\Imaging\Codec\DicomCodecExtensions.cs:Zeile 57.

I do have no problems viewing the corresponding J2K file with e.g. MicroDicom or to convert it via GDCM......



Reply all
Reply to author
Forward
0 new messages