-
Notifications
You must be signed in to change notification settings - Fork 0
/
niftimage.h
64 lines (46 loc) · 1.36 KB
/
niftimage.h
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
58
59
60
61
62
63
64
#ifndef NIFTIMAGE_H
#define NIFTIMAGE_H
#include <QDebug>
#include <QFile>
#include <opencv2/opencv.hpp>
#include "opencv.h"
#include "util.h"
#include "subjectconfig.h"
#include "numerictype.h"
#include <QOpenGLFunctions_3_3_Core>
#include <nifti1.h>
#include <nifti1_io.h>
class NIFTImage
{
private:
nifti_image *upper;
nifti_image *lower;
SubjectConfig *subConfig;
int xDim;
int yDim;
int zDim;
cv::Mat data;
public:
NIFTImage();
NIFTImage(nifti_image *upper, nifti_image *lower, SubjectConfig *config = NULL);
NIFTImage(SubjectConfig *config);
~NIFTImage();
bool setImage(nifti_image *upper, nifti_image *lower, SubjectConfig *config = NULL);
bool setSubjectConfig(SubjectConfig *config);
bool checkImage() const;
bool compatible(NIFTImage *image) const;
nifti_image *getUpperImage() const;
nifti_image *getLowerImage() const;
int getXDim() const;
int getYDim() const;
int getZDim() const;
bool isLoaded() const;
cv::Mat getRegion(std::vector<cv::Range> region, bool clone = false);
cv::Mat getAxialSlice(int z, bool clone = false);
cv::Mat getCoronalSlice(int y, bool clone = false);
cv::Mat getSaggitalSlice(int x, bool clone = false);
const NumericType *getType() const;
private:
void orientImage(nifti_image *image, cv::Mat &mat);
};
#endif // NIFTIMAGE_H