% Put the good CaseCTFolder (\amira) function pixel = infoPixel (CaseCTFolder) fileTif = [ CaseCTFolder '\*.tif']; numberInfoTif = dir (fileTif); pixel = []; numberLineTabPixel= 0; for i = 1: size(numberInfoTif,1) inputFile = [CaseCTFolder '\' numberInfoTif(i).name(1:end-3) 'info']; fileID = fopen(inputFile); if fileID ~= -1 while size(pixel,1) <= numberLineTabPixel tline = fgetl(fileID); if length(tline)>4 if strcmp (tline(1:5),'pixel') k = strfind (tline, ' '); pixel = [pixel; str2num(tline(k(1)+1:k(1)+5)) str2num(tline(k(2)+1:k(2)+5))]; end end end numberLineTabPixel= numberLineTabPixel+1; fclose (fileID); end end if isempty(pixel) pixel = [0 0]; end if size(pixel,1)>1 for j = 2:size(pixel,1) if abs(pixel(j-1,1)-pixel(j,1))>0.01 || abs(pixel(j-1,2)-pixel(j,2))>0.01 pixel(1,:)= 0; end end end pixel = pixel(1,:); end