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

6 views (last 30 days)
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 Comments
Rik
Rik on 18 May 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.
eten hyle
eten hyle on 18 May 2023
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);

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 18 May 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 Comments
Walter Roberson
Walter Roberson on 28 May 2023
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.
Walter Roberson
Walter Roberson on 28 May 2023
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.

Sign in to comment.

More Answers (0)

Categories

Find more on Convert Image Type in Help Center and File Exchange

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!