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 view (last 30 days)
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);

Answers (0)

Categories

Find more on DICOM Format in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!