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

Typos

parent 8991a0ca
No related branches found
No related tags found
No related merge requests found
......@@ -236,7 +236,7 @@ namespace Melodic{
if(opts.debug.value())
save4D(alldat,"alldat");
//estimate model order
ColumnVector tmpPPCA;
Matrix tmpPPCA;
RowVector AdjEV, PercEV;
Matrix Corr, tmpE;
int order;
......@@ -446,6 +446,10 @@ namespace Melodic{
saveascii(mixFFT,opts.outputfname.value() + "_FTmix");
}
//Output PPCA
if(PPCA.Storage()>0)
saveascii(PPCA, opts.outputfname.value() + "_PPCA");
//Output ICstats
if(ICstats.Storage()>0)
saveascii(ICstats,opts.outputfname.value() + "_ICstats");
......
......@@ -158,8 +158,8 @@ namespace Melodic{
inline void set_EV(Matrix& Arg) {if(EV.Storage()==0)
EV = Arg;}
inline ColumnVector& get_PPCA() {return PPCA;}
inline void set_PPCA(ColumnVector& Arg) {if(PPCA.Storage()==0)
inline Matrix& get_PPCA() {return PPCA;}
inline void set_PPCA(Matrix& Arg) {if(PPCA.Storage()==0)
PPCA = Arg;}
inline Matrix& get_stdNoisei() {return stdNoisei;}
......@@ -225,7 +225,7 @@ namespace Melodic{
volume<float> background;
Matrix Data;
ColumnVector PPCA;
Matrix PPCA;
Matrix jointCC;
bool after_mm;
......
......@@ -497,7 +497,7 @@ namespace Melodic{
return Res;
} //RowVector cumsum
int ppca_dim(const Matrix& in, const Matrix& weights, ColumnVector& PPCA, RowVector& AdjEV, RowVector& PercEV, Matrix& Corr, Matrix& tmpE, RowVector &tmpD, float resels, string which)
int ppca_dim(const Matrix& in, const Matrix& weights, Matrix& PPCA, RowVector& AdjEV, RowVector& PercEV, Matrix& Corr, Matrix& tmpE, RowVector &tmpD, float resels, string which)
{
std_pca(in,weights,Corr,tmpE,tmpD);
......@@ -506,11 +506,14 @@ namespace Melodic{
adj_eigspec(tmpD.AsRow(),AdjEV,PercEV,NewEV,maxEV,in.Ncols(),resels);
int res;
PPCA = ppca_select(ppca_est(NewEV, in.Ncols(),resels), res, maxEV, which);
PPCA = ppca_est(NewEV, in.Ncols(),resels);
ColumnVector tmp = ppca_select(PPCA, res, maxEV, which);
PPCA = tmp | PPCA;
return res;
} //int ppca_dim
int ppca_dim(const Matrix& in, const Matrix& weights, ColumnVector& PPCA, RowVector& AdjEV, RowVector& PercEV, float resels, string which)
int ppca_dim(const Matrix& in, const Matrix& weights, Matrix& PPCA, RowVector& AdjEV, RowVector& PercEV, float resels, string which)
{
RowVector tmpD;
Matrix tmpE;
......@@ -528,17 +531,16 @@ namespace Melodic{
return res;
} //int ppca_dim
ColumnVector ppca_select(const Matrix& PPCAest, int& dim, int maxEV, string which)
ColumnVector ppca_select(Matrix& PPCAest, int& dim, int maxEV, string which)
{
RowVector estimators(5);
estimators = 1.0;
Matrix PPCA2(PPCAest);
for(int ctr=1; ctr<=PPCA2.Ncols(); ctr++){
PPCA2.Column(ctr) = (PPCA2.Column(ctr) -
min(PPCA2.Column(ctr)).AsScalar()) /
( max(PPCA2.Column(ctr)).AsScalar() -
min(PPCA2.Column(ctr)).AsScalar());
for(int ctr=1; ctr<=PPCAest.Ncols(); ctr++){
PPCAest.Column(ctr) = (PPCAest.Column(ctr) -
min(PPCAest.Column(ctr)).AsScalar()) /
( max(PPCAest.Column(ctr)).AsScalar() -
min(PPCAest.Column(ctr)).AsScalar());
}
int ctr_i = 1;
......@@ -568,30 +570,30 @@ namespace Melodic{
if(which == string("aut"))
if(int(estimators(2)) < int(estimators(1)) && int(estimators(2)) > 15){
res=int(estimators(2));
PPCA << PPCA2.Column(3);
PPCA << PPCAest.Column(3);
}else{
res = int(estimators(1));
PPCA << PPCA2.Column(2);
PPCA << PPCAest.Column(2);
}
if(which == string("lap")){
res = int(estimators(1));
PPCA << PPCA2.Column(2);
PPCA << PPCAest.Column(2);
}
if(which == string("bic")){
res = int(estimators(2));
PPCA << PPCA2.Column(3);
PPCA << PPCAest.Column(3);
}
if(which == string("mdl")){
res = int(estimators(3));
PPCA << PPCA2.Column(4);
PPCA << PPCAest.Column(4);
}
if(which == string("rrn")){
res = int(estimators(4));
PPCA << PPCA2.Column(5);
PPCA << PPCAest.Column(5);
}
if(which == string("aic")){
res = int(estimators(5));
PPCA << PPCA2.Column(6);
PPCA << PPCAest.Column(6);
}
if(which == string("median")){
RowVector unsorted(estimators);
......@@ -600,10 +602,10 @@ namespace Melodic{
res=int(unsorted(3));
while(res != int(estimators(ctr_i)))
ctr_i++;
PPCA << PPCA2.Column(ctr_i);
PPCA << PPCAest.Column(ctr_i);
}
if(res==0 || which == string("mean")){//median estimator
PPCA = mean(PPCA2.Columns(2,6),2);
PPCA = mean(PPCAest.Columns(2,6),2);
res=int(mean(estimators,2).AsScalar());
}
......
......@@ -59,10 +59,10 @@ namespace Melodic{
void adj_eigspec(const RowVector& in, RowVector& out1, RowVector& out2, RowVector& out3, int& out4, int num_vox, float resels);
void adj_eigspec(const RowVector& in, RowVector& out1, RowVector& out2);
int ppca_dim(const Matrix& in, const Matrix& weights, ColumnVector& PPCA, RowVector& AdjEV, RowVector& PercEV, Matrix& Corr, Matrix& tmpE, RowVector &tmpD, float resels, string which);
int ppca_dim(const Matrix& in, const Matrix& weights, ColumnVector& PPCA, RowVector& AdjEV, RowVector& PercEV, float resels, string which);
int ppca_dim(const Matrix& in, const Matrix& weights, Matrix& PPCA, RowVector& AdjEV, RowVector& PercEV, Matrix& Corr, Matrix& tmpE, RowVector &tmpD, float resels, string which);
int ppca_dim(const Matrix& in, const Matrix& weights, Matrix& PPCA, RowVector& AdjEV, RowVector& PercEV, float resels, string which);
int ppca_dim(const Matrix& in, const Matrix& weights, float resels, string which);
ColumnVector ppca_select(const Matrix& PPCAest, int& dim, int maxEV, string which);
ColumnVector ppca_select(Matrix& PPCAest, int& dim, int maxEV, string which);
Matrix ppca_est(const RowVector& eigenvalues, const int N1, const float N2);
Matrix ppca_est(const RowVector& eigenvalues, const int N);
......
......@@ -83,7 +83,9 @@ class MelodicOptions {
Option<float> tr;
Option<bool> logPower;
Option<bool> addsigchng;
Option<bool> allPPCA;
Option<bool> varplots;
Option<bool> varvals;
Option<string> fn_Tdesign;
Option<string> fn_Tcon;
......@@ -261,9 +263,15 @@ class MelodicOptions {
addsigchng(string("--sigchng"), false,
string("add signal change estimates to report pages\n"),
false, no_argument, false),
varplots(string("--varplots"), false,
string("add std error envelopes to time course plots\n"),
allPPCA(string("--allPPCA"), false,
string("add all PPCA plots\n"),
false, no_argument, false),
varplots(string("--varplots"), false,
string("add std error envelopes to time course plots\n"),
false, no_argument, false),
varvals(string("--varvals"), false,
string("add rank1 values after plots\n"),
false, no_argument, false),
fn_Tdesign(string("--Tdes"), string(""),
string(" design matrix across time-domain"),
false, requires_argument),
......@@ -396,7 +404,9 @@ class MelodicOptions {
options.add(tr);
options.add(logPower);
options.add(addsigchng);
options.add(allPPCA);
options.add(varplots);
options.add(varvals);
options.add(fn_Tdesign);
options.add(fn_Tcon);
options.add(fn_TconF);
......
......@@ -158,10 +158,10 @@ namespace Melodic{
IChtml << "<img BORDER=0 SRC=\""
+string("t")+num2str(cnum)+".png\"></A><p>" << endl;
// if(melodat.get_numfiles()>1 && melodat.explained_var.Storage()>0
// && melodat.explained_var.Ncols()>=cnum)
// IChtml << "Rank-1 approximation of individual time courses explains "
// << melodat.explained_var(cnum) << "% of variance.<p>" << endl;
if(melodat.get_numfiles()>1 && melodat.explained_var.Storage()>0
&& melodat.explained_var.Ncols()>=cnum && opts.varvals.value())
IChtml << "Rank-1 approximation of individual time courses explains "
<< melodat.explained_var(cnum) << "% of variance.<p>" << endl;
}//time series plot
if(!opts.pspec.value())
......@@ -756,8 +756,17 @@ namespace Melodic{
if(melodat.get_PPCA().Storage()>0){
what = what.Columns(1,melodat.get_PPCA().Nrows());
what &= melodat.get_PPCA().t();
newplot.add_label("dim. estimate");
if(opts.allPPCA.value()&&melodat.get_PPCA().Ncols()==7){
what &= melodat.get_PPCA().Columns(3,7).t();
newplot.add_label("Laplace");
newplot.add_label("BIC");
newplot.add_label("MDL");
newplot.add_label("RRN");
newplot.add_label("AIC");
}else{
what &= melodat.get_PPCA().Column(1).t();
newplot.add_label("dim. estimate");
}
}
newplot.set_Ylabel_fmt("%.2f");
......
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