Package: dcmtk Version: 3.6.4-2 It seems there is a regression in the JPEG-LS/CharLS encoder at least for some files. dcmcrle / dcmcjpeg seems to be ok. GDCM is able to compress it:
$ gdcmconv --jpegls /tmp/foo.dcm /tmp/o.dcm Steps: $ cd /tmp $ curl https://raw.githubusercontent.com/neurolabusc/dcm_qa/master/In/Orientation/ax/axasc35/MR.1.3.12.2.1107.5.2.32.35131.2014031012493950715786673 > foo.dcm $ gdb dcmcjpls (gdb) r /tmp/foo.dcm /tmp/o.dcm ... Starting program: /usr/bin/dcmcjpls /tmp/foo.dcm /tmp/o.dcm [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Program received signal SIGSEGV, Segmentation fault. 0x00007ffff76dd3b3 in EncoderStrategy::Flush (this=0x5555557452f0) at ./src/encoderstrategy.h:156 156 *_position = static_cast<uint8_t>(_bitBuffer >> 24); (gdb) bt full #0 0x00007ffff76dd3b3 in EncoderStrategy::Flush (this=0x5555557452f0) at ./src/encoderstrategy.h:156 i = 0 i = <optimized out> #1 0x00007ffff76dd555 in EncoderStrategy::AppendToBitStream (this=0x5555557452f0, bits=93, bitCount=<optimized out>) at ./src/encoderstrategy.h:87 mask = <optimized out> __PRETTY_FUNCTION__ = "void EncoderStrategy::AppendToBitStream(int32_t, int32_t)" #2 0x00007ffff76edfb8 in JlsCodec<LosslessTraitsT<unsigned short, 16>, EncoderStrategy>::EncodeMappedValue (limit=64, mappedError=<optimized out>, k=<optimized out>, this=0x5555557452f0) at ./src/losslesstraits.h:112 highbits = <optimized out> highbits = <optimized out> #3 JlsCodec<LosslessTraitsT<unsigned short, 16>, EncoderStrategy>::DoRegular (pred=<optimized out>, x=112, Qs=<optimized out>, this=0x5555557452f0) at ./src/scan.h:271 ctx = @0x555555745ad4: {A = 1573, B = -7, C = -1, N = 8} k = <optimized out> Px = 159 ErrVal = -47 sign = <optimized out> __PRETTY_FUNCTION__ = "typename TRAITS::SAMPLE JlsCodec<TRAITS, STRATEGY>::DoRegular(int32_t, int32_t, int32_t, EncoderStrategy*) [with TRAITS = LosslessTraitsT<short unsigned int, 16>; STRATEGY = EncoderStrategy; typename "... sign = <optimized out> ctx = <optimized out> k = <optimized out> Px = <optimized out> ErrVal = <optimized out> #4 JlsCodec<LosslessTraitsT<unsigned short, 16>, EncoderStrategy>::DoLine (this=this@entry=0x5555557452f0) at ./src/scan.h:660 Ra = <optimized out> Rc = <optimized out> Qs = <optimized out> index = 162 Rb = 59 Rd = 79 #5 0x00007ffff76ee16a in JlsCodec<LosslessTraitsT<unsigned short, 16>, EncoderStrategy>::DoScan (this=this@entry=0x5555557452f0) at /usr/include/c++/8/bits/stl_vector.h:930 component = <optimized out> line = <optimized out> pixelstride = 388 components = 1 vectmp = std::vector of length 776, capacity 776 = {0, 0, 25, 21, 18, 23, 23, 22, 25, 23, 27, 41, 69, 73, 93, 78, 72, 43, 231, 216, 92, 88, 128, 87, 85, 54, 50, 22, 15, 26, 37, 32, 31, 33, 43, 60, 16, 36, 33, 53, 24, 43, 49, 88, 47, 49, 47, 121, 100, 124, 174, 100, 90, 47, 53, 39, 15, 20, 20, 20, 20, 20, 25, 15, 20, 0, 24, 23, 25, 29, 22, 16, 33, 30, 24, 19, 54, 44, 126, 171, 191, 83, 87, 47, 30, 113, 51, 37, 131, 232, 53, 39, 33, 26, 52, 43, 26, 18, 24, 43, 28, 30, 22, 32, 29, 65, 57, 55, 85, 49, 68, 80, 39, 97, 162, 92, 72, 85, 57, 39, 21, 19, 20, 15, 30, 24, 32, 22, 16, 0,