How do I fix this error in dicomread? It will not read in my .dcm file.

4 ビュー (過去 30 日間)
Crystal Green
Crystal Green 2016 年 3 月 30 日
コメント済み: Walter Roberson 2017 年 11 月 18 日
I am trying to read in multiple images. However I keep getting an error. My code is the following
clear all close all
num_images=67;
% Preallocate the 1000-by-2304-by-1-by-41 image array.
X = repmat(uint16(0), [1000 2304 1 num_images]);
% Read the series of images.
for p=1:num_images
filename = sprintf('12003_LCC_03Mar2016_145302_%03d_SART_It01.dcm', p);
X(:,:,1,p) = dicomread(filename);
end
% Display the image stack.
montage(X,[])
I keep getting the following error
Subscripted assignment dimension mismatch.
Error in dicomread>getOverlays (line 1172)
overlays(:,:,1,p) = bitget(X(:,:,1,1), ...
Error in dicomread>newDicomread (line 257)
[overlays, X] = getOverlays(X, metadata);
Error in dicomread (line 79)
[X, map, alpha, overlays] = newDicomread(msgname, frames);
Any ideas on how to fix this?
  1 件のコメント
Geppetto
Geppetto 2016 年 4 月 19 日
Crystal have you been able to solve this problem?

サインインしてコメントする。

回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 4 月 19 日
You could get that error if you dicom images were not all the same size. You should read into a variable and check the size of the result before attempting to store into your array of results.
  2 件のコメント
Walter Roberson
Walter Roberson 2017 年 11 月 18 日
Rotha Uy comments to me:
He does not really answer the question
Walter Roberson
Walter Roberson 2017 年 11 月 18 日
Rotha Uy:
Can you post a copy of a dicom image this is happening on? You will probably need to zip the .dcm and attach the .zip version.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by