Skip to content
Snippets Groups Projects
glimGls.h 1.28 KiB
Newer Older
Stephen Smith's avatar
Stephen Smith committed
/*  glimGls.h

    Mark Woolrich, FMRIB Image Analysis Group

    Copyright (C) 1999-2000 University of Oxford  */

Stephen Smith's avatar
Stephen Smith committed
/*  CCOPYRIGHT  */
Stephen Smith's avatar
Stephen Smith committed

Mark Woolrich's avatar
Mark Woolrich committed
#if !defined(__glimgls_h)
#define __glimgls_h

Stephen Smith's avatar
Stephen Smith committed
#define WANT_STREAM
#define WANT_MATH

#include "newmat/newmatap.h"
#include "newmat/newmatio.h"
Stephen Smith's avatar
Stephen Smith committed
#include "Volume.h"
#include "VolumeSeries.h"

using namespace NEWMAT;

Mark Woolrich's avatar
Mark Woolrich committed
namespace FILM {
Stephen Smith's avatar
Stephen Smith committed

#define BATCHSIZE 50

  class GlimGls
    {
    public:
      GlimGls(const int pnumTS, const int psizeTS, const int pnumParams) : 
	numTS(pnumTS),
	sizeTS(psizeTS),
	numParams(pnumParams),
Mark Woolrich's avatar
Mark Woolrich committed
	corrections(numParams*numParams,numTS),
Stephen Smith's avatar
Stephen Smith committed
	b(numParams, numTS),
	sigmaSquareds(numTS),
	dof(sizeTS - numParams)
	{}
     
      void setData(const ColumnVector& p_y, const Matrix& p_x, const int ind);       
      void Save(const VolumeSeries::Dims& pdims, const ColumnVector& prethreshpos);
Mark Woolrich's avatar
Mark Woolrich committed
      ColumnVector& getResiduals() { return r; }
      void CleanUp();
Stephen Smith's avatar
Stephen Smith committed

    private:

      void SetCorrection(const Matrix& corr, const int ind);

      GlimGls(const GlimGls&);
      GlimGls& operator=(const GlimGls& p_glimgls);
   
      int numTS;
      int sizeTS;
      int numParams;

      // Data to be saved:
Mark Woolrich's avatar
Mark Woolrich committed
      VolumeSeries corrections;
Stephen Smith's avatar
Stephen Smith committed
      Matrix b;
      Volume sigmaSquareds;
      float dof;
Mark Woolrich's avatar
Mark Woolrich committed
      ColumnVector r;
Stephen Smith's avatar
Stephen Smith committed
    };