-
Notifications
You must be signed in to change notification settings - Fork 2
/
citk.h
114 lines (86 loc) · 2.63 KB
/
citk.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#pragma once
#include <cdicom.h>
#include <cfileloader.h>
/** C++ includes **/
#include <map>
#include <memory>
/** ITK Includes **/
#include "itkImageToVTKImageFilter.h"
#include "itkFlipImageFilter.h"
#include "itkImageDuplicator.h"
#include "itkExtractImageFilter.h"
/** Qt Includes **/
#include <QString>
#include <QFileDialog>
#include <QStandardItemModel>
#include <QStandardItem>
#include <QHash>
#include <QMessageBox>
#include <QVariant>
/** VTK Includes **/
#include <vtkImageData.h>
#include <vtkSmartPointer.h>
class CITK
{
/** Data Members **/
private:
enum class DataClass{
NODATA = 2,
DICOMDATA = 4,
VOLDATA = 8
};
std::unique_ptr<CDicom> m_DICOM;
std::unique_ptr<CFileLoader> m_FileLoader;
QString m_ImagePath;
InputImageType::Pointer m_Input3DImage;
InputImage4DType::Pointer m_Input4DImage;
QStandardItemModel *m_ImageListModel;
static CITK *m_CITKinstance;
QHash<QString, InputImageType::Pointer> m_ImageListMap;
QString m_ImageName;
std::map<std::string, std::string> m_Input3DImageParam;
double m_XYImageOrientation[2];
DataClass m_DataLoadState;
unsigned int m_4thDimension;
unsigned int m_VolumeSequenceID;
/** Constructors and Destructors **/
private:
CITK();
public:
~CITK();
CITK(const CITK& rhs) = delete;
CITK& operator =(const CITK& rhs) = delete;
/** Function Members **/
public:
static CITK* CreateNew() {
if (m_CITKinstance == nullptr)
m_CITKinstance = new CITK();
return m_CITKinstance;
}
void LoadDicom();
void LoadData();
bool isDataLoaded() const noexcept;
const QString& GetImageDirectory() const{
return m_ImagePath;
}
const InputImageType::Pointer GetImage(const QString& = "Orig") const ;
void SetImageListModel(QAbstractItemModel *tModel);
template<typename T>
int AddImageToList(const QString&, typename T::Pointer);
template<typename T>
vtkSmartPointer<vtkImageData> GetVTKData(typename T::Pointer const&);
unsigned int Get4thDimension() const noexcept {
return m_4thDimension;
}
unsigned int GetCurrentVolumeID() const noexcept {
return m_VolumeSequenceID;
}
bool Update3DVolume(unsigned int);
bool GetImageParamsAsModel(QAbstractItemModel *);
void SaveToDicom(const InputImageType::Pointer&, const QString&, float, float, float);
double *GetXYImageOrientation(void);
private:
void SetInitTraits();
void Init();
bool Convert3Dto4D();
};