Skip to content

Commit

Permalink
added Mac to python
Browse files Browse the repository at this point in the history
  • Loading branch information
kylechampley committed Nov 30, 2023
1 parent fc53d92 commit d63a9d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/xrayphysics.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ def __init__(self, lib_dir=""):
elif _platform == "win32":
from ctypes import windll
self.libxrayphysics = windll.LoadLibrary(os.path.join(current_dir, r'..\win_build\bin\Release\libxrayphysics.dll'))
elif _platform == "darwin": # Darwin is the name for MacOS in Python's platform module
from ctypes import cdll
# Adjust the path to where your .dylib file is located
self.libxrayphysics = cdll.LoadLibrary(os.path.join(current_dir, "../build/lib/libxrayphysics.dylib"))

def mu(self, Z, gamma, massDensity):
return massDensity * self.sigma(Z, gamma)
Expand Down
2 changes: 1 addition & 1 deletion src/xsource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ float* xraySource::takeOffAngleConversionFactor(float kVp_in, float takeOffAngle
float gamma_cur = gamma(i);
if (Z != 0 && gamma_cur > 0.0 && takeOffAngle_cur != takeOffAngle_new)
{
//float theRatio = xsecTables->sigma(Z, gamma_cur) * Z_over_A / (PhilibertConstant / (kVp_e165 - pow(gamma_cur, PhilibertExponent)));
//float theRatio = xsecTables->sigma_e(Z, gamma_cur) * Z_over_A / (PhilibertConstant / (kVp_e165 - pow(gamma_cur, PhilibertExponent)));
//retVal[i] = (sin_psi_out * sin_psi_out) / (sin_psi_in * sin_psi_in) * ((sin_psi_in + theRatio) * (sin_psi_in + h_factor * theRatio)) / ((sin_psi_out + theRatio) * (sin_psi_out + h_factor * theRatio));
takeOffAngle = takeOffAngle_cur * PI / 180.0;
float denom = PhilibertAbsorptionCorrectionFactor(gamma_cur);
Expand Down

0 comments on commit d63a9d6

Please sign in to comment.