dicom, subplot, code rectify

조회 수: 12 (최근 30일)
Deepa S
Deepa S 2020년 1월 10일
댓글: Walter Roberson 2020년 1월 10일
I have 381 dicom images and trying to subplot each image as original and after masking but my code is plotting the last read image only. can somebody help with the code to plot all image.
Folder = '';
file = fullfile(Folder, '*.dcm');
image = dir(file);
for k = 1:length(image)
FileName = image(k).name;
fullFileName = fullfile(Folder, FileName);
I= dicomread(fullFileName);
mask = a > I & I> b; %a=2000, b=1500
R = I; R(mask) = 0;
G = I; G(mask) = intmax(class(I));
B = I; B(mask) = intmax(class(I));
RGB = cat(3, R, G, B); %final masked image
subplot(1,2,1),imshow(RGB) % masked image
subplot(1,2,2),imshow(I,[ ]) %original image
end
  댓글 수: 3
Deepa S
Deepa S 2020년 1월 10일
no, i dont want to show all image in montage. i want each image like attached picture but my code is reading o nly the last image not all.
Walter Roberson
Walter Roberson 2020년 1월 10일
Put in a call to
figure()
right before the first call to subplot()

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 DICOM Format에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by