From de99cec1fa1d3123ef25cf9a00675638bc065f63 Mon Sep 17 00:00:00 2001 From: Christian Beckmann <c.beckmann@donders.ru.nl> Date: Mon, 2 Nov 2009 22:32:38 +0000 Subject: [PATCH] added support for the modified PCA in concat mode --- meldata.cc | 21 ++++++++++++++++----- meloptions.h | 7 ++++++- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/meldata.cc b/meldata.cc index a00f698..0df217d 100644 --- a/meldata.cc +++ b/meldata.cc @@ -303,11 +303,22 @@ namespace Melodic{ std_pca(tmpData, RXweight, Corr, pcaE, pcaD); calc_white(pcaE, pcaD, order, newWM, newDWM); }else{ - std_pca(whiteMatrix*tmpData, RXweight, Corr, pcaE, pcaD); - calc_white(pcaE, pcaD, order, newWM, newDWM); - newDWM=(dewhiteMatrix*newDWM); - newWM=(newWM*whiteMatrix); - } + if(!opts.dr_pca.value()){ + std_pca(whiteMatrix*tmpData, RXweight, Corr, pcaE, pcaD); + calc_white(pcaE, pcaD, order, newWM, newDWM); + newDWM=(dewhiteMatrix*newDWM); + newWM=(newWM*whiteMatrix); + } + else{ + Matrix tmp1, tmp2; + tmp1 = whiteMatrix * alldat; + tmp1 = remmean(tmp1,2) * tmpData.t(); + tmp2 = pinv(tmp1); + std_pca(tmp1 * tmpData, RXweight, Corr, pcaE, pcaD); + calc_white(pcaE, pcaD, order, newWM, newDWM); + newDWM=(tmp2*newDWM); + newWM=(newWM * tmp1); + } DWM.push_back(newDWM); WM.push_back(newWM); tmpData = newWM * tmpData; diff --git a/meloptions.h b/meloptions.h index ba86f82..722b81d 100644 --- a/meloptions.h +++ b/meloptions.h @@ -55,7 +55,8 @@ class MelodicOptions { Option<string> pca_est; Option<bool> joined_whiten; Option<bool> joined_vn; - Option<float> vn_level; + Option<bool> dr_pca; + Option<float> vn_level; Option<int> numICs; Option<string> approach; Option<string> nonlinearity; @@ -191,6 +192,9 @@ class MelodicOptions { joined_vn(string("--sep_vn"), true, string("switch off joined variance nomalisation"), false, no_argument), + dr_pca(string("--mod_pca"), false, + string("switch on modified PCA for concat ICA"), + false, no_argument, false), vn_level(string("--vn_level"), float(2.3), string("variance nomalisation threshold level (Z> value is ignored)"), false, requires_argument, false), @@ -391,6 +395,7 @@ class MelodicOptions { options.add(pca_est); options.add(joined_whiten); options.add(joined_vn); + options.add(dr_pca); options.add(vn_level); options.add(numICs); options.add(approach); -- GitLab