In [1]:
import skbeam.core.roi as roi
import numpy as np
import matplotlib.pyplot as plt
%matplotlib notebook
In [2]:
x = np.linspace(-5,5,200)
X,Y = np.meshgrid(x,x)
Z = 100*np.cos(np.sqrt(x**2 + Y**2))**2 + 50
In [3]:
center, image, radii = roi.auto_find_center_rings(Z, sigma=20, no_rings=5)
fig, ax = plt.subplots()
ax.scatter(center[0], center[1], s=50, c='red')
im = ax.imshow(image, cmap="viridis")
cbar = fig.colorbar(im)
In [4]:
center
Out[4]:
In [5]:
radii
Out[5]:
In [6]:
duke_img = np.load("image_data/duke_img.npy" )
fig, ax = plt.subplots()
im = ax.imshow(duke_img, vmax=1e0, cmap="viridis");
fig.colorbar(im)
plt.show()
In [7]:
center_a, image_a, radii_a = roi.auto_find_center_rings(duke_img, sigma=2, no_rings=4)
radii_a
Out[7]:
In [8]:
fig, ax = plt.subplots()
plt.scatter(center_a[0], center_a[1], s=50, c='green')
ax.set_title("Center and 4 most intense rings")
ax.set_xlabel("pixels")
ax.set_ylabel("pixels")
im_a = ax.imshow(image_a, vmax=1e0, cmap="viridis");
fig.colorbar(im_a)
Out[8]:
In [9]:
nipa_avg = np.load("image_data/nipa_avg.npy")
In [10]:
center_n, image_n, radii_n = roi.auto_find_center_rings(nipa_avg, sigma=20, no_rings=2)
In [11]:
fig, ax = plt.subplots()
ax.scatter(center_n[0], center_n[1], s=50, c='red')
im_n = ax.imshow(image_n, cmap="viridis")
plt.colorbar(im_n)
Out[11]:
In [12]:
radii_n
Out[12]:
In [13]:
center_n
Out[13]:
In [14]:
import skbeam
skbeam.__version__
Out[14]:
In [ ]: