clc; clear all; close all; st1='C:\BRATS19\Lessthan 300 days\BraTS19_2013_27_1\T2\'; G1='C:\BRATS19\Lessthan 300 days\BraTS19_2013_27_1\SEG\'; % G2='_2'; %2-core; 3-ET; st2='.tif'; mn=1045; mx=1119; % mx=1046; nm=(mx-mn)+1; hist_stats=zeros(nm,6); Glc_F=zeros(nm,22); GLRLM_Props=zeros(nm,11); i=1; for gi=mn:mx I = imread(strcat(st1,num2str(gi),st2)); GT=imread(strcat(G1,num2str(gi),st2)); n=size(I); Z=zeros(n(1),n(2)); Z=uint8(Z); Z1=zeros(n(1),n(2)); Z1=I;Z1(GT(:,:)==0)=255; % figure,imshow(Z1); Z(:,:)=Z1; [nRowMin, nColumnMin, nRowMax, nColumnMax] = BoundingBox (n(1), n(2), Z); Z2=Z(nRowMin:nRowMax, nColumnMin:nColumnMax); % figure,imshow(Z2); %% Histogram Features hist_stats(i,:)=chip_histogram_features(Z2); %% %%GLCM Features offsets = [0 1; -1 1; -1 0; -1 -1]; GLCM2 = graycomatrix(Z2,'NumLevels',8,'Offset',offsets); Glc_F(i,:) = GLCM_Features1_old(GLCM2); % stats % Glc_F(i,:)=[stats.autoc stats.contr stats.corrm stats.corrp]; %% % GLRLM Features GLRLM=grayrlmatrix(Z2); GLRLM_F=grayrlprops(GLRLM); GLRLM_F=GLRLM_F'; GLRLM_Props(i,:)=GLRLM_F; i=i+1; end fprintf('histo_statistics\n'); mean(hist_stats) fprintf('GLCM_statistics\n'); mean(Glc_F) fprintf('GLRLM_statistics\n'); mean(GLRLM_Props)