dicomread()command is not reading the .dcm format image

matlab is not readind the dicom format image using the dicomread() command and returning......
Error using dicomread>newDicomread (line 233)
Unsupported data encoding.
Error in dicomread (line 89)
[X, map, alpha, overlays] = newDicomread(msgname, frames, useVRHeuristic);
and this is the dicom image i tried to read

8 comentarios

anyone please can answer this ?i need it quickly
Rik
Rik el 17 de Mayo de 2023
Apparently the data encoding of this file is not supported. Have you tried alternative methods to read the file that don't rely on dicomread?
i export the data from remotEye viewer ,i did again but i cannot get what's wrong.
is there a way fixing it on matlab?
Rik
Rik el 18 de Mayo de 2023
That wasn't my question. Did you try any of the dicom readers from the file exchange? Did you try an external program like microdicom?
I have not downloaded the file to examine the details, but I can say that potentially the encoding is JPEG 2000, which is not handled by dicomread()
eten hyle
eten hyle el 18 de Mayo de 2023
Editada: eten hyle el 18 de Mayo de 2023
yes i used different readers like RadiAnt(it reads),weasis(it reads) and microdicom( unable to read ) but same result is obtained..(all slices of the original dicom images are viewable on the reader but returns error on matlab)
The encoding iwas in DICOM format when i export it.
but when i convert it to jpeg and then to dicom using online converter like aspose dicomread()command rea ds
Rik
Rik el 18 de Mayo de 2023
I just tried it myself with this alternative reader. It seems to read all tags just fine, except for the image tags. Apperently it uses an alternative standard to store the image. Unless you figure out what standard that is, I doubt it will be easy to read the image.
of course the readers view the image ,i can see the dicom image on it(there is no problem on reading it on dicom reader) but the problem is when i export it and try to read it on matlab using the comand dicomread() it returns
Error using dicomread>newDicomread (line 233)
Unsupported data encoding.
Error in dicomread (line 89)
[X, map, alpha, overlays] = newDicomread(msgname, frames, useVRHeuristic);

Iniciar sesión para comentar.

 Respuesta aceptada

Walter Roberson
Walter Roberson el 18 de Mayo de 2023
TransferSyntaxUID: '1.2.840.10008.1.2.4.80'
JPEG-LS Lossless Image Compression
MATLAB does not support JPEG-LS (except in the sense that if you happen to be using Windows and if your Microsoft Media Platform happens to have been extended with a JPEG-LS codec, then imread() just might be able to handle an image file in the format; this would not apply for dicom though.)
You have two options that I can think of at the moment:
  • use some kind of external dicom reader and writer to convert to a transfer syntax that MATLAB can handle; or
  • use the dicom header information to find the location and size inside the dcm file of the raw binary data, read it as raw data, and use a function similar to https://www.mathworks.com/matlabcentral/fileexchange/53039-jpegls_codec to decode the raw data

9 comentarios

https://github.com/rordenlab/dcm2niix is a DICOM to NIFTI conversion program that has MATLAB support, and can optionally have JPEG-LS support compiled into it.
thank you so much sir!
eten hyle
eten hyle el 27 de Mayo de 2023
Editada: eten hyle el 30 de Mayo de 2023
i used viewers for above attached image : first i export the dicom image to the folder and using next viewer the image was viewed from the first folder and export the image.then the viewer corrected the transfer syntax number and the .dcm image become readable on matlab.
but my question, is this image may have problem ?
Since the Transfer Syntax happens to be JPEG-LS which is Lossless JPEG, then the quality should be as good as if you had used PNG or TIF.
You should prefer not to work with Lossy JPEG (the great majority of .jpg files), as the compression algorithm for those can create artifacts that can be difficult to deal with. However, Lossless JPEG does not have that problem.
the transcoding i selected during export on the first viewer was explicit VR little endian[1.2.840.10008.1.2.1]. then dicomread() command reads the .dcm image but didn't read exported by lossless JPEG compression
so is this dicom image by(explicit VR little endian) is safe for using it for other (texture)analysis ? i just want to be sure!
Marking a DICOM file as "explicit VR little endian" is a header that indicates that every DICOM attribute will have include explicit length and end-ian information, and that the representation of the attributes will be in little-endian format. The major competitor is "implicit" VR, in which case some length and endian information will be implied.
"explicit VR little endian" does not indicate how the data itself is stored; there would still be a 1.2.840.10008.1.2.4.* or (not often) 1.2.840.10008.1.2.5 or 1.2.840.10008.1.2.6 Transfer Syntax tag indicating how the image data is encoded.
eten hyle
eten hyle el 28 de Mayo de 2023
Editada: eten hyle el 28 de Mayo de 2023
thank you sir for your detail explanation!
but my last quesion is i want to use this image in dicom format on matlab and i'm afraid using viewers and export same image may cause information lose on my result.
Yes, information loss could occur using that path.
You should use one viewer that can interpret JPEG-LS data and export it using any of the lossless transfer syntax listed at https://www.mathworks.com/help/images/ref/dicomread.html#mw_4c7434ed-c796-477c-aca8-5e3f7989ea7f
Actually, even just "explicit VR little endian" might work.
A viewer that can read JPEG-LS and can export it as any of the lossless transfer syntaxes, "should not" lose information when it does the transformation.
But I have no experience with weasis or onis so I have no idea whether they are high quality programs or junk programs, so I cannot be sure that they will not lose information in cases there is no good reason to lose information.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre DICOM Format en Centro de ayuda y File Exchange.

Productos

Versión

R2019a

Preguntada:

el 15 de Mayo de 2023

Editada:

el 30 de Mayo de 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by