Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aditiiyer committed Nov 18, 2024
1 parent d2f683a commit f3b3fbd
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions cerr/dataclasses/dose.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,11 +694,12 @@ def sum(doseIndV, planC, fxCorrectDict={}):
frxCorrectFlag = False
fnHandle = None
if len(fxCorrectDict) > 0:
dictCpy = fxCorrectDict.copy()
frxCorrectFlag = True
# Identify fractionation correction method
methodDict = {"fractionNum": fractionNumCorrect,
"fractionSize": fractionSizeCorrect}
correctionType = fxCorrectDict.pop('correctionType')
correctionType = dictCpy.pop('correctionType')
fnHandle = methodDict[correctionType]

# Create shared grid from max extents of all dose grids
Expand Down Expand Up @@ -733,17 +734,17 @@ def sum(doseIndV, planC, fxCorrectDict={}):
# Get dose array and grid extents
doseArray = planC.dose[doseNum].doseArray
doseGrid = origGridList[doseNum]
gridMatchFlag = ((doseGrid[0] == xOutV).all() and
(doseGrid[1] == yOutV).all() and
(doseGrid[2] == zOutV).all())
gridMatchFlag = (np.array_equal(doseGrid[0], xOutV) and
np.array_equal(doseGrid[1], yOutV) and
np.array_equal(doseGrid[2], zOutV))

# Fraction correct
if frxCorrectFlag:
# Get fraction size
frxSize = getFrxSize(doseNum, planC)
# Fractionation correction
fxCorrectDict['inputFrxSize'] = frxSize
doseArray = fnHandle(doseArray, **fxCorrectDict)
dictCpy['inputFrxSize'] = frxSize
doseArray = fnHandle(doseArray, **dictCpy)

# Resample to shared grid
if gridMatchFlag:
Expand Down

0 comments on commit f3b3fbd

Please sign in to comment.