How to read multiple dicom image files from a folder ? This is the code. I am trying to calculate psnr and store it in excel, but i am getting blank sheet. Thanks in advance
1 次查看(过去 30 天)
显示 更早的评论
clc;
clear all;
img_folder = 'C:\Users\COMSOL\Documents\MATLAB\2XXX00';
dicomlist = dir(fullfile(img_folder,'Images','*.dcm'));
a = zeros(100, 'int8');
for I = 1 : numel(dicomlist)
f = dicomread(fullfile(img_folder,'Images',dicomlist(cnt).name));
gray = rgb2gray(f);
M = medfilt2(gray, [3,3]);
nr = psnr(gray,M);
a(1i,:) = nr;
end
xlswrite('psnr.xlsx',a);
0 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!