Newer
Older
/* band_pass.cc
Mark Woolrich, FMRIB Image Analysis Group
Copyright (C) 1999-2000 University of Oxford */
#include <iostream>
#include <fstream>
#include "newmatap.h"
#include "newmatio.h"
#include "miscmaths/volumeseries.h"
#include "miscmaths/volume.h"
using namespace FILM;
using namespace Utilities;
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#endif
int main(int argc, char *argv[])
{
try{
// parse command line to find out directory name for logging:
ofstream out2;
BandPassOptions& globalopts = BandPassOptions::getInstance();
globalopts.parse_command_line(argc, argv, out2);
// Setup logging:
Log& logger = Log::getInstance();
logger.setLogFile("bpasslogfile");
logger.establishDir(globalopts.datadir);
// parse command line again to output arguments to logfile
globalopts.parse_command_line(argc, argv, logger.str());
// load non-temporally filtered data
VolumeSeries x;
x.read(globalopts.inputfname);
x.thresholdSeries(globalopts.thresh, true);
SIGPROC::BandPass(x, globalopts.lowcut, globalopts.highcut);
// Write out necessary data:
cerr << "Saving results... ";
x.unthresholdSeries();
x.replaceMeans();
x.writeAsFloat(logger.getDir() + "/bandpassed");
cerr << "Completed" << endl;
}
catch(Exception p_excp)
{
cerr << p_excp.what() << endl;
}
catch(...)
{
cerr << "Image error" << endl;
}
return 0;
}