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

changed first EIgenvariate to be positively correlated with mean

parent 1fbb0b8d
No related branches found
No related tags found
No related merge requests found
......@@ -62,7 +62,10 @@ using namespace std;
false, no_argument);
Option<int> tc_order(string("--order"), 1,
string(" number of Eigenvariates (default 1)"),
false, requires_argument);
false, requires_argument);
Option<bool> abscc(string("--abscc"), false,
string(" use maximum absolute value instead of of maximum value of the cross-correlations"),
false, no_argument);
Option<bool> out_seeds(string("--out_seeds"), false,
string("output seed mask image as <basename>_seeds"),
false, no_argument);
......@@ -291,6 +294,18 @@ ReturnMatrix calc_ttc(volume<float>& in){
DiagonalMatrix tmpD;
EigenValues(Corr,tmpD,res);
res = fliplr(res.Columns(res.Ncols()-tc_order.value()+1 , res.Ncols())) * std::sqrt(tmp.Nrows());
Matrix res2 = mean(tmp,2);
if(debug.value())
cerr << "DBG: mean size is " << res2.Nrows() << " x " << res2.Ncols() << endl;
res2 = res2.Column(1).t() * res.Column(1);
if((float)res2.AsScalar() < 0){
res = -1.0 * res;
if(debug.value())
cerr << "DBG: flipping first eigenvariates" << endl;
}
}
if(debug.value())
......@@ -409,8 +424,14 @@ void calc_res(){
out1.Row(ctr+1) = calc_tcorr(ctr);
for(int ctr = 1 ;ctr <= out1.Ncols(); ctr++){
out1.Column(ctr).Maximum1(tmp2);
out2(1,ctr) = tmp2;
if(!abscc.value()){
out1.Column(ctr).Maximum1(tmp2);
out2(1,ctr) = tmp2;
}else
{
out1.Column(ctr).MaximumAbsoluteValue1(tmp2);
out2(1,ctr) = tmp2;
}
}
if(debug.value()){
......@@ -515,6 +536,7 @@ int main(int argc,char *argv[]){
options.add(fnseeddata);
options.add(map_bin);
options.add(tc_mean);
options.add(abscc);
options.add(tc_order);
options.add(out_seeds);
options.add(out_seedmask);
......
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