Hi everyone, I have a group of images and I want to delete some of them, selected by their contents.
They are all named with a progressive name (Img000001, ImgA000002 and so on…) and I have collected the numbers of the ones I want to keep in the vector 'ok' with this code:
% Image acquisition and crop
tiffFiles = dir('*.tif'); numfiles = length(tiffFiles);cell = cell(1, numfiles);count=0;ok = zeros();for k = 1:numfiles cell{k} = imread(tiffFiles(k).name); cell_adj{k} = imadjust (cell{k});cell_crop{k} = imcrop (cell_adj{k}, [0,30,1616,300]);cell_sub{k} = cell_crop{k}-cell_crop{1};cell_2bw{k} = imbinarize(cell_sub{k}, 0.25); if cell_2bw{k} == zeros() cell_2bw{k} = []; else ok(count) = k-1; count = count + 1; endend
Now I don't know how to access the folder and delete the selected files. Thank you for your help!
Monni
Best Answer