DICOM, TransferSyntax with BigEndian

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
A.K.
Posts: 6
Joined: 2014-10-28T07:52:51-07:00
Authentication code: 6789

DICOM, TransferSyntax with BigEndian

Post by A.K. »

I have prepared DICOM file with BigEndian TransferSyntax [1.2.840.10008.1.2.2] from valid LittleEndian file by dcmconv utility (Linux).

There are programs, reading correclty file structure --- Tags, Values, Lengthes (e.g., matlab, irfanview, ImageJ, gdcmviewer).
Problems occur with Little/Big Endian interpretation of Pixel Data (which seems to depend much on VR=OB or VR=OW).

But ImageMagick fails with "insufficient image data in file `BE.dcm' @ error/dcm.c/ReadDCMImage/3057"

(The problem is irrelevant to -endian flag: byte order is defined by TransferSyntax).
Last edited by A.K. on 2014-10-28T13:11:57-07:00, edited 1 time in total.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: DICOM, TransferSyntax with BigEndian

Post by magick »

Post a URL so we can download your image and inspect it. If we can reproduce the problem, we'll add a patch to ImageMagick 6.8.9-10 within a few days.
A.K.
Posts: 6
Joined: 2014-10-28T07:52:51-07:00
Authentication code: 6789

Re: DICOM, TransferSyntax with BigEndian

Post by A.K. »

LittleEndian, LE2.dcm, normal.
BigEndian, BE2.dcm, unreadable.

Sorry, I did not note ImageMagick versions used (and I shall not be able to do it tomorrow).
Under Linux it was IM, included in Debian distribution.
And it was the recent version, proposed for installation under WinXP.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: DICOM, TransferSyntax with BigEndian

Post by magick »

We can reproduce the problem, we'll need a few days to fix it. The transfer syntax specifies MSB yet the next element is still LSB (0x0002,0x0013) but the next is MSB (0x0008,0x0005).
A.K.
Posts: 6
Joined: 2014-10-28T07:52:51-07:00
Authentication code: 6789

Re: DICOM, TransferSyntax with BigEndian

Post by A.K. »

magick wrote:The transfer syntax specifies MSB yet the next element is still LSB (0x0002,0x0013) but the next is MSB (0x0008,0x0005).
Yes, as far as I remember, the metadata block, (0x0002,0x****) should be always written in LittleEndianExplicit;
the rest, starting with (0x0008,0x****), is written in either LSB or MSB, according to specified TransferSyntax, (0x0002,0x0010).
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: DICOM, TransferSyntax with BigEndian

Post by magick »

We can reproduce the problem you posted and have a patch in ImageMagick 6.8.9-10 Beta, available by sometime tomorrow. Thanks.
Post Reply