Hello everyone,
I’m very happy because I have explored the “pymedphys” library and these forums.
- I have a problem when using the pymedphys.gamma() function to calculate the gamma index between two datasets. The below image is data structure including 3 columns (x, y, z, relative dose(%)).
- I have written a bit of code, but it doesn’t work.
import numpy as np
import MyGammaIndex
import matplotlib.pyplot as plt
import pymedphys
ref_data = np.loadtxt(r"test/Ref_results.txt")
cal_data = np.loadtxt(r"test/Cal_results.txt")
gamma_primo = np.loadtxt(r"test/Gamma_Ana.txt")
ref_matrix = np.array(ref_data[:,3]).flatten()
cal_matrix = np.array(cal_data[:,3]).flatten()
x = ref_data[:,0]
y = ref_data[:,1]
z = ref_data[:,2]
coords = (x,y,z)
gamma_cal = pymedphys.gamma(coords, ref_matrix, coords, cal_matrix, 1, 1)
plt.plot(gamma_cal)
plt.plot(gamma_primo[:,3])
- I also change some line as following picture
gamma_cal = pymedphys.gamma(z, ref_matrix, z, cal_matrix, 1, 1)
It’s still not working. I show
ModuleNotFoundError:
PyMedPhys was unable to import "scipy.interpolate.RegularGridInterpolator".
The easiest way to fix this issue is to use the "[user]"
option when installing PyMedPhys. For example,
with pip this can be done by calling
"pip install pymedphys[user]==0.38.0".
Please help me to solve it. Thank you in advance.