Skip to content
Snippets Groups Projects
glimGls.h 1.29 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

#include <iostream>
#include <fstream>
Stephen Smith's avatar
Stephen Smith committed
#define WANT_STREAM
#define WANT_MATH

David Flitney's avatar
David Flitney committed
#include "miscmaths/volume.h"
#include "miscmaths/volumeseries.h"
#include "newimage/newimageall.h"
Stephen Smith's avatar
Stephen Smith committed

using namespace NEWMAT;
David Flitney's avatar
David Flitney committed
using namespace MISCMATHS;
using namespace NEWIMAGE;
Stephen Smith's avatar
Stephen Smith committed

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

#define BATCHSIZE 50

  class GlimGls
    {
    public:
Mark Woolrich's avatar
Mark Woolrich committed
      GlimGls(const int pnumTS, const int psizeTS, const int pnumParams);
Stephen Smith's avatar
Stephen Smith committed
     
      void setData(const ColumnVector& p_y, const Matrix& p_x, const int ind);       
David Flitney's avatar
David Flitney committed
      void Save(const VolumeInfo& volinfo, const ColumnVector& prethreshpos);
      void Save(volumeinfo& vinfo, const volume<float>& mask,const float reftdim);
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:
Stephen Smith's avatar
Stephen Smith committed
      Matrix b;
      RowVector sigmaSquareds;
Stephen Smith's avatar
Stephen Smith committed
      float dof;
Mark Woolrich's avatar
Mark Woolrich committed
      ColumnVector r;
Mark Woolrich's avatar
Mark Woolrich committed

      DiagonalMatrix I;
Stephen Smith's avatar
Stephen Smith committed
    };