-
Notifications
You must be signed in to change notification settings - Fork 0
/
tissueproperties.cpp
153 lines (132 loc) · 3.55 KB
/
tissueproperties.cpp
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
#include "tissueproperties.h"
#include <QFile>
#include <QTextStream>
/*
* Data was collected from
*/
TissueProperties::TissueProperties()
{
QFile file("body_tissue.csv");
Q_ASSERT(file.open(QFile::ReadOnly));
QTextStream stream(&file);
//first 2 lines are the headers
stream.readLine();
stream.readLine();
//read line by line
while (!stream.atEnd()){
QString line = stream.readLine();
QStringList list = line.split(",");
if (list.size() != 27)
continue;
int id = list.at(0).toInt();
//1 tissue
//2 organ
//300mhz
c300mhz.insert(id, list.at(3).toDouble());
p300mhz.insert(id, list.at(4).toDouble());
lt300mhz.insert(id, list.at(5).toDouble());
//400mhz
c400mhz.insert(id, list.at(6).toDouble());
p400mhz.insert(id, list.at(7).toDouble());
lt400mhz.insert(id, list.at(8).toDouble());
//500mhz
c500mhz.insert(id, list.at(9).toDouble());
p500mhz.insert(id, list.at(10).toDouble());
lt500mhz.insert(id, list.at(11).toDouble());
//600mhz
c600mhz.insert(id, list.at(12).toDouble());
p600mhz.insert(id, list.at(13).toDouble());
lt600mhz.insert(id, list.at(14).toDouble());
//700mhz
c700mhz.insert(id, list.at(15).toDouble());
p700mhz.insert(id, list.at(16).toDouble());
lt700mhz.insert(id, list.at(17).toDouble());
//800mhz
c800mhz.insert(id, list.at(18).toDouble());
p800mhz.insert(id, list.at(19).toDouble());
lt800mhz.insert(id, list.at(20).toDouble());
//900mhz
c900mhz.insert(id, list.at(21).toDouble());
p900mhz.insert(id, list.at(22).toDouble());
lt900mhz.insert(id, list.at(23).toDouble());
//1000mhz
c1000mhz.insert(id, list.at(24).toDouble());
p1000mhz.insert(id, list.at(25).toDouble());
lt1000mhz.insert(id, list.at(26).toDouble());
}
}
QMap<int, float> TissueProperties::permitivity(int freq) const
{
switch (freq){
case 300000000:
return p300mhz;
case 400000000:
return p400mhz;
case 500000000:
return p500mhz;
case 600000000:
return p600mhz;
case 700000000:
return p700mhz;
case 800000000:
return p800mhz;
case 900000000:
return p900mhz;
case 1000000000:
return p1000mhz;
default:
Q_ASSERT(false);
}
//compiler warning
return QMap<int, float>();
}
QMap<int, float> TissueProperties::conductivity(int freq) const
{
switch (freq){
case 300000000:
return c300mhz;
case 400000000:
return c400mhz;
case 500000000:
return c500mhz;
case 600000000:
return c600mhz;
case 700000000:
return c700mhz;
case 800000000:
return c800mhz;
case 900000000:
return c900mhz;
case 1000000000:
return c1000mhz;
default:
Q_ASSERT(false);
}
//compiler warning
return QMap<int, float>();
}
QMap<int, float> TissueProperties::lossTangent(int freq) const
{
switch (freq){
case 300000000:
return lt300mhz;
case 400000000:
return lt400mhz;
case 500000000:
return lt500mhz;
case 600000000:
return lt600mhz;
case 700000000:
return lt700mhz;
case 800000000:
return lt800mhz;
case 900000000:
return lt900mhz;
case 1000000000:
return lt1000mhz;
default:
Q_ASSERT(false);
}
//compiler warning
return QMap<int, float>();
}