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

Concat for unequal number of volumes

parent 82c179f9
No related branches found
No related tags found
No related merge requests found
......@@ -139,10 +139,13 @@ namespace Melodic{
void MelodicData::set_TSmode()
{
Matrix tmp, tmpT, tmpS, tmpT2, tmpS2, tmpT3;
tmp = expand_dimred(mixMatrix);
tmpT = zeros(tmp.Nrows()/numfiles, tmp.Ncols());
tmpS = zeros(numfiles, tmp.Ncols());
explained_var = krfact(tmp,tmpT,tmpS);
if(opts.approach.value()==string("tica")){
explained_var = krfact(tmp,tmpT,tmpS);
outMsize("tmp",tmp);
outMsize("tmpT",tmpT);
outMsize("tmpS",tmpS);
......@@ -164,7 +167,7 @@ namespace Melodic{
add_Smodes(tmpS2);
}
// }
//add GLM OLS fit
if(Tdes.Storage()){
Matrix alltcs = Tmodes.at(0).Column(1);
......@@ -180,6 +183,14 @@ namespace Melodic{
if((alltcs.Nrows()==Sdes.Nrows())&&(Sdes.Nrows()>Sdes.Ncols()&&alltcs.Nrows()>2))
glmS.olsfit(alltcs,Sdes,Scon);
}
}
// else{
// add_Tmodes(tmp);
// }
dbgmsg(string("END: set_TSmode"));
}
void MelodicData::setup()
......
......@@ -76,20 +76,24 @@ namespace Melodic{
inline Matrix& get_Smodes(int what) {return Smodes.at(what);}
inline void add_Smodes(Matrix& Arg) {Smodes.push_back(Arg);}
inline void save_Smodes(){
if(Smodes.size()>0){
Matrix tmp = Smodes.at(0);
for(unsigned int ctr = 1; ctr < Smodes.size(); ctr++)
tmp |= Smodes.at(ctr);
saveascii(tmp,opts.outputfname.value() + "_Smodes");
}
}
inline vector<Matrix>& get_Tmodes() {return Tmodes;}
inline Matrix& get_Tmodes(int what) {return Tmodes.at(what);}
inline void add_Tmodes(Matrix& Arg) {Tmodes.push_back(Arg);}
inline void save_Tmodes(){
if(Tmodes.size()>0){
Matrix tmp = Tmodes.at(0);
for(unsigned int ctr = 1; ctr < Tmodes.size(); ctr++)
tmp |= Tmodes.at(ctr);
saveascii(tmp,opts.outputfname.value() + "_Tmodes");
}
}
void set_TSmode();
......
......@@ -331,9 +331,9 @@ Matrix mmall(Log& logger, MelodicOptions& opts,MelodicData& melodat, MelodicRepo
message(" saving probability map: ");
melodat.save4D(mixmod.get_probmap(),
string("stats/probmap_")+num2str(ctr));
%% message(" saving mixture model fit:");
%% melodat.saveascii(mixmod.get_params(),
%% string("stats/MMstats_")+num2str(ctr));
message(" saving mixture model fit:");
melodat.saveascii(mixmod.get_params(),
string("stats/MMstats_")+num2str(ctr));
}
//re-scale spatial maps to mean 0 for nht
......
......@@ -770,6 +770,7 @@ namespace Melodic{
}
void MelodicReport::Smode_rep(){
if(melodat.get_Smodes().size()>0){
report << "<p><hr><b>TICA Subject/Session modes </b> <br>" << endl;
miscplot newplot;
report << "Boxplots show the relative response amplitudes across the "
......@@ -789,5 +790,6 @@ namespace Melodic{
newplot.boxplot(allmodes,report.appendDir(string("bp_Smodes.png")),
string("Subject/Session modes"));
report << "<img BORDER=0 SRC=\"bp_Smodes.png\"><p>" << endl;
}
}
}
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