using for loop, i can read all the 'k' dicom files present in the folder . After performing some operation on each slice, i need to save them into another folder .
Someone please help me
for k=1:size(names, 1)
M(:,:,k) = foperation(P);
dicomwrite(Mask(:,:,k),'mask_01.dcm') // what and how should i change this line to save all k files into another folder