-
Notifications
You must be signed in to change notification settings - Fork 0
/
MIViewBrowserDB.h
164 lines (129 loc) · 4.34 KB
/
MIViewBrowserDB.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
/* ----------------------------------------------------------------------------
MIViewBrowserDB.h
MIView - Medical Image Viewer
Copyright (C) 2009-2011 Gregory Book
MIView is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------- */
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "wx/dynarray.h"
//#include "wx/arrimpl.cpp"
/* forward declare the classes */
class Patient;
class Study;
class Series;
class File;
/* ------------ File definition ---------------- */
class File {
public:
File() {};
~File() {};
wxString fileName;
int slicenum;
};
WX_DECLARE_OBJARRAY(File,arr_files);
/* ------------ Series definition -------------- */
class Series {
public:
Series() {};
~Series() {};
wxString seriesName; /* key */
int GetNumFiles() { return (int)files.Count(); };
File &operator [](wxString key);
File &operator [] (long index);
//File &operator [](wxString key) {
// for(long i=0; i<(int)files.Count(); i++) /* search for they key */
// if(files[i].fileName == key) /* if its there, return the object */
// return files[i];
// long idx = files.Count();
// File newFile;
// newFile.fileName = key;
// files.Add(newFile);
// return files[idx]; /* otherwise add it and return the object */
//}
/* array of files for this series */
arr_files files;
};
//WX_DEFINE_OBJARRAY(arr_files);
WX_DECLARE_OBJARRAY(Series,arr_series);
/* ------------ Study definition --------------- */
class Study {
public:
Study() {};
~Study() {};
wxString studyName; /* key */
int GetNumSeries() { return (int)series.Count(); };
Series &operator [](wxString key);
Series &operator [] (long index);
//Series &operator [](wxString key) {
// for(long i=0; i<(int)series.Count(); i++) /* search for they key */
// if(series[i].seriesName == key) /* if its there, return the object */
// return series[i];
// long idx = series.Count();
// Series newSeries;
// newSeries.seriesName = key;
// series.Add(newSeries);
// return series[idx]; /* otherwise add it and return the object */
//}
/* array of series for this study */
arr_series series;
};
//WX_DEFINE_OBJARRAY(arr_series);
WX_DECLARE_OBJARRAY(Study,arr_studies);
/* ------------ Patient definition ------------- */
class Patient {
public:
Patient() {};
~Patient() {};
wxString patientName; /* key */
int GetNumStudies() { return (int)studies.Count(); };
Study &operator [](wxString key);
Study &operator [] (long index);
//Study &operator [](wxString key) {
// for(long i=0; i<(int)studies.Count(); i++) /* search for they key */
// if(studies[i].studyName == key) /* if its there, return the object */
// return studies[i];
// long idx = studies.Count();
// Study newStudy;
// newStudy.studyName = key;
// studies.Add(newStudy);
// return studies[idx]; /* otherwise add it and return the object */
//}
/* array of studies for this patient */
arr_studies studies;
};
//WX_DEFINE_OBJARRAY(arr_studies);
WX_DECLARE_OBJARRAY(Patient,arr_patients);
/* ------------ MIViewDB definition ------------- */
class BrowserDB {
public:
BrowserDB() {};
~BrowserDB() {};
wxString patientName; /* key */
int GetNumPatients() { return (int)patients.Count(); };
Patient &operator [](wxString key);
Patient &operator [] (long index);
//Patient &operator [](wxString key) {
// for(long i=0; i<(int)patients.Count(); i++) /* search for they key */
// if(patients[i].patientName == key) /* if its there, return the object */
// return patients[i];
// long idx = patients.Count();
// Patient newPatient;
// newPatient.patientName = key;
// patients.Add(newPatient);
// return patients[idx]; /* otherwise add it and return the object */
//}
/* array of patients */
arr_patients patients;
};
//WX_DEFINE_OBJARRAY(arr_patients);