GIMP: opening dicom files

I am trying to open a dicom file (.dcm). All files I tried yield an error saying transfer syntax 1.2.840.10008.1.2.4.70 is not supported. What can I do?


Solution 1:

The error message says GIMP doesn't support the transfer syntax of the file. The source code of GIMP 2.99.6 (latest available version) shows that DICOM support is provided by file-dicom.c:

  switch (element_word)
    {
    case 0x0010:   /* transfer syntax id */
      if (strcmp("1.2.840.10008.1.2", (char*)value) == 0)
        {
          do_toggle_endian = FALSE;
          implicit_encoding = TRUE;
        }
      else if (strcmp("1.2.840.10008.1.2.1", (char*)value) == 0)
        do_toggle_endian = FALSE;
      else if (strcmp("1.2.840.10008.1.2.2", (char*)value) == 0)
        do_toggle_endian = TRUE;
      break;
    }

Transfer syntax 1.2.840.10008.1.2.4.70 isn't found in this or any other file in GIMP's source code.

As already suggested by Tetsujin and Anaksunaman, the only workarounds are to either use another application to open the file, or use an utility that converts it to one of the three transfer syntaxes GIMP does support:

1.2.840.10008.1.2 Implicit VR Endian: Default Transfer Syntax for DICOM

1.2.840.10008.1.2.1 Explicit VR Little Endian

1.2.840.10008.1.2.2 Explicit VR Big Endian

Seeing that the image transfer syntax is for lossless JPG I would strongly recommend finding another application. All three transfer syntaxes GIMP supports are for standard lossy JPG, so the usability of the resulting image in medical context is questionable.