logo

ジュリア、マットラボ、パイソンでのラドン変換の使用方法 📂トモグラフィ

ジュリア、マットラボ、パイソンでのラドン変換の使用方法

パイソン1

サイキットイメージパッケージ skimagetransform モジュールでは、マットラボと異なり、 radon, iradon の両変換ともに角度を入力しない場合 0:179 で実行される。

import matplotlib.pyplot as plt

from skimage.data import shepp_logan_phantom
from skimage.transform import radon, iradon

#Phantom 생성
p = shepp_logan_phantom() #default size=(400,400)

#라돈변환 계산
Rp = radon(p)

#라돈역변환 계산
IRp = iradon(Rp)

#그림 그리기
fig, (ax1, ax2, ax3) = plt.subplots(1, 3, figsize=(12, 4.5))

#첫번째 그림 Phantom
ax1.set_title("Phantom")
ax1.imshow(p)

#두번째 그림 라돈변환
ax2.set_title("Radon transform of p")
ax2.set_xlabel("Projection angle (deg)")
ax2.set_ylabel("Projection position (pixels)")
ax2.imshow(sinogram)

#세번째 그림 라돈역변환
ax3.set_title("Reconstruction Image")
ax3.imshow(IRp)

#그림 출력
fig.tight_layout()
plt.show()

Python.png

環境

  • OS: Windows10
  • Version: Python 3.9.2, scikit-image 0.18.1