Skip to content
Snippets Groups Projects
Commit de99cec1 authored by Christian Beckmann's avatar Christian Beckmann
Browse files

added support for the modified PCA in concat mode

parent 0194bf47
No related branches found
No related tags found
No related merge requests found
...@@ -303,11 +303,22 @@ namespace Melodic{ ...@@ -303,11 +303,22 @@ namespace Melodic{
std_pca(tmpData, RXweight, Corr, pcaE, pcaD); std_pca(tmpData, RXweight, Corr, pcaE, pcaD);
calc_white(pcaE, pcaD, order, newWM, newDWM); calc_white(pcaE, pcaD, order, newWM, newDWM);
}else{ }else{
std_pca(whiteMatrix*tmpData, RXweight, Corr, pcaE, pcaD); if(!opts.dr_pca.value()){
calc_white(pcaE, pcaD, order, newWM, newDWM); std_pca(whiteMatrix*tmpData, RXweight, Corr, pcaE, pcaD);
newDWM=(dewhiteMatrix*newDWM); calc_white(pcaE, pcaD, order, newWM, newDWM);
newWM=(newWM*whiteMatrix); 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); DWM.push_back(newDWM);
WM.push_back(newWM); WM.push_back(newWM);
tmpData = newWM * tmpData; tmpData = newWM * tmpData;
......
...@@ -55,7 +55,8 @@ class MelodicOptions { ...@@ -55,7 +55,8 @@ class MelodicOptions {
Option<string> pca_est; Option<string> pca_est;
Option<bool> joined_whiten; Option<bool> joined_whiten;
Option<bool> joined_vn; Option<bool> joined_vn;
Option<float> vn_level; Option<bool> dr_pca;
Option<float> vn_level;
Option<int> numICs; Option<int> numICs;
Option<string> approach; Option<string> approach;
Option<string> nonlinearity; Option<string> nonlinearity;
...@@ -191,6 +192,9 @@ class MelodicOptions { ...@@ -191,6 +192,9 @@ class MelodicOptions {
joined_vn(string("--sep_vn"), true, joined_vn(string("--sep_vn"), true,
string("switch off joined variance nomalisation"), string("switch off joined variance nomalisation"),
false, no_argument), 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), vn_level(string("--vn_level"), float(2.3),
string("variance nomalisation threshold level (Z> value is ignored)"), string("variance nomalisation threshold level (Z> value is ignored)"),
false, requires_argument, false), false, requires_argument, false),
...@@ -391,6 +395,7 @@ class MelodicOptions { ...@@ -391,6 +395,7 @@ class MelodicOptions {
options.add(pca_est); options.add(pca_est);
options.add(joined_whiten); options.add(joined_whiten);
options.add(joined_vn); options.add(joined_vn);
options.add(dr_pca);
options.add(vn_level); options.add(vn_level);
options.add(numICs); options.add(numICs);
options.add(approach); options.add(approach);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment