-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain_terminal.py
29 lines (24 loc) · 1.03 KB
/
main_terminal.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
# Destriping code without using the GUI.
from matplotlib import pyplot as plt
from skimage import io
import numpy as np
import destripe
fname = 'nacreous_domain.tif' #file name
wedgeSize = 5 #angular range (degrees)
theta = 0 #orientation (degrees) (+/- 90 degrees)
kmin = 15 #min frequency to start missing wedge (1/px) ( < 0.5 * Length of image )
niter = 100 #number of iterations for reconstruction
a = 0.2 #Descent parameter for TV minimization
save = 1 # Set to true to save final reconstruction.
show = 1 # Set to true to see FFT and location of missing wedge.
#If set to false, the reconstruction will run.
#Read input image
input_img = io.imread('sample_data/' + fname)
input_img = np.array(input_img, dtype=np.float32)
# Set parameters to destripe object
destripe_obj = destripe.destripe(input_img, niter, a, wedgeSize, theta, kmin)
if show: #Show the Original Image, FFT, and missing wedge (Region being reconstructed)
destripe_obj.view_missing_wedge()
plt.show()
else: #Start reconstruction.
destripe_obj.TV_reconstruction(save)