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

조회 수: 3 (최근 30일)
ssk
ssk 2019년 2월 2일
댓글: ssk 2019년 2월 3일
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일
편집: 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!