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

/*  Part of FSL - FMRIB's Software Library
    WWW:      http://www.fmrib.ox.ac.uk/fsl
    Email:    fsl@fmrib.ox.ac.uk
    
    Developed at FMRIB (Oxford Centre for Functional Magnetic Resonance
    Imaging of the Brain), Department of Clinical Neurology, Oxford
    University, Oxford, UK
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
(at
    your option) any later version.
    
    This program is distributed in the hope that it will be useful, but
in
    order that the University as a charitable foundation protects its
    assets for the benefit of its educational and research purposes, the
    University makes clear that no condition is made or to be implied,
nor
    is any warranty given or to be implied, as to the accuracy of FSL,
or
    that it will be suitable for any particular purpose or for use under
    any specific conditions.  Furthermore, the University disclaims all
    responsibility for the use which is made of FSL.  See the GNU
General
    Public License for more details.
    
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
    USA */

#include <iostream>
#include <fstream>
#define WANT_STREAM
#define WANT_MATH

#include "newmatap.h"
#include "newmatio.h"
#include "Volume.h"
#include "VolumeSeries.h"

#ifndef NO_NAMESPACE
using namespace NEWMAT;
using namespace TACO;
namespace SIGPROC {
#endif

#if !defined(__glimgls_h)
#define __glimgls_h

#define BATCHSIZE 50

  class GlimGls
    {
    public:
      GlimGls(const int pnumTS, const int psizeTS, const int pnumParams) : 
	numTS(pnumTS),
	sizeTS(psizeTS),
	numParams(pnumParams),
	corrections(numTS, numParams*numParams),
	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);

    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:
      Matrix corrections;
      Matrix b;
      Volume sigmaSquareds;
      float dof;
    };


#ifndef NO_NAMESPACE
       }
#endif

#endif