-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
31 lines (27 loc) · 1.02 KB
/
test.py
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
from modules.reconstruction import *
from modules.aux.volume import *
from modules.pre_processing import *
def getHigherBins(dataset, range_bin=60, nbeams=10):
new_dataset = list()
for image in dataset:
for beam in image:
highers = list()
for i, bin_ in enumerate(beam['raw']):
if len(highers) < 10:
highers.append((bin_, i))
else:
for j in range(len(highers)):
if bin_ > highers[j][0]:
highers[j] = (bin_, i)
break
for i in range(len(highers)):
aux = dict()
aux['value'] = highers[i][0]
aux['dist'] = (highers[i][1]+1)/len(beam['raw'])*range_bin
aux['index'] = highers[i][1]
new_dataset.append(aux)
return new_dataset
dataset = getDataset('inputs/perto.txt')
dataset = splitDataset(dataset, 200)
dataset = getHigherBins(dataset)
print(dataset)