# 3D CT
ph3d = shepp_logan((512,512,6), zlims=(-.25,.25))print(ph3d.shape)
plt.figure(figsize=(15,15))
n = ph3d.shape[-1]for i inrange(n):
img = ph3d[:,:,i]
plt.subplot(1, n, i +1)
plt.imshow(img, cmap="gray")
plt.show()
(512, 512, 6)
生成震荡的同心圆
from phantominator import dynamic
import math
phd = dynamic(128,20)print(ph.shape)
(128, 128, 20)
cols =6
rows = math.ceil(phd.shape[-1]/ cols)
n = phd.shape[-1]
plt.figure(figsize=(15,15))for i inrange(n):
img = phd[:,:,i]
plt.subplot(rows, cols, i +1)
plt.imshow(img, cmap="gray")
plt.show()