-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmain.py
More file actions
36 lines (30 loc) · 999 Bytes
/
main.py
File metadata and controls
36 lines (30 loc) · 999 Bytes
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
#use this as alternative of preprocess.m
#ignore the steps that are not useful for preprocessData function
import octSpectralisReader as rd
import numpy as np
import preprocessData as pd
import matplotlib.pyplot as plt
import cv2
[header, BScanHeader, slo, BScans] = rd.octSpectralisReader(r'C:\Users\Steve\Documents\LAB\Lab_Python\OCTMatTool\example.vol')
header['angle'] = 0
#initialize options:
options = {
'preproc_params': {'normalize':2, 'filter':0,'filter_kernel':[1,1,3], 'flatten':1,'fast_rpe':0},
'types':'hc',
'img_rows':128,
'img_cols':128,
'segfile': 'example.mat', #need to convert this part
'train': 0,
'segs': 10,
'crop': 0,
'dplot':0,
'org':1,
'flatvol':1
}
preproc_params = options['preproc_params']
preproc_params['retinadetector_type'] = options['types']
scanner_type = 'spectralis'
[img_vol,retina_mask,bds,shifts] = pd.preprocessData(BScans,header,preproc_params,scanner_type,1)
plt.imshow(img_vol[:,:,0])
plt.plot
plt.show()