zoukankan      html  css  js  c++  java
  • 相关性分析代码片段2

    %% 参考BLOCK
    reference_stimulus =[
        0 0 0 0 0 0 0 0 0 0 ...
        1 1 1 1 1 1 1 1 1 1 ...
        0 0 0 0 0 0 0 0 0 0 ...
        1 1 1 1 1 1 1 1 1 1 ...
        0 0 0 0 0 0 0 0 0 0 ...
        1 1 1 1 1 1 1 1 1 1 ...
        0 0 0 0 0 0 0 0 0 0
    ];
    
    %% 原始数据
    datacell_4d   = load_untouch_nii('C:UsersAdministratorDesktopworkspacephycaa_plus_2104_03_27func_4d.nii'); 
    
    
    %% 两个数据,经过生理噪声预处理和未经过生理噪声预处理
    ldcca_tms = img_To_4D_array('C:UsersAdministratorDesktopcontrast2014-05-26-20-00.img');
    spm_tms = img_To_4D_array('C:UsersAdministratorDesktopcontrast
    o_phycaa.img');
    
    mask_ldcca_tms = ldcca_tms > 0;
    inv_mask_ldcca_tms = ~mask_ldcca_tms;
    
    mask_spm_tms = spm_tms > 0;
    inv_mask_spm_tms = ~mask_spm_tms;
    
    tmp_spm = spm_tms .* inv_mask_ldcca_tms;
    mask_big_left_spm_tms = tmp_spm>0;
    
    tmp_ldcca = ldcca_tms .* inv_mask_spm_tms;
    mask_big_left_ldcca_tms = tmp_ldcca > 0; 
    
    %% 被去除的体素
    ldim = size(datacell_4d.img);
    substruct_fullMsk = repmat( mask_big_left_spm_tms, [1,1,1,ldim(4)] );
    substruct_spm_tms_2d = reshape( datacell_4d.img(substruct_fullMsk>0), [], ldim(4) );
    
    %% 留下的体素集合
    left_fullMsk =  repmat( mask_spm_tms.*(~mask_big_left_spm_tms), [1,1,1,ldim(4)] );
    left_spm_tms_2d = reshape( datacell_4d.img(left_fullMsk>0), [], ldim(4) );
    
    %% 新增加的点集合
    add_fullMsk = repmat( mask_big_left_ldcca_tms, [1,1,1,ldim(4)] );
    add_spm_tms_2d = reshape( datacell_4d.img(add_fullMsk>0), [], ldim(4) );
    
    figure(2);
    
    % 统计被去除的点的相关系数,强度
    substruct_corr_spms=[];
    for i = 1:size(substruct_spm_tms_2d,1)
       
        substruct_corr_spms(i)= corr2(reference_stimulus' , substruct_spm_tms_2d(i,:)');
    
    end
    
    % plot(substruct_corr_spms,'Color','red');
    
    % hold on;
    
    % 统计增加的点的相关系数,强度
    add_corr_spms=[];
    for i = 1:size(add_spm_tms_2d,1)
        
        add_corr_spms(i)= corr2(reference_stimulus' , add_spm_tms_2d(i,:)');
    
    end
    
    % plot(add_corr_spms,'Color','black');
    % hold on;
    
    % 统计剩下的点的相关系数,强度
    left_corr_spms=[];
    for i = 1:size(left_spm_tms_2d,1)
        
        left_corr_spms(i)= corr2(reference_stimulus' , left_spm_tms_2d(i,:)');
    
    end
    
    % plot(left_corr_spms,'Color','blue');
    % hold on;
    
    
    figure(1);
    boxplot(substruct_corr_spms);
    figure(2);
    boxplot(add_corr_spms);
    figure(3);
    boxplot(left_corr_spms);
    

      

  • 相关阅读:
    CodeForces 219D Choosing Capital for Treeland (树形DP)
    POJ 3162 Walking Race (树的直径,单调队列)
    POJ 2152 Fire (树形DP,经典)
    POJ 1741 Tree (树的分治,树的重心)
    POJ 1655 Balancing Act (树的重心,常规)
    HDU 2196 Computer (树形DP)
    HDU 1520 Anniversary party (树形DP,入门)
    寒门子弟
    JQuery选择器(转)
    (四)Web应用开发---系统架构图
  • 原文地址:https://www.cnblogs.com/haore147/p/3795814.html
Copyright © 2011-2022 走看看