Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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
/* volume.h
Mark Woolrich - FMRIB Image Analysis Group
Copyright (C) 2002 University of Oxford */
/* CCOPYRIGHT */
#if !defined(__volume_h)
#define __volume_h
#include <iostream>
#include <fstream>
#define WANT_STREAM
#define WANT_MATH
#include "newmatap.h"
#include "newmatio.h"
#include "volumeinfo.h"
#include <string>
using namespace NEWMAT;
namespace MISCMATHS {
class Volume : public ColumnVector
{
public:
Volume() : ColumnVector() {}
Volume(const VolumeInfo& pvolinfo, const ColumnVector& in) :
ColumnVector(),
volinfo(pvolinfo),
preThresholdPositions(in)
{}
Volume(int psize) : ColumnVector (psize) {}
Volume(int psize,const VolumeInfo& pvolinfo, const ColumnVector& in) :
ColumnVector (psize),
volinfo(pvolinfo),
preThresholdPositions(in){}
Volume& operator=(const Volume& vol) {
ColumnVector::operator=(vol);
preThresholdPositions = vol.preThresholdPositions;
volinfo = vol.volinfo;
return *this;
}
Volume& operator=(const ColumnVector& pvec) {
ColumnVector::operator=(pvec);
return *this;
}
Volume& operator=(float pin) {
ColumnVector::operator=(pin);
return *this;
}
Volume(const ColumnVector& pvec) {ColumnVector::operator=(pvec);}
void threshold(float thresh);
void threshold();
void unthreshold();
void unthreshold(const VolumeInfo& pvolinfo, const ColumnVector& in);
void writeAsInt(const std::string& fname);
void writeAsFloat(const std::string& fname);
const VolumeInfo& getInfo() const { return volinfo; }
void setInfo(const VolumeInfo& pvolinfo) { volinfo = pvolinfo; }
int getUnthresholdSize() const { return volinfo.x*volinfo.y*volinfo.z; }
int getVolumeSize() const { return Nrows(); }
const ColumnVector& getPreThresholdPositions() const { return preThresholdPositions; }
void setPreThresholdPositions(const ColumnVector& in) { preThresholdPositions = in; }
protected:
VolumeInfo volinfo;
ColumnVector preThresholdPositions;
};
}
#endif