Skip to content
Snippets Groups Projects
Commit 9be16928 authored by Mark Jenkinson's avatar Mark Jenkinson
Browse files

Merged in the patches that Michael Hanke did

parent f6087332
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@
/* CCOPYRIGHT */
#include <iostream>
#include <strstream>
#include <sstream>
#define WANT_STREAM
#include "AutoCorrEstimator.h"
......@@ -382,8 +382,7 @@ namespace FILM {
}
// Setup external call to susan program:
char callsusanstr[1000];
ostrstream osc3(callsusanstr,1000);
ostringstream osc3;
string preSmoothVol = "preSmoothVol";
string postSmoothVol = "postSmoothVol";
......@@ -391,7 +390,7 @@ namespace FILM {
<< logger.getDir() << "/" << preSmoothVol << " 1 "
<< logger.getDir() << "/" << postSmoothVol << " "
<< masksize << " 3D 0 1 " << usanfname << " " << usanthresh << " "
<< logger.getDir() << "/" << "usanSize" << '\0';
<< logger.getDir() << "/" << "usanSize";
// Loop through first third of volumes
// assume the rest are zero
......@@ -404,7 +403,7 @@ namespace FILM {
cerr << "Spatially smoothing auto corr estimates" << endl;
cerr << callsusanstr << endl;
cerr << osc3.str() << endl;
for(; i <= lag; i++)
{
......@@ -414,7 +413,7 @@ namespace FILM {
vol.writeAsInt(logger.getDir() + "/" + preSmoothVol);
// call susan:
system(callsusanstr);
system(osc3.str().c_str());
// read in smoothed volume:
vol.read(logger.getDir() + "/" + postSmoothVol);
......@@ -425,16 +424,15 @@ namespace FILM {
cerr << endl;
// Clear unwanted written files
char rmfilesstr[1000];
ostrstream osc(rmfilesstr,1000);
ostringstream osc;
osc << "rm -rf "
<< logger.getDir() + "/" + postSmoothVol + "* "
<< logger.getDir() + "/" + preSmoothVol + "* "
<< logger.getDir() + "/usanSize*" << '\0';
<< logger.getDir() + "/usanSize*";
cerr << rmfilesstr << endl;
cerr << osc.str() << endl;
system(rmfilesstr);
system(osc.str().c_str());
cerr << "Completed" << endl;
}
......@@ -558,11 +556,10 @@ namespace FILM {
ifstream in;
char strc[10];
ostrstream osc(strc,10);
osc << sizeTS << "_" << M << '\0';
ostringstream osc;
osc << sizeTS << "_" << M;
string fname("/usr/people/woolrich/parads/mt_" + string(strc));
string fname("/usr/people/woolrich/parads/mt_" + osc.str());
in.open(fname.c_str(), ios::in);
if(!in)
throw Exception("Multitapering: Slepians file not found");
......
......@@ -9,8 +9,8 @@
#define WANT_STREAM
#define WANT_MATH
#include <iostream.h>
#include <fstream.h>
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <stdio.h>
#include "newmatap.h"
......
......@@ -11,8 +11,8 @@
#include <string>
#include <math.h>
#include <iostream.h>
#include <fstream.h>
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <stdio.h>
......
......@@ -6,7 +6,7 @@
/* CCOPYRIGHT */
#include <strstream>
#include <sstream>
#include <fstream>
#include "ContrastMgr.h"
#include "ContrastMgrOptions.h"
......@@ -139,11 +139,10 @@ namespace FILM {
for(int i = 1; i <= numParams; i++)
{
// Add param number to "pe" to create filename:
char strc[4];
ostrstream osc(strc,4);
osc << i << '\0';
ostringstream osc;
osc << i;
peVol.read(logger.getDir() + "/pe" + strc);
peVol.read(logger.getDir() + "/pe" + osc.str().c_str());
peVol.setInfo(sigmaSquareds.getInfo());
peVol.setPreThresholdPositions(sigmaSquareds.getPreThresholdPositions());
......@@ -205,9 +204,8 @@ namespace FILM {
Log& logger = LogSingleton::getInstance();
// prepare contrast number:
char strc[50];
ostrstream osc(strc,50);
osc << suffix << c_counter << '\0';
ostringstream osc;
osc << suffix << c_counter;
VolumeInfo tmpinfo;
......@@ -218,7 +216,7 @@ namespace FILM {
fstat.setInfo(tmpinfo);
fstat.setPreThresholdPositions(sigmaSquareds.getPreThresholdPositions());
fstat.unthreshold();
fstat.writeAsFloat(logger.getDir() + "/fstat" + strc);
fstat.writeAsFloat(logger.getDir() + "/fstat" + osc.str().c_str());
// Write out zstat:
tmpinfo = sigmaSquareds.getInfo();
......@@ -227,7 +225,7 @@ namespace FILM {
zstat.setInfo(tmpinfo);
zstat.setPreThresholdPositions(sigmaSquareds.getPreThresholdPositions());
zstat.unthreshold();
zstat.writeAsFloat(logger.getDir() + "/zfstat" + strc);
zstat.writeAsFloat(logger.getDir() + "/zfstat" + osc.str().c_str());
}
void ContrastMgr::SaveTContrast(const string& suffix)
......@@ -236,9 +234,8 @@ namespace FILM {
Log& logger = LogSingleton::getInstance();
// prepare contrast number:
char strc[50];
ostrstream osc(strc,50);
osc << suffix << c_counter << '\0';
ostringstream osc;
osc << suffix << c_counter;
VolumeInfo tmpinfo;
......@@ -248,7 +245,7 @@ namespace FILM {
neff.setInfo(tmpinfo);
neff.setPreThresholdPositions(sigmaSquareds.getPreThresholdPositions());
neff.unthreshold();
neff.writeAsFloat(logger.getDir() + "/neff" + strc);
neff.writeAsFloat(logger.getDir() + "/neff" + osc.str().c_str());
// Write out cope:
tmpinfo = sigmaSquareds.getInfo();
......@@ -257,7 +254,7 @@ namespace FILM {
cb.setInfo(tmpinfo);
cb.setPreThresholdPositions(sigmaSquareds.getPreThresholdPositions());
cb.unthreshold();
cb.writeAsFloat(logger.getDir() + "/cope" + strc);
cb.writeAsFloat(logger.getDir() + "/cope" + osc.str().c_str());
// Write out varcope:
tmpinfo = sigmaSquareds.getInfo();
......@@ -266,7 +263,7 @@ namespace FILM {
varcb.setInfo(tmpinfo);
varcb.setPreThresholdPositions(sigmaSquareds.getPreThresholdPositions());
varcb.unthreshold();
varcb.writeAsFloat(logger.getDir() + "/varcope" + strc);
varcb.writeAsFloat(logger.getDir() + "/varcope" + osc.str().c_str());
// Write out tstat:
tmpinfo = sigmaSquareds.getInfo();
......@@ -275,7 +272,7 @@ namespace FILM {
tstat.setInfo(tmpinfo);
tstat.setPreThresholdPositions(sigmaSquareds.getPreThresholdPositions());
tstat.unthreshold();
tstat.writeAsFloat(logger.getDir() + "/tstat" + strc);
tstat.writeAsFloat(logger.getDir() + "/tstat" + osc.str().c_str());
// Write out zstat:
tmpinfo = sigmaSquareds.getInfo();
......@@ -284,7 +281,7 @@ namespace FILM {
zstat.setInfo(tmpinfo);
zstat.setPreThresholdPositions(sigmaSquareds.getPreThresholdPositions());
zstat.unthreshold();
zstat.writeAsFloat(logger.getDir() + "/zstat" + strc);
zstat.writeAsFloat(logger.getDir() + "/zstat" + osc.str().c_str());
}
......
......@@ -9,8 +9,8 @@
#define WANT_STREAM
#define WANT_MATH
#include <iostream.h>
#include <fstream.h>
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <stdio.h>
#include "newmatap.h"
......
......@@ -11,8 +11,8 @@
#include <string>
#include <math.h>
#include <iostream.h>
#include <fstream.h>
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <stdio.h>
#include "utils/log.h"
......
......@@ -9,8 +9,8 @@
#define WANT_STREAM
#define WANT_MATH
#include <iostream.h>
#include <fstream.h>
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <stdio.h>
#include "FilmGlsOptions.h"
......
......@@ -11,8 +11,8 @@
#include <string>
#include <math.h>
#include <iostream.h>
#include <fstream.h>
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <stdio.h>
#include "utils/log.h"
......
......@@ -9,8 +9,8 @@
#define WANT_STREAM
#define WANT_MATH
#include <iostream.h>
#include <fstream.h>
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <stdio.h>
#include "newmatap.h"
......
......@@ -11,8 +11,8 @@
#include <string>
#include <math.h>
#include <iostream.h>
#include <fstream.h>
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <stdio.h>
......
......@@ -10,8 +10,8 @@
#define WANT_STREAM
#define WANT_MATH
#include <iostream.h>
#include <fstream.h>
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <stdio.h>
#include "newmatap.h"
......
......@@ -11,8 +11,8 @@
#include <string>
#include <math.h>
#include <iostream.h>
#include <fstream.h>
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <stdio.h>
......
......@@ -8,7 +8,7 @@
#include <iostream>
#include <fstream>
#include <strstream>
#include <sstream>
#define WANT_STREAM
#define WANT_MATH
......
......@@ -8,7 +8,7 @@
#include <iostream>
#include <fstream>
#include <strstream>
#include <sstream>
#define WANT_STREAM
#define WANT_MATH
......
......@@ -8,7 +8,7 @@
#include <iostream>
#include <fstream>
#include <strstream>
#include <sstream>
#define WANT_STREAM
#define WANT_MATH
......
......@@ -8,7 +8,7 @@
#include <iostream>
#include <fstream>
#include <strstream>
#include <sstream>
#define WANT_STREAM
#define WANT_MATH
......@@ -206,9 +206,8 @@ int main(int argc, char *argv[])
cerr << "Completed" << endl;
// Add param number to "pe" to create filename:
char strc[4];
ostrstream osc(strc,4);
osc << iters - 1 << '\0';
ostringstream osc;
osc << iters - 1;
VolumeSeries& threshac = acEst.getEstimates();
int cutoff = sizeTS/2;
......@@ -218,7 +217,7 @@ int main(int argc, char *argv[])
VolumeInfo vinfo = x.getInfo();
vinfo.v = cutoff;
threshac.unthresholdSeries(vinfo,x.getPreThresholdPositions());
threshac.writeAsFloat(logger.getDir() + "/threshac" + strc);
threshac.writeAsFloat(logger.getDir() + "/threshac" + osc.str().c_str());
threshac.thresholdSeries();
if(globalopts.verbose)
......@@ -230,7 +229,7 @@ int main(int argc, char *argv[])
logger.out(string("countLargeE") + strc, countLargeE);
residuals.unthresholdSeries(x.getInfo(),x.getPreThresholdPositions());
residuals.writeAsFloat(logger.getDir() + "/res4d" + strc);
residuals.writeAsFloat(logger.getDir() + "/res4d" + osc.str().c_str());
residuals.thresholdSeries();
cerr << "Completed" << endl;
}
......@@ -266,9 +265,8 @@ int main(int argc, char *argv[])
VolumeInfo vinfo = x.getInfo();
for(int j = 1; j <= numParams; j++)
{
char strc[4];
ostrstream osc(strc,4);
osc << j << '\0';
ostringstream osc;
osc << j;
VolumeSeries dmsmat(sizeTS, numTS);
......@@ -279,7 +277,7 @@ int main(int argc, char *argv[])
dmsmat.setInfo(vinfo);
dmsmat.setPreThresholdPositions(x.getPreThresholdPositions());
dmsmat.unthresholdSeries();
dmsmat.writeAsFloat(logger.getDir() + "/dms" + strc);
dmsmat.writeAsFloat(logger.getDir() + "/dms" + osc.str().c_str());
}
// output x
x.unthresholdSeries();
......
......@@ -8,7 +8,7 @@
#include <iostream>
#include <fstream>
#include <strstream>
#include <sstream>
#define WANT_STREAM
#define WANT_MATH
......
......@@ -6,7 +6,7 @@
/* CCOPYRIGHT */
#include <strstream>
#include <sstream>
#include "glim.h"
#include "miscmaths/miscmaths.h"
......@@ -54,11 +54,10 @@ namespace FILM {
peVol.unthreshold();
// Add param number to "pe" to create filename:
char strc[4];
ostrstream osc(strc,4);
osc << i << '\0';
ostringstream osc;
osc << i;
peVol.writeAsFloat(logger.getDir() + "/pe" + strc);
peVol.writeAsFloat(logger.getDir() + "/pe" + osc.str().c_str());
}
// sigmaSquareds:
......
......@@ -6,7 +6,7 @@
/* CCOPYRIGHT */
#include <strstream>
#include <sstream>
#include "glimGls.h"
#include "miscmaths/miscmaths.h"
......@@ -66,11 +66,10 @@ namespace FILM {
peVol.unthreshold();
// Add param number to "pe" to create filename:
char strc[4];
ostrstream osc(strc,4);
osc << i << '\0';
ostringstream osc;
osc << i;
peVol.writeAsFloat(logger.getDir() + "/pe" + strc);
peVol.writeAsFloat(logger.getDir() + "/pe" + osc.str().c_str());
}
// sigmaSquareds:
......
......@@ -9,7 +9,7 @@
#include <iostream>
#include <fstream>
#include <iomanip>
#include <strstream>
#include <sstream>
#define WANT_STREAM
#define WANT_MATH
......
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