indii/fmri/model/SingleSeedModel.hpp

00001 #ifndef INDII_FMRI_MODEL_SINGLESEEDMODEL_HPP
00002 #define INDII_FMRI_MODEL_SINGLESEEDMODEL_HPP
00003 
00004 #include "../hemodynamic/LogNeuralBalloonModel.hpp"
00005 #include "../hemodynamic/LogBOLDCalculator.hpp"
00006 
00007 #include "indii/ml/ode/AdaptiveRungeKutta.hpp"
00008 #include "indii/ml/filter/UnscentedKalmanFilterModel.hpp"
00009 #include "indii/ml/aux/vector.hpp"
00010 #include "indii/ml/aux/GaussianPdf.hpp"
00011 
00012 namespace indii {
00013   namespace fmri {
00014     namespace model {
00015 
00016 /**
00017  * Single seed time-series %model. May be used to filter a BOLD signal
00018  * to obtain an estimate of the underlying %neural activity.
00019  *
00020  *
00021  * @author Lawrence Murray <lawrence@indii.org>
00022  * @version $Rev: 309 $
00023  * @date $Date: 2007-10-03 14:16:40 +0100 (Wed, 03 Oct 2007) $
00024  *
00025  * Uses indii::fmri::hemodynamic::LogNeuralBalloonModel for state
00026  * transitions and indii::fmri::hemodynamic::LogBOLDCalculator for
00027  * predicted measurements. Works in log space to ensure that sigma
00028  * points sampled by the unscented Kalman filter are always positive
00029  * for \f$q\f$, \f$v\f$ and \f$f\f$.
00030  */
00031 class SingleSeedModel :
00032     public indii::ml::filter::UnscentedKalmanFilterModel<double> {
00033 public:
00034   /**
00035    * Indices for state variables in vectors.
00036    */
00037   enum SeedVariables {
00038     LN_Q,
00039     LN_V,
00040     LN_F,
00041     S,
00042     U,
00043     B,
00044     SEED_SIZE
00045   };
00046 
00047   /**
00048    * Constructor.
00049    *
00050    * @param M Number of sessions used for measurement.
00051    */
00052   SingleSeedModel(unsigned int M);
00053 
00054   /**
00055    * Destructor.
00056    */
00057   virtual ~SingleSeedModel();
00058 
00059   /**
00060    * @see indii::ml::model::UnscentedKalmanFilterModel
00061    */
00062   virtual indii::ml::aux::vector transition(const indii::ml::aux::vector &x,
00063       const indii::ml::aux::vector &w, double delta);
00064 
00065   /**
00066    * @see indii::ml::model::UnscentedKalmanFilterModel
00067    */
00068   virtual indii::ml::aux::vector measure(const indii::ml::aux::vector &x,
00069       const indii::ml::aux::vector &v);
00070 
00071   /**
00072    * Calculate a suggested prior over the initial state of the system.
00073    * 
00074    * @return Suggested prior over the initial state of the system.
00075    */
00076   indii::ml::aux::GaussianPdf suggestPrior();
00077 
00078   /**
00079    * Calculate a suggested system noise structure.
00080    * 
00081    * @return Suggested system noise.
00082    */
00083   indii::ml::aux::GaussianPdf suggestSystemNoise();
00084 
00085   /**
00086    * Calculate a suggested measurement noise structure.
00087    * 
00088    * @return Suggested measurement noise.
00089    */
00090   indii::ml::aux::GaussianPdf suggestMeasurementNoise();
00091 
00092 private:
00093   /**
00094    * Number of sessions used for measurement.
00095    */
00096   unsigned int M;
00097 
00098   /**
00099    * Balloon model for transition function.
00100    */
00101   indii::fmri::hemodynamic::LogNeuralBalloonModel balloon;
00102 
00103   /**
00104    * Runge--Kutta for transition function.
00105    */
00106   indii::ml::ode::AdaptiveRungeKutta ode;
00107 
00108   /**
00109    * BOLD calculator for measurement function.
00110    */
00111   indii::fmri::hemodynamic::LogBOLDCalculator bold;
00112 
00113 };
00114 
00115     }
00116   }
00117 }
00118 
00119 #endif

Generated on Tue Oct 9 22:02:07 2007 for fmrii fMRI Modelling Library by  doxygen 1.5.2