Skip to content

Commit

Permalink
Readme update and fix in spectral data generator files
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathé Zeegers committed Oct 5, 2022
1 parent 02944e2 commit b937c98
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ These scripts are written in Python (version 3.7 or higher). Apart from this, ph

## References

The algorithms implemented in this MATLAB package are described in following [paper](https://iopscience.iop.org/article/10.1088/1361-6420/ac932e):
The algorithms implemented in this MATLAB package are described in following [paper](https://iopscience.iop.org/article/10.1088/1361-6420/ac932e). If you use (parts of) this code in a publication, we would appreciate it if you would refer to:

```
@article{
Expand Down
10 changes: 5 additions & 5 deletions python_spectral/SpectralDataGenerator_AllOtherPhantoms.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
def computeMaterialEnergyMatrixXray(materials):

#Collect the attenuation spectra for each material
AttenuationSpectra = collectAttenuationSpectra(RootDataPath, materials)
AttenuationSpectra = collectAttenuationSpectra(materials)

#Setup the energy discretization
EnergyBounds = np.linspace(MinEnergy, MaxEnergy, num = energies)
Expand All @@ -79,7 +79,7 @@ def computeMaterialEnergyMatrixXray(materials):

return energyatts

def collectAttenuationSpectra(Rootdatapath, Labels):
def collectAttenuationSpectra(Labels):
AttenuationSpectra = []
print("\nLoading attenuation spectra...")

Expand All @@ -88,10 +88,10 @@ def collectAttenuationSpectra(Rootdatapath, Labels):
if (mat[1] in [i[1] for i in ElementaryData]): #Elementary material
AtNo = elementToAtomic(mat[1])
if (AtNo > 0):
attData = getAttenuationSpectrum(AtNo, Rootdatapath)
attData = getAttenuationSpectrum(AtNo)
AttenuationSpectra.append((mat[0],)+(mat[1],) + attData)
else:
attData = getAttenuationSpectrum(mat[1], Rootdatapath) #Mixture material
attData = getAttenuationSpectrum(mat[1]) #Mixture material
AttenuationSpectra.append((mat[0],)+(mat[1],) + attData)
elif(mat[0] != 0 and mat[1] == "Void"):
#Make the zero attenuation spectrum
Expand All @@ -111,7 +111,7 @@ def elementToAtomic(materialname):
else:
return next(x for x in ElementaryData if x[1] == materialname)[0]

def getAttenuationSpectrum(materialno, rootdatapath):
def getAttenuationSpectrum(materialno):

data = np.array(physdata.xray.fetch_coefficients(materialno))

Expand Down
10 changes: 5 additions & 5 deletions python_spectral/SpectralDataGenerator_Thorax.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

def computeMaterialEnergyMatrixXray(materials):
#Collect the attenuation spectra for each material
AttenuationSpectra = collectAttenuationSpectra(RootDataPath, materials)
AttenuationSpectra = collectAttenuationSpectra(materials)

#Setup the energy discretization
EnergyBounds = np.linspace(MinEnergy, MaxEnergy, num = energies)
Expand All @@ -74,7 +74,7 @@ def computeMaterialEnergyMatrixXray(materials):

return energyatts

def collectAttenuationSpectra(Rootdatapath, Labels):
def collectAttenuationSpectra(Labels):
AttenuationSpectra = []
print("\nLoading attenuation spectra...")

Expand All @@ -83,10 +83,10 @@ def collectAttenuationSpectra(Rootdatapath, Labels):
if (mat[1] in [i[1] for i in ElementaryData]): #Elementary material
AtNo = elementToAtomic(mat[1])
if (AtNo > 0):
attData = getAttenuationSpectrum(AtNo, Rootdatapath)
attData = getAttenuationSpectrum(AtNo)
AttenuationSpectra.append((mat[0],)+(mat[1],) + attData)
else:
attData = getAttenuationSpectrum(mat[1], Rootdatapath) #Mixture material
attData = getAttenuationSpectrum(mat[1]) #Mixture material
AttenuationSpectra.append((mat[0],)+(mat[1],) + attData)
elif(mat[0] != 0 and mat[1] == "Void"):
#Make the zero attenuation spectrum
Expand All @@ -106,7 +106,7 @@ def elementToAtomic(materialname):
else:
return next(x for x in ElementaryData if x[1] == materialname)[0]

def getAttenuationSpectrum(materialno, rootdatapath):
def getAttenuationSpectrum(materialno):

data = np.array(physdata.xray.fetch_coefficients(materialno)) #Density taken from array

Expand Down

0 comments on commit b937c98

Please sign in to comment.