Skip to content
Snippets Groups Projects
Commit 8ed3011f authored by Tim Behrens's avatar Tim Behrens
Browse files

*** empty log message ***

parent a5af5dc6
No related branches found
No related tags found
No related merge requests found
......@@ -222,11 +222,15 @@ namespace FIBRE{
return true;
else{
//m_f_prior=-(log(m_lam) + (m_lam-1)*log(1-m_f));
if(m_lam_jump)
m_f_prior=log(1-m_f)+2*log(fabs(log(1-m_f))); //marginalised with uniform prior on lambda
else
if(opts.no_ard.value()){
m_f_prior=0;
}
else{
if(m_lam_jump)
m_f_prior=log(1-m_f)+2*log(fabs(log(1-m_f))); //marginalised with uniform prior on lambda
else
m_f_prior=0;
}
m_f_prior=opts.fudge.value()*m_f_prior;
return false;
}
......@@ -459,7 +463,9 @@ namespace FIBRE{
inline float get_d() const{ return m_d;}
inline void set_d(const float d){ m_d=d; }
inline float get_energy() const { return m_likelihood_en+m_prior_en;}
inline float get_likelihood_energy() const { return m_likelihood_en;}
inline float get_S0() const{ return m_S0;}
inline void set_S0(const float S0){ m_S0=S0; }
......
......@@ -127,6 +127,7 @@ class Samples{
xfibresOptions& opts;
Matrix m_dsamples;
Matrix m_S0samples;
Matrix m_lik_energy;
vector<Matrix> m_thsamples;
vector<Matrix> m_phsamples;
vector<Matrix> m_fsamples;
......@@ -149,6 +150,7 @@ public:
m_dsamples=0;
m_S0samples.ReSize(nsamples,nvoxels);
m_S0samples=0;
m_lik_energy.ReSize(nsamples,nvoxels);
for(int f=0;f<opts.nfibres.value();f++){
m_thsamples.push_back(m_S0samples);
......@@ -164,6 +166,7 @@ public:
void record(Multifibre& mfib, int vox, int samp){
m_dsamples(samp,vox)=mfib.get_d();
m_S0samples(samp,vox)=mfib.get_S0();
m_lik_energy(samp,vox)=mfib.get_likelihood_energy();
for(int f=0;f<opts.nfibres.value();f++){
m_thsamples[f](samp,vox)=mfib.fibres()[f].get_th();
m_phsamples[f](samp,vox)=mfib.fibres()[f].get_ph();
......@@ -181,12 +184,14 @@ public:
vector<Matrix> phsamples_out=m_phsamples;
vector<Matrix> fsamples_out=m_fsamples;
vector<Matrix> lamsamples_out=m_lamsamples;
Log& logger = LogSingleton::getInstance();
tmp.setmatrix(m_dsamples,mask);
save_volume4D(tmp,logger.appendDir("dsamples"));
tmp.setmatrix(m_S0samples,mask);
save_volume4D(tmp,logger.appendDir("S0samples"));
tmp.setmatrix(m_lik_energy,mask);
save_volume4D(tmp,logger.appendDir("lik_energy"));
//Sort the output based on mean_fsamples
//
......
......@@ -42,6 +42,7 @@ class xfibresOptions {
Option<int> sampleevery;
Option<int> updateproposalevery;
Option<int> seed;
Option<bool> no_ard;
void parse_command_line(int argc, char** argv, Log& logger);
private:
......@@ -105,6 +106,8 @@ class xfibresOptions {
false,requires_argument),
seed(string("--seed"),8665904,string("seed for pseudo random number generator"),
false,requires_argument),
no_ard(string("--noard"),false,string("Turn ARD off on all fibres"),
false,no_argument),
options("xfibres", "xfibres -k <filename>\n xfibres --verbose\n")
{
......@@ -125,6 +128,7 @@ class xfibresOptions {
options.add(sampleevery);
options.add(updateproposalevery);
options.add(seed);
options.add(no_ard);
}
catch(X_OptionError& e) {
......
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