⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mfbox_pos_denoise_run.m

📁 toolbox for spm 5 for data, model free analysis
💻 M
字号:
function [A,W,S,params,reliability]=mfbox_pos_denoise_run(A,W,S,X,params,runflag)% denoise result%% Usage:%  [A,W,S,params,reliability]=mfbox_pos_denoise_run(A,W,S,X,params,runflag)%%  X           - cell with%                (NxT) data%                (Tx3) grid%                timeline%                mask%                design%                reference%  A           - (TxD) mixing matrix%  W           - (DxT) demixing matrix%  S           - struct with%                dat              - (MxD) components (M<=N unique datapoints)%                mask             - mask selecting unique subset of grid%                part             - cell array containing the different parts %                                   of the analysis%                map              - (TxC) maps (timestep,component) to element in%                                   1...D (D>=C)%                spatialnoisevar  - (Mx1) spatial variance of the noise%                temporalnoisevar - (Tx1) temporal variance of the noise%                names            - (Cx1) cell with names%  params      - struct with%                tempdelaydim - temporal delay dimension%                tempclusters - temporal number of clusters%                tempstepsize - temporal step size%                tempmethod   - ica%                               pca%                spatdelaydim - spatial elay dimension%                spatclusters - spatial number of clusters%                spatstepsize - spatial step size%                spatmethod   - ica%                               pca%                method       - actions to perform (method(1): temporal,%                               method(2): spatial)%  reliability - struct%  runflag     - -1 get default parameter%                 0 interactive ask parameters%                 1 interactive ask parameters and run%                 2 run%% Copyright by Peter Gruber and Fabian J. Theis% Signal Processing & Information Theory group% Institute of Biophysics, University of Regensburg, Germany% Homepage: http://research.fabian.theis.name%           http://www-aglang.uni-regensburg.de%% This file is free software, subject to the % GNU GENERAL PUBLIC LICENSE, see gpl.txterror(nargchk(3,6,nargin));error(nargchk(1,5,nargout));if (nargin<4), X = []; endif (nargin<5), params = []; endif (nargin<6), runflag = 1; ends = size(S.dat);dim = s(1:(end-1));n = size(S.map,2);timesteps = size(A,1);params = mfbox_checkparam(params,'pos','denoise', ...    struct('tempdelaydim',30,'tempclusters',1, ...    'tempstepsize',1,'tempmethod','ica','spatdelaydim',10, ...    'spatclusters',10,'spatstepsize',2,'spatmethod','pca','method',[1,1]));reliability = struct();if (abs(runflag-0.5)<1)    if (exist('OCTAVE_HOME')~=5)% matlab        params = mfbox_pos_denoiseg(A,W,S,X,params);    endendif (runflag>0 && isstruct(params))    switch params.tempmethod        case 'ica'            redm = 'pearsonica';            sortm = 'comb';            rep = 3.5;        case 'pca'            redm = 'pca';            sortm = 'var';            rep = 2.5;    end    if (params.method(1)==1)        A = reshape(mfbox_denoise(reshape(A,1,[]), ...            params.tempdelaydim,params.tempclusters,params.tempstepsize, ...            'kmeans',redm,'avg',sortm,'mdl',32,rep),size(A));    end    switch params.spatmethod        case 'ica'            redm = 'pearsonica';            sortm = 'comb';            rep = 1;        case 'pca'            redm = 'pca';            sortm = 'var';            rep = 1;    end    if (params.method(2)==1)        for j=1:size(S.dat,2)            grid = X{2};            grid = grid(:,S.mask);            tS = reshape(mfbox_denoise({S.dat,grid},params.spatdelaydim, ...                params.spatclusters,params.spatstepsize, ...                'kmeans',redm,'avg',sortm,'mdl',32,rep),[],1);            S.dat(:,j) = tS(S.mask);        end    endend

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -