DICOM File Output Error (DICOMファイル​のアウトプットエラー​について)

3 次查看(过去 30 天)
Hi, there!
I tried to output DICOM file in the following way, however I couldn't upload well. (please see the attachment.) The directory structure and the source code are described below.
DICOMファイルをアウトプットしようとしたところ、下図のように画像なしでアップロードされてしまい、うまくできません。ディレクトリの構造とソースコードを以下に記しますので、ご助言頂けますと幸いです。
どうぞよろしくお願いいたします。
Directory structure is as follows;
ディレクトリの構造は以下のとおりです。
main
-- a
-- image.dcm(10 dicom file)
 -- b
  -- image.dcm(10 dicom file)
 -- c
  -- image.dcm(10 dicom file)
-- d
  -- image.dcm(10 dicom file)
Here is my source code.
ソースコードは以下のとおりです。
%path = current directory
currentdirectory = pwd;
categories = {'a', 'b', 'c','d'};
%Create an ImageDatastore to help you manage the data.
imds = imageDatastore(fullfile(currentdirectory, categories),'IncludeSubfolders',true,'FileExtensions','.dcm','LabelSource', 'foldernames');
figure
%output 10 DICOM image
numImages = 10;
perm = randperm(numImages,10);
for i = 1:10
subplot(4,5,i);
imshow(imds.Files{perm(i)});
end

采纳的回答

Satoshi Kobayashi
编辑:Satoshi Kobayashi 2019-2-3
グレースケールイメージの表示範囲の問題だと推測します。
16 BPPのdicomで再現した結果、指定しなかった場合のグレースケールイメージの表示範囲(座標軸のCLim)は[-32768 32767]、すなわち、int16の最小値と最大値でした。
また、imshow をファイル名と共に呼び出す場合は、'DisplayRange' パラメーターを指定しなければなりません。
よって、以下のようにグレースケールイメージの表示範囲を指定してください。
imshow(imds.Files{perm(i)},'DisplayRange',[0 80]);
  1 个评论
ssk
ssk 2019-2-3
Kobayashiさま
ご回答いただき誠にありがとうございます。
頂いたコードをもとに修正したところ、無事コンパイルできました。
本当にありがとうございました。

请先登录,再进行评论。

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!