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 Ansicht (letzte 30 Tage)
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);

Antworten (0)

Kategorien

Mehr zu DICOM Format finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by