I have 50 dicom files in one folder. i need to transfer pixel matrix of each image file into one common csv file and also the next image matrix must start from the next row in the same csv file. here is my code.
myFolder = ' ';filePattern = fullfile(myFolder, '*.dcm');image = dir(filePattern);for k = 1:length(image) baseFileName = image(k).name; fullFileName = fullfile(myFolder, baseFileName); I= dicomread(fullFileName); rowImage = reshape(I, 1, []); if k == 1 csvwrite('file.csv', rowImage, 'delimeter',','); else csvwrite('file.csv', rowImage, 'delimiter',',','-append'); end end
my code is not doing the thing i want . Anyone who can help with this code would be appreciated.
Best Answer