function [pu,label]=nic_regional_fextr()
file1=nic_spm_get(inf,'img','Control');
file2=nic_spm_get(inf,'img','ADHD');

% name=file1(1,:);
% [data,head]=nic_Read_Image(name,'nifti1','Neurology');
% da=reshape(data,[],1);
% da(find(da<100))=0;
% da(find(da>100))=1;
% data=reshape(da,size(data));
% nic_Write_Image(data,head,'nifti1','D:\test\mask.img');

% leave-one-out regional feature extraction
[data,head]=nic_Read_Image('D:\test\mask.img','nifti1','Neurology');
mask=reshape(data,[],1);
pu=[];
label=[ones(1,size(file1,1)),-1*ones(1,size(file2,1))];
for i=1:size(file1,1)
    name=file1(i,:);
    [data,head]=nic_Read_Image(name,'nifti1','Neurology');
    dt=reshape(data,[],1);
    dt1=dt(find(mask)~=0);
    pu=[pu,dt1];
end

for i=1:size(file2,1)
    name=file2(i,:);
    [data,head]=nic_Read_Image(name,'nifti1','Neurology');
    dt=reshape(data,[],1);
    dt1=dt(find(mask)~=0);
    pu=[pu,dt1];
end
num=size(file1,1)+size(file2,1);
presult=zeros(size(pu,1),1);
for i=1:num % leave-one-out get the peason correlation 
    pd=pu;
    pd(:,i)=[];
    la=label;
    la(i)=[];
    avg=mean(pd,2);
    avgy=mean(la,2);
    gl=pd-repmat(avg,1,size(pd,2));
    avgy=(la-avgy)';
    N=size(pd,1);
    ptemp=[];
    for i=1:N
        s1=gl(i,:)'*gl(i,:);
        s2=avgy'*avgy;
        P=gl(i,:)'*avgy/(sqrt(s1*s2));
        if(size(find(P<ptemp(i,:)),2)>0),
           Presult(i)=P; 
        end
        ptemp=[ptemp;P];
    end    
end
