From fb8fc81b51da63630c1671e6bee2922580dd0bd4 Mon Sep 17 00:00:00 2001 From: Tim Behrens <behrens@fmrib.ox.ac.uk> Date: Fri, 10 Jun 2005 15:26:50 +0000 Subject: [PATCH] *** empty log message *** --- xfibres.cc | 44 +++++++++++++------------------------------- xfibresoptions.h | 4 ++-- 2 files changed, 15 insertions(+), 33 deletions(-) diff --git a/xfibres.cc b/xfibres.cc index b7784e4..57c1fa5 100644 --- a/xfibres.cc +++ b/xfibres.cc @@ -202,7 +202,7 @@ class xfibresVoxelManager{ Multifibre m_multifibre; public: xfibresVoxelManager(const ColumnVector& data,const ColumnVector& alpha, - const ColumnVector& beta, const Matrix& b, const Matrix& Amat, + const ColumnVector& beta, const Matrix& b, Samples& samples,int voxelnumber): opts(xfibresOptions::getInstance()), m_samples(samples),m_voxelnumber(voxelnumber),m_data(data), @@ -327,7 +327,7 @@ int main(int argc, char *argv[]) Matrix datam, bvals,bvecs; - volume<char> mask; + volume<float> mask; bvals=read_ascii_matrix(opts.bvalsfile.value()); bvecs=read_ascii_matrix(opts.bvecsfile.value()); @@ -338,40 +338,22 @@ int main(int argc, char *argv[]) datam=data.matrix(mask); } - Samples samples(datam.Ncols()); - - - //if(opts.debuglevel.value()==1) - //Tracer_Plus::setrunningstackon(); - - //if(opts.timingon.value()) - //Tracer_Plus::settimingon(); + Matrix Amat; + ColumnVector alpha, beta; + Amat=form_Amat(bvecs,bvals); + cart2sph(bvecs,alpha,beta); + Samples samples(datam.Ncols()); - // read data - - //VolumeSeries data; - //data.read(opts.datafile.value()); - // data.writeAsFloat(LogSingleton::getInstance().appendDir("data")); -// cout<<"done"<<endl; -// return 0; - //int ntpts = data.tsize(); - //Matrix bvecs = read_ascii_matrix(opts.bvecsfile.value()); - //Matrix bvals = read_ascii_matrix(opts.bvalsfile.value()); - // mask: - //Volume mask; - ///mask.read(opts.maskfile.value()); - //mask.threshold(1e-16); - // threshold using mask: - //data.setPreThresholdPositions(mask.getPreThresholdPositions()); - //data.thresholdSeries(); - ColumnVector A,B,C; + for(int vox=1;vox<=datam.Ncols();vox++){ + xfibresVoxelManager vm(datam.Column(vox),alpha,beta,bvals,samples,vox); + vm.initialise(Amat); + vm.runmcmc(); + } - Matrix b,Amat; - int n; + samples.save(); - Multifibre(A,B,C,b,n); } catch(Exception& e) { diff --git a/xfibresoptions.h b/xfibresoptions.h index 57ec3e7..a8a4aa6 100644 --- a/xfibresoptions.h +++ b/xfibresoptions.h @@ -41,7 +41,7 @@ class xfibresOptions { Option<int> nburn; Option<int> sampleevery; Option<int> updateproposalevery; - Option<float> seed; + Option<int> seed; void parse_command_line(int argc, char** argv, Log& logger); private: @@ -103,7 +103,7 @@ class xfibresOptions { updateproposalevery(string("--upe,--updateproposalevery"),40, string("Num of jumps for each update to the proposal density std (MCMC) (default is 40)"), false,requires_argument), - seed(string("--seed"),0.76986654,string("seed for pseudo random number generator"), + seed(string("--seed"),8665904,string("seed for pseudo random number generator"), false,requires_argument), options("xfibres", "xfibres -k <filename>\n xfibres --verbose\n") { -- GitLab