Skip to content
Snippets Groups Projects
Commit 830f1051 authored by David Flitney's avatar David Flitney
Browse files

*** empty log message ***

parent 5b0718ea
No related branches found
No related tags found
No related merge requests found
...@@ -4,33 +4,7 @@ ...@@ -4,33 +4,7 @@
Copyright (C) 1999-2000 University of Oxford */ Copyright (C) 1999-2000 University of Oxford */
/* Part of FSL - FMRIB's Software Library /* CCOPYRIGHT */
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 <iostream>
#include <strstream> #include <strstream>
...@@ -39,7 +13,7 @@ ...@@ -39,7 +13,7 @@
#include "AutoCorrEstimator.h" #include "AutoCorrEstimator.h"
#include "miscmaths/miscmaths.h" #include "miscmaths/miscmaths.h"
#include "utils/log.h" #include "utils/log.h"
#include "Volume.h" #include "miscmaths/volume.h"
#include "miscmaths/histogram.h" #include "miscmaths/histogram.h"
#include "miscmaths/miscmaths.h" #include "miscmaths/miscmaths.h"
#include "glm.h" #include "glm.h"
...@@ -315,9 +289,9 @@ namespace FILM { ...@@ -315,9 +289,9 @@ namespace FILM {
// output betas: // output betas:
write_ascii_matrix(LogSingleton::getInstance().appendDir("betas"), betas); write_ascii_matrix(LogSingleton::getInstance().appendDir("betas"), betas);
VolumeSeries::Dims dims = xdata.getDims(); VolumeInfo vinfo = xdata.getInfo();
dims.v = maxorder; vinfo.v = maxorder;
betas.unthresholdSeries(dims,xdata.getPreThresholdPositions()); betas.unthresholdSeries(vinfo,xdata.getPreThresholdPositions());
betas.writeAsFloat(LogSingleton::getInstance().getDir() + "/betas"); betas.writeAsFloat(LogSingleton::getInstance().getDir() + "/betas");
countLargeE = 0; countLargeE = 0;
...@@ -424,7 +398,7 @@ namespace FILM { ...@@ -424,7 +398,7 @@ namespace FILM {
int factor = 10000; int factor = 10000;
// Setup volume for reading and writing volumes: // Setup volume for reading and writing volumes:
Volume vol(acEst.getNumSeries(), xdata.getDims(), xdata.getPreThresholdPositions()); Volume vol(acEst.getNumSeries(), xdata.getInfo(), xdata.getPreThresholdPositions());
int i = 2; int i = 2;
...@@ -445,7 +419,7 @@ namespace FILM { ...@@ -445,7 +419,7 @@ namespace FILM {
// read in smoothed volume: // read in smoothed volume:
vol.read(logger.getDir() + "/" + postSmoothVol); vol.read(logger.getDir() + "/" + postSmoothVol);
vol.threshold(); vol.threshold();
acEst.getVolume(i) = vol.AsRow()/factor; acEst.setVolume(static_cast<RowVector>((vol/factor).AsRow()), i);
cerr << "."; cerr << ".";
} }
cerr << endl; cerr << endl;
...@@ -571,7 +545,7 @@ namespace FILM { ...@@ -571,7 +545,7 @@ namespace FILM {
//LogSingleton::getInstance().out("fftreal", fft_real); //LogSingleton::getInstance().out("fftreal", fft_real);
float varx = MISCMATHS::var(ColumnVector(x.Rows(1,sizeTS))).AsScalar(); float varx = MISCMATHS::var(ColumnVector(x.Rows(1,sizeTS))).AsScalar();
acEst.getSeries(i) = realifft.Rows(1,sizeTS)/varx; acEst.setSeries(realifft.Rows(1,sizeTS)/varx, i);
} }
countLargeE = 0; countLargeE = 0;
cerr << "Completed" << endl; cerr << "Completed" << endl;
......
...@@ -14,13 +14,14 @@ ...@@ -14,13 +14,14 @@
#define WANT_STREAM #define WANT_STREAM
#define WANT_MATH #define WANT_MATH
#include "VolumeSeries.h" #include "miscmaths/volumeseries.h"
#include "Volume.h" #include "miscmaths/volume.h"
#include "newmatap.h" #include "newmatap.h"
#include "newmatio.h" #include "newmatio.h"
#include "miscmaths/miscmaths.h" #include "miscmaths/miscmaths.h"
using namespace NEWMAT; using namespace NEWMAT;
using namespace MISCMATHS;
namespace FILM { namespace FILM {
...@@ -29,7 +30,7 @@ namespace FILM { ...@@ -29,7 +30,7 @@ namespace FILM {
public: public:
AutoCorrEstimator(const VolumeSeries& pxdata) : AutoCorrEstimator(const VolumeSeries& pxdata) :
xdata(pxdata), xdata(pxdata),
acEst(pxdata.getNumVolumes(), pxdata.getNumSeries(), pxdata.getDims(), pxdata.getPreThresholdPositions()), acEst(pxdata.getNumVolumes(), pxdata.getNumSeries(), pxdata.getInfo(), pxdata.getPreThresholdPositions()),
vrow(), vrow(),
xrow(), xrow(),
dummy(), dummy(),
......
...@@ -144,7 +144,7 @@ namespace FILM { ...@@ -144,7 +144,7 @@ namespace FILM {
peVol.read(logger.getDir() + "/pe" + strc); peVol.read(logger.getDir() + "/pe" + strc);
peVol.setDims(sigmaSquareds.getDims()); peVol.setInfo(sigmaSquareds.getInfo());
peVol.setPreThresholdPositions(sigmaSquareds.getPreThresholdPositions()); peVol.setPreThresholdPositions(sigmaSquareds.getPreThresholdPositions());
peVol.threshold(); peVol.threshold();
...@@ -180,7 +180,7 @@ namespace FILM { ...@@ -180,7 +180,7 @@ namespace FILM {
// avw format // avw format
is_avw_corrections = true; is_avw_corrections = true;
corrections.read(logger.getDir() + "/corrections"); corrections.read(logger.getDir() + "/corrections");
if(corrections.getDims().x == sigmaSquareds.getDims().x) if(corrections.getInfo().x == sigmaSquareds.getInfo().x)
{ {
// unthresholded avw // unthresholded avw
corrections.setPreThresholdPositions(sigmaSquareds.getPreThresholdPositions()); corrections.setPreThresholdPositions(sigmaSquareds.getPreThresholdPositions());
...@@ -209,13 +209,13 @@ namespace FILM { ...@@ -209,13 +209,13 @@ namespace FILM {
osc << suffix << c_counter << '\0'; osc << suffix << c_counter << '\0';
// Write out tstat: // Write out tstat:
fstat.setDims(sigmaSquareds.getDims()); fstat.setInfo(sigmaSquareds.getInfo());
fstat.setPreThresholdPositions(sigmaSquareds.getPreThresholdPositions()); fstat.setPreThresholdPositions(sigmaSquareds.getPreThresholdPositions());
fstat.unthreshold(); fstat.unthreshold();
fstat.writeAsFloat(logger.getDir() + "/fstat" + strc); fstat.writeAsFloat(logger.getDir() + "/fstat" + strc);
// Write out zstat: // Write out zstat:
zstat.setDims(sigmaSquareds.getDims()); zstat.setInfo(sigmaSquareds.getInfo());
zstat.setPreThresholdPositions(sigmaSquareds.getPreThresholdPositions()); zstat.setPreThresholdPositions(sigmaSquareds.getPreThresholdPositions());
zstat.unthreshold(); zstat.unthreshold();
zstat.writeAsFloat(logger.getDir() + "/zfstat" + strc); zstat.writeAsFloat(logger.getDir() + "/zfstat" + strc);
...@@ -232,31 +232,31 @@ namespace FILM { ...@@ -232,31 +232,31 @@ namespace FILM {
osc << suffix << c_counter << '\0'; osc << suffix << c_counter << '\0';
// Write out neffs: // Write out neffs:
neff.setDims(sigmaSquareds.getDims()); neff.setInfo(sigmaSquareds.getInfo());
neff.setPreThresholdPositions(sigmaSquareds.getPreThresholdPositions()); neff.setPreThresholdPositions(sigmaSquareds.getPreThresholdPositions());
neff.unthreshold(); neff.unthreshold();
neff.writeAsFloat(logger.getDir() + "/neff" + strc); neff.writeAsFloat(logger.getDir() + "/neff" + strc);
// Write out cope: // Write out cope:
cb.setDims(sigmaSquareds.getDims()); cb.setInfo(sigmaSquareds.getInfo());
cb.setPreThresholdPositions(sigmaSquareds.getPreThresholdPositions()); cb.setPreThresholdPositions(sigmaSquareds.getPreThresholdPositions());
cb.unthreshold(); cb.unthreshold();
cb.writeAsFloat(logger.getDir() + "/cope" + strc); cb.writeAsFloat(logger.getDir() + "/cope" + strc);
// Write out varcope: // Write out varcope:
varcb.setDims(sigmaSquareds.getDims()); varcb.setInfo(sigmaSquareds.getInfo());
varcb.setPreThresholdPositions(sigmaSquareds.getPreThresholdPositions()); varcb.setPreThresholdPositions(sigmaSquareds.getPreThresholdPositions());
varcb.unthreshold(); varcb.unthreshold();
varcb.writeAsFloat(logger.getDir() + "/varcope" + strc); varcb.writeAsFloat(logger.getDir() + "/varcope" + strc);
// Write out tstat: // Write out tstat:
tstat.setDims(sigmaSquareds.getDims()); tstat.setInfo(sigmaSquareds.getInfo());
tstat.setPreThresholdPositions(sigmaSquareds.getPreThresholdPositions()); tstat.setPreThresholdPositions(sigmaSquareds.getPreThresholdPositions());
tstat.unthreshold(); tstat.unthreshold();
tstat.writeAsFloat(logger.getDir() + "/tstat" + strc); tstat.writeAsFloat(logger.getDir() + "/tstat" + strc);
// Write out zstat: // Write out zstat:
zstat.setDims(sigmaSquareds.getDims()); zstat.setInfo(sigmaSquareds.getInfo());
zstat.setPreThresholdPositions(sigmaSquareds.getPreThresholdPositions()); zstat.setPreThresholdPositions(sigmaSquareds.getPreThresholdPositions());
zstat.unthreshold(); zstat.unthreshold();
zstat.writeAsFloat(logger.getDir() + "/zstat" + strc); zstat.writeAsFloat(logger.getDir() + "/zstat" + strc);
......
...@@ -16,11 +16,13 @@ ...@@ -16,11 +16,13 @@
#include "newmatap.h" #include "newmatap.h"
#include "newmatio.h" #include "newmatio.h"
#include "Volume.h" #include "miscmaths/volumeseries.h"
#include "miscmaths/volume.h"
#include "paradigm.h" #include "paradigm.h"
#include "miscmaths/miscmaths.h" #include "miscmaths/miscmaths.h"
using namespace NEWMAT; using namespace NEWMAT;
using namespace MISCMATHS;
namespace FILM { namespace FILM {
......
...@@ -5,11 +5,11 @@ PROJNAME = film ...@@ -5,11 +5,11 @@ PROJNAME = film
USRINCFLAGS = -I${INC_NEWMAT} -I${INC_PROB} USRINCFLAGS = -I${INC_NEWMAT} -I${INC_PROB}
USRLDFLAGS = -L${LIB_NEWMAT} -L${LIB_PROB} USRLDFLAGS = -L${LIB_NEWMAT} -L${LIB_PROB}
LIBS = -lmiscmaths -lutils -lm -lnewmat -lavwio -lprob -lz LIBS = -lmiscmaths -lutils -lm -lnewmat -lfslio -lniftiio -lznz -lprob -lz
XFILES = film_gls contrast_mgr ttoz ftoz ttologp XFILES = film_gls contrast_mgr ttoz ftoz ttologp
OBJS = ContrastMgrOptions.o ContrastMgr.o BandPassOptions.o gaussComparer.o AutoCorrEstimator.o Volume.o VolumeSeries.o glm.o paradigm.o glim.o FilmOlsOptions.o FilmGlsOptionsRes.o FilmGlsOptions.o glimGls.o OBJS = ContrastMgrOptions.o ContrastMgr.o BandPassOptions.o gaussComparer.o AutoCorrEstimator.o glm.o paradigm.o glim.o FilmOlsOptions.o FilmGlsOptionsRes.o FilmGlsOptions.o glimGls.o
#OPTFLAGS = #OPTFLAGS =
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
#include "newmatap.h" #include "newmatap.h"
#include "newmatio.h" #include "newmatio.h"
#include "VolumeSeries.h" #include "miscmaths/volumeseries.h"
#include "Volume.h" #include "miscmaths/volume.h"
#include "ContrastMgr.h" #include "ContrastMgr.h"
#include "miscmaths/miscmaths.h" #include "miscmaths/miscmaths.h"
#include "utils/log.h" #include "utils/log.h"
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <string> #include <string>
using namespace NEWMAT; using namespace NEWMAT;
using namespace MISCMATHS;
using namespace FILM; using namespace FILM;
using namespace Utilities; using namespace Utilities;
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
#include "newmatap.h" #include "newmatap.h"
#include "newmatio.h" #include "newmatio.h"
#include "VolumeSeries.h" #include "miscmaths/volumeseries.h"
#include "Volume.h" #include "miscmaths/volume.h"
#include "miscmaths/miscmaths.h" #include "miscmaths/miscmaths.h"
#include "utils/log.h" #include "utils/log.h"
#include "AutoCorrEstimator.h" #include "AutoCorrEstimator.h"
...@@ -52,7 +52,7 @@ int main(int argc, char *argv[]) ...@@ -52,7 +52,7 @@ int main(int argc, char *argv[])
if(globalopts.smoothACEst) if(globalopts.smoothACEst)
{ {
epivol = x.getVolume(int(sizeTS/2)).AsColumn(); epivol = x.getVolume(int(sizeTS/2)).AsColumn();
epivol.setDims(x.getDims()); epivol.setInfo(x.getInfo());
epivol.writeAsInt(logger.getDir() + "/" + globalopts.epifname); epivol.writeAsInt(logger.getDir() + "/" + globalopts.epifname);
} }
...@@ -93,7 +93,7 @@ int main(int argc, char *argv[]) ...@@ -93,7 +93,7 @@ int main(int argc, char *argv[])
GlimGls glimGls(numTS, sizeTS, numParams); GlimGls glimGls(numTS, sizeTS, numParams);
// Residuals container: // Residuals container:
VolumeSeries residuals(sizeTS, numTS, x.getDims(), x.getPreThresholdPositions()); VolumeSeries residuals(sizeTS, numTS, x.getInfo(), x.getPreThresholdPositions());
// Setup autocorrelation estimator: // Setup autocorrelation estimator:
AutoCorrEstimator acEst(residuals); AutoCorrEstimator acEst(residuals);
...@@ -212,20 +212,20 @@ int main(int argc, char *argv[]) ...@@ -212,20 +212,20 @@ int main(int argc, char *argv[])
cutoff = globalopts.tukeysize; cutoff = globalopts.tukeysize;
cutoff = MISCMATHS::Max(3,cutoff); cutoff = MISCMATHS::Max(3,cutoff);
threshac = threshac.Rows(1,cutoff); threshac = threshac.Rows(1,cutoff);
VolumeSeries::Dims dims = x.getDims(); VolumeInfo volinfo = x.getInfo();
dims.v = cutoff; volinfo.v = cutoff;
threshac.unthresholdSeries(dims,x.getPreThresholdPositions()); threshac.unthresholdSeries(volinfo,x.getPreThresholdPositions());
threshac.writeAsFloat(logger.getDir() + "/threshac1"); threshac.writeAsFloat(logger.getDir() + "/threshac1");
threshac.thresholdSeries(); threshac.thresholdSeries();
threshac.CleanUp(); threshac.CleanUp();
// write residuals // write residuals
residuals.unthresholdSeries(x.getDims(),x.getPreThresholdPositions()); residuals.unthresholdSeries(x.getInfo(),x.getPreThresholdPositions());
residuals.writeAsFloat(logger.getDir() + "/res4d"); residuals.writeAsFloat(logger.getDir() + "/res4d");
residuals.CleanUp(); residuals.CleanUp();
// save gls results: // save gls results:
glimGls.Save(x.getDims(), x.getPreThresholdPositions()); glimGls.Save(x.getInfo(), x.getPreThresholdPositions());
glimGls.CleanUp(); glimGls.CleanUp();
cerr << "Completed" << endl; cerr << "Completed" << endl;
......
...@@ -14,10 +14,10 @@ ...@@ -14,10 +14,10 @@
#include "newmatap.h" #include "newmatap.h"
#include "newmatio.h" #include "newmatio.h"
#include "VolumeSeries.h"
#include "Volume.h"
#include "glim.h" #include "glim.h"
#include "miscmaths/miscmaths.h" #include "miscmaths/miscmaths.h"
#include "miscmaths/volumeseries.h"
#include "miscmaths/volume.h"
#include "utils/log.h" #include "utils/log.h"
#include "AutoCorrEstimator.h" #include "AutoCorrEstimator.h"
#include "paradigm.h" #include "paradigm.h"
...@@ -55,7 +55,7 @@ int main(int argc, char *argv[]) ...@@ -55,7 +55,7 @@ int main(int argc, char *argv[])
if(globalopts.smoothACEst) if(globalopts.smoothACEst)
{ {
epivol = x.getVolume(12).AsColumn(); epivol = x.getVolume(12).AsColumn();
epivol.setDims(x.getDims()); epivol.setInfo(x.getInfo());
epivol.writeAsInt(logger.getDir() + "/" + globalopts.epifname); epivol.writeAsInt(logger.getDir() + "/" + globalopts.epifname);
} }
...@@ -98,7 +98,7 @@ int main(int argc, char *argv[]) ...@@ -98,7 +98,7 @@ int main(int argc, char *argv[])
int numParams = parad.getDesignMatrix().Ncols(); int numParams = parad.getDesignMatrix().Ncols();
GlimGls glimGls(numTS, sizeTS, numParams); GlimGls glimGls(numTS, sizeTS, numParams);
VolumeSeries residuals(sizeTS, numTS, x.getDims(), x.getPreThresholdPositions()); VolumeSeries residuals(sizeTS, numTS, x.getInfo(), x.getPreThresholdPositions());
AutoCorrEstimator acEst(residuals); AutoCorrEstimator acEst(residuals);
if(!globalopts.noest) if(!globalopts.noest)
...@@ -215,9 +215,9 @@ int main(int argc, char *argv[]) ...@@ -215,9 +215,9 @@ int main(int argc, char *argv[])
if(globalopts.tukey) if(globalopts.tukey)
cutoff = globalopts.tukeysize; cutoff = globalopts.tukeysize;
threshac = threshac.Rows(1,cutoff); threshac = threshac.Rows(1,cutoff);
VolumeSeries::Dims dims = x.getDims(); VolumeInfo vinfo = x.getInfo();
dims.v = cutoff; vinfo.v = cutoff;
threshac.unthresholdSeries(dims,x.getPreThresholdPositions()); threshac.unthresholdSeries(vinfo,x.getPreThresholdPositions());
threshac.writeAsFloat(logger.getDir() + "/threshac" + strc); threshac.writeAsFloat(logger.getDir() + "/threshac" + strc);
threshac.thresholdSeries(); threshac.thresholdSeries();
...@@ -229,7 +229,7 @@ int main(int argc, char *argv[]) ...@@ -229,7 +229,7 @@ int main(int argc, char *argv[])
logger.out(string("countLargeE") + strc, countLargeE); logger.out(string("countLargeE") + strc, countLargeE);
residuals.unthresholdSeries(x.getDims(),x.getPreThresholdPositions()); residuals.unthresholdSeries(x.getInfo(),x.getPreThresholdPositions());
residuals.writeAsFloat(logger.getDir() + "/res4d" + strc); residuals.writeAsFloat(logger.getDir() + "/res4d" + strc);
residuals.thresholdSeries(); residuals.thresholdSeries();
cerr << "Completed" << endl; cerr << "Completed" << endl;
...@@ -257,13 +257,13 @@ int main(int argc, char *argv[]) ...@@ -257,13 +257,13 @@ int main(int argc, char *argv[])
// Write out necessary data: // Write out necessary data:
cerr << "Saving results... " << endl; cerr << "Saving results... " << endl;
residuals.unthresholdSeries(x.getDims(),x.getPreThresholdPositions()); residuals.unthresholdSeries(x.getInfo(),x.getPreThresholdPositions());
residuals.writeAsFloat(logger.getDir() + "/res4d"); residuals.writeAsFloat(logger.getDir() + "/res4d");
// write out design matrices - a volume Series for each param // write out design matrices - a volume Series for each param
if(globalopts.verbose_dms) if(globalopts.verbose_dms)
{ {
VolumeSeries::Dims dims = x.getDims(); VolumeInfo vinfo = x.getInfo();
for(int j = 1; j <= numParams; j++) for(int j = 1; j <= numParams; j++)
{ {
char strc[4]; char strc[4];
...@@ -276,7 +276,7 @@ int main(int argc, char *argv[]) ...@@ -276,7 +276,7 @@ int main(int argc, char *argv[])
{ {
dmsmat.getSeries(i) = dms[i-1].Column(j); dmsmat.getSeries(i) = dms[i-1].Column(j);
} }
dmsmat.setDims(dims); dmsmat.setInfo(vinfo);
dmsmat.setPreThresholdPositions(x.getPreThresholdPositions()); dmsmat.setPreThresholdPositions(x.getPreThresholdPositions());
dmsmat.unthresholdSeries(); dmsmat.unthresholdSeries();
dmsmat.writeAsFloat(logger.getDir() + "/dms" + strc); dmsmat.writeAsFloat(logger.getDir() + "/dms" + strc);
...@@ -291,19 +291,19 @@ int main(int argc, char *argv[]) ...@@ -291,19 +291,19 @@ int main(int argc, char *argv[])
if(globalopts.verbose) if(globalopts.verbose)
{ {
VolumeSeries::Dims dims = x.getDims(); VolumeInfo vinfo = x.getInfo();
// Save E // Save E
VolumeSeries& E = acEst.getE(); VolumeSeries& E = acEst.getE();
dims.v = acEst.getZeroPad(); vinfo.v = acEst.getZeroPad();
E.setDims(dims); E.setInfo(vinfo);
E.setPreThresholdPositions(x.getPreThresholdPositions()); E.setPreThresholdPositions(x.getPreThresholdPositions());
E.unthresholdSeries(); E.unthresholdSeries();
E.writeAsFloat(logger.getDir() + "/E"); E.writeAsFloat(logger.getDir() + "/E");
} }
glimGls.Save(x.getDims(), x.getPreThresholdPositions()); glimGls.Save(x.getInfo(), x.getPreThresholdPositions());
cerr << "Completed" << endl; cerr << "Completed" << endl;
} }
catch(Exception p_excp) catch(Exception p_excp)
......
...@@ -15,11 +15,10 @@ ...@@ -15,11 +15,10 @@
#include "newmatio.h" #include "newmatio.h"
#include "miscmaths/f2z.h" #include "miscmaths/f2z.h"
#include "Volume.h" #include "miscmaths/volume.h"
#include <string> #include <string>
using namespace NEWMAT; using namespace NEWMAT;
using namespace FILM;
using namespace MISCMATHS; using namespace MISCMATHS;
// the real defaults are provided in the function parse_command_line // the real defaults are provided in the function parse_command_line
...@@ -130,7 +129,7 @@ int main(int argc,char *argv[]) ...@@ -130,7 +129,7 @@ int main(int argc,char *argv[])
Volume zs(numTS); Volume zs(numTS);
F2z::ComputeFStats(fs, globalopts.dof1, globalopts.dof2, zs); F2z::ComputeFStats(fs, globalopts.dof1, globalopts.dof2, zs);
zs.setDims(fs.getDims()); zs.setInfo(fs.getInfo());
zs.writeAsFloat(globalopts.zscoresfname.c_str()); zs.writeAsFloat(globalopts.zscoresfname.c_str());
} }
catch(Exception p_excp) catch(Exception p_excp)
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "glim.h" #include "glim.h"
#include "miscmaths/miscmaths.h" #include "miscmaths/miscmaths.h"
#include "utils/log.h" #include "utils/log.h"
#include "Volume.h" #include "miscmaths/volume.h"
#ifndef NO_NAMESPACE #ifndef NO_NAMESPACE
using namespace MISCMATHS; using namespace MISCMATHS;
...@@ -26,7 +26,7 @@ namespace FILM { ...@@ -26,7 +26,7 @@ namespace FILM {
numTS(p_y.Ncols()), numTS(p_y.Ncols()),
sizeTS(p_y.Nrows()), sizeTS(p_y.Nrows()),
numParams(p_x.Ncols()), numParams(p_x.Ncols()),
r(sizeTS, numTS, p_y.getDims(), p_y.getPreThresholdPositions()), r(sizeTS, numTS, p_y.getInfo(), p_y.getPreThresholdPositions()),
pinv_x(p_x.Ncols(), sizeTS), pinv_x(p_x.Ncols(), sizeTS),
V(sizeTS,sizeTS), V(sizeTS,sizeTS),
RV(sizeTS,sizeTS), RV(sizeTS,sizeTS),
...@@ -49,7 +49,7 @@ namespace FILM { ...@@ -49,7 +49,7 @@ namespace FILM {
for(int i = 1; i <= numParams; i++) for(int i = 1; i <= numParams; i++)
{ {
peVol = b.Row(i).AsColumn(); peVol = b.Row(i).AsColumn();
peVol.setDims(y.getDims()); peVol.setInfo(y.getInfo());
peVol.setPreThresholdPositions(y.getPreThresholdPositions()); peVol.setPreThresholdPositions(y.getPreThresholdPositions());
peVol.unthreshold(); peVol.unthreshold();
...@@ -62,7 +62,7 @@ namespace FILM { ...@@ -62,7 +62,7 @@ namespace FILM {
} }
// sigmaSquareds: // sigmaSquareds:
sigmaSquareds.setDims(y.getDims()); sigmaSquareds.setInfo(y.getInfo());
sigmaSquareds.setPreThresholdPositions(y.getPreThresholdPositions()); sigmaSquareds.setPreThresholdPositions(y.getPreThresholdPositions());
sigmaSquareds.unthreshold(); sigmaSquareds.unthreshold();
sigmaSquareds.writeAsFloat(logger.getDir() + "/sigmasquareds"); sigmaSquareds.writeAsFloat(logger.getDir() + "/sigmasquareds");
......
...@@ -13,10 +13,11 @@ ...@@ -13,10 +13,11 @@
#include "newmatap.h" #include "newmatap.h"
#include "newmatio.h" #include "newmatio.h"
#include "VolumeSeries.h" #include "miscmaths/volumeseries.h"
#include "Volume.h" #include "miscmaths/volume.h"
using namespace NEWMAT; using namespace NEWMAT;
using namespace MISCMATHS;
namespace FILM{ namespace FILM{
#if !defined(__glim_h) #if !defined(__glim_h)
......
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
#include "glimGls.h" #include "glimGls.h"
#include "miscmaths/miscmaths.h" #include "miscmaths/miscmaths.h"
#include "utils/log.h" #include "utils/log.h"
#include "Volume.h" #include "miscmaths/volume.h"
#include "VolumeSeries.h" #include "miscmaths/volumeseries.h"
using namespace MISCMATHS; using namespace MISCMATHS;
using namespace Utilities; using namespace Utilities;
...@@ -47,7 +47,7 @@ namespace FILM { ...@@ -47,7 +47,7 @@ namespace FILM {
SetCorrection(inv_xx, ind); SetCorrection(inv_xx, ind);
} }
void GlimGls::Save(const VolumeSeries::Dims& pdims, const ColumnVector& prethreshpos) void GlimGls::Save(const VolumeInfo& volinfo, const ColumnVector& prethreshpos)
{ {
// Need to save b, sigmaSquareds, corrections and dof // Need to save b, sigmaSquareds, corrections and dof
Log& logger = LogSingleton::getInstance(); Log& logger = LogSingleton::getInstance();
...@@ -57,7 +57,7 @@ namespace FILM { ...@@ -57,7 +57,7 @@ namespace FILM {
for(int i = 1; i <= numParams; i++) for(int i = 1; i <= numParams; i++)
{ {
peVol = b.Row(i).AsColumn(); peVol = b.Row(i).AsColumn();
peVol.setDims(pdims); peVol.setInfo(volinfo);
peVol.setPreThresholdPositions(prethreshpos); peVol.setPreThresholdPositions(prethreshpos);
peVol.unthreshold(); peVol.unthreshold();
...@@ -70,7 +70,7 @@ namespace FILM { ...@@ -70,7 +70,7 @@ namespace FILM {
} }
// sigmaSquareds: // sigmaSquareds:
sigmaSquareds.setDims(pdims); sigmaSquareds.setInfo(volinfo);
sigmaSquareds.setPreThresholdPositions(prethreshpos); sigmaSquareds.setPreThresholdPositions(prethreshpos);
sigmaSquareds.unthreshold(); sigmaSquareds.unthreshold();
sigmaSquareds.writeAsFloat(logger.getDir() + "/sigmasquareds"); sigmaSquareds.writeAsFloat(logger.getDir() + "/sigmasquareds");
...@@ -81,9 +81,9 @@ namespace FILM { ...@@ -81,9 +81,9 @@ namespace FILM {
write_ascii_matrix(logger.appendDir("dof"), dofVec); write_ascii_matrix(logger.appendDir("dof"), dofVec);
// corrections (are the pes correlation matrix (x.t()*x).i() reshapen to a vector): // corrections (are the pes correlation matrix (x.t()*x).i() reshapen to a vector):
VolumeSeries::Dims dims = pdims; VolumeInfo newvolinfo = volinfo;
dims.v = numParams*numParams; newvolinfo.v = numParams*numParams;
corrections.setDims(dims); corrections.setInfo(newvolinfo);
corrections.setPreThresholdPositions(prethreshpos); corrections.setPreThresholdPositions(prethreshpos);
corrections.unthresholdSeries(); corrections.unthresholdSeries();
corrections.writeAsFloat(logger.getDir() + "/corrections"); corrections.writeAsFloat(logger.getDir() + "/corrections");
......
...@@ -16,10 +16,11 @@ ...@@ -16,10 +16,11 @@
#include "newmatap.h" #include "newmatap.h"
#include "newmatio.h" #include "newmatio.h"
#include "Volume.h" #include "miscmaths/volume.h"
#include "VolumeSeries.h" #include "miscmaths/volumeseries.h"
using namespace NEWMAT; using namespace NEWMAT;
using namespace MISCMATHS;
namespace FILM { namespace FILM {
...@@ -39,7 +40,7 @@ namespace FILM { ...@@ -39,7 +40,7 @@ namespace FILM {
{} {}
void setData(const ColumnVector& p_y, const Matrix& p_x, const int ind); void setData(const ColumnVector& p_y, const Matrix& p_x, const int ind);
void Save(const VolumeSeries::Dims& pdims, const ColumnVector& prethreshpos); void Save(const VolumeInfo& volinfo, const ColumnVector& prethreshpos);
ColumnVector& getResiduals() { return r; } ColumnVector& getResiduals() { return r; }
void CleanUp(); void CleanUp();
......
...@@ -15,12 +15,11 @@ ...@@ -15,12 +15,11 @@
#include "newmatio.h" #include "newmatio.h"
#include "miscmaths/t2z.h" #include "miscmaths/t2z.h"
#include "Volume.h" #include "miscmaths/volume.h"
#include <string> #include <string>
#include "miscmaths/miscmaths.h" #include "miscmaths/miscmaths.h"
using namespace NEWMAT; using namespace NEWMAT;
using namespace FILM;
using namespace MISCMATHS; using namespace MISCMATHS;
// the real defaults are provided in the function parse_command_line // the real defaults are provided in the function parse_command_line
...@@ -133,7 +132,7 @@ int main(int argc,char *argv[]) ...@@ -133,7 +132,7 @@ int main(int argc,char *argv[])
Volume ps(numTS); Volume ps(numTS);
T2z::ComputePs(vars, cbs, globalopts.dof, ps); T2z::ComputePs(vars, cbs, globalopts.dof, ps);
ps.setDims(vars.getDims()); ps.setInfo(vars.getInfo());
ps.writeAsFloat(globalopts.logpfname.c_str()); ps.writeAsFloat(globalopts.logpfname.c_str());
} }
catch(Exception p_excp) catch(Exception p_excp)
......
...@@ -16,11 +16,10 @@ ...@@ -16,11 +16,10 @@
#include "miscmaths/miscmaths.h" #include "miscmaths/miscmaths.h"
#include "miscmaths/t2z.h" #include "miscmaths/t2z.h"
#include "Volume.h" #include "miscmaths/volume.h"
#include <string> #include <string>
using namespace NEWMAT; using namespace NEWMAT;
using namespace FILM;
using namespace MISCMATHS; using namespace MISCMATHS;
// the real defaults are provided in the function parse_command_line // the real defaults are provided in the function parse_command_line
...@@ -132,7 +131,7 @@ int main(int argc,char *argv[]) ...@@ -132,7 +131,7 @@ int main(int argc,char *argv[])
Volume zs(numTS); Volume zs(numTS);
T2z::ComputeZStats(vars, cbs, globalopts.dof, zs); T2z::ComputeZStats(vars, cbs, globalopts.dof, zs);
zs.setDims(vars.getDims()); zs.setInfo(vars.getInfo());
zs.writeAsFloat(globalopts.zscoresfname.c_str()); zs.writeAsFloat(globalopts.zscoresfname.c_str());
} }
catch(Exception p_excp) catch(Exception p_excp)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment