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 visualización (últimos 30 días)
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);

Respuestas (0)

Categorías

Más información sobre DICOM Format en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by