function [loc]=local_first_second_order(volume_seg,volume_ori,z,maxv)
se=strel('square',5);
volume_segn=imerode(volume_seg,se);
volume_segn0=zeros(size(volume_seg));
volume_segn0(1:2:size(volume_seg,1),1:2:size(volume_seg,2))=1;
volume_segn=volume_segn.*volume_segn0;
[x1,y1]=find(volume_segn==1);
%
x1=x1(1:25:length(x1));
y1=y1(1:25:length(y1));
%
if length(x1)<=0
    error('区域过小');
end

parfor j1=1:1:length(x1)
    vvt=volume_ori(x1(j1)-2:x1(j1)+2,y1(j1)-2:y1(j1)+2);
    
    vvt1=vvt(:);
    volume_max=max(vvt1);
    volume_min=min(vvt1);
    volume_hist=hist(vvt1,(volume_max-volume_min+1));
    volume_pixelnum=size(vvt1,1);
    log_resdue=0.000001;
    volume_hist_log2=log2(volume_hist+log_resdue);
    
    mean(j1) = sum(vvt1)/volume_pixelnum;
    energy(j1) = sum(vvt1.^2);
    entropy(j1) = sum(volume_hist.*volume_hist_log2);
    standard_deviation(j1) = sqrt(sum((vvt1-ones(volume_pixelnum,1).*mean(j1)).^2)/(volume_pixelnum-1));
    skewness(j1) = (sum((vvt1-ones(volume_pixelnum,1).*mean(j1)).^3)/volume_pixelnum)...
        /power(sqrt(sum((vvt1-ones(volume_pixelnum,1).*mean(j1)).^2)/volume_pixelnum),3);%%
    krutosis(j1) = (sum((vvt1-ones(volume_pixelnum,1).*mean(j1)).^4)/volume_pixelnum)...
        /(sum((vvt1-ones(volume_pixelnum,1).*mean(j1)).^2)/volume_pixelnum).^2;%%
    maximum = max(vvt1);
    mean_absulute_deviation(j1) =sum(abs(vvt1-ones(volume_pixelnum,1).*mean(j1)))/volume_pixelnum;
    minimum = min(vvt1);
    range(j1) =maximum-minimum;
    root_mean_square(j1) = sqrt(sum(vvt1.^2)/volume_pixelnum);
    
    ft=get_GLCM1(vvt,100,maxv,1);
    energy1(j1)=ft.energy;
    entropy1(j1)=ft.entropy;
    correlation1(j1)=ft.correlation;
    homogeneity1(j1)=ft.homogeneity1;
    contrast1(j1)=ft.contrast;
    cluster_tendency1(j1)=ft.cluster_tendency;
    autocorrelation1(j1)=ft.autocorrelation;
end

for j1=1:1:length(z)
    loc(j1).mean1=prctile(mean,z(j1));
    loc(j1).energy1=prctile(energy,z(j1));
    loc(j1).entropy1=prctile(entropy,z(j1));
    loc(j1).standard_deviation1=prctile(standard_deviation,z(j1));
    loc(j1).skewness1=prctile(skewness,z(j1));
    loc(j1).krutosis1=prctile(krutosis,z(j1));
    loc(j1).mean_absulute_deviation1=prctile(mean_absulute_deviation,z(j1));
    loc(j1).range1=prctile(range,z(j1));
    loc(j1).root_mean_square1=prctile(root_mean_square,z(j1));
    
    loc(j1).energy2=prctile(energy1,z(j1));
    loc(j1).entropy2=prctile(entropy1,z(j1));
    loc(j1).correlation2=prctile(correlation1,z(j1));
    loc(j1).homogeneity2=prctile(homogeneity1,z(j1));
    loc(j1).contrast2=prctile(contrast1,z(j1));
    loc(j1).cluster_tendency2=prctile(cluster_tendency1,z(j1));
    loc(j1).autocorrelation2=prctile(autocorrelation1,z(j1));
end