An organ at risk (OAR) is a healthy organ near a radiation target that may receive radiation during treatment. Depending on the tumor’s location, OARs can include the heart, lungs, spinal cord, or brain. Excessive exposure can cause serious side effects. section 8.4
Treatment planning balances delivering enough radiation to control the tumor against keeping OAR doses below safe limits. Because dose accumulates across treatment fractions, an early beam decision can constrain later choices. section 8.4
Tracking OARs in a treatment simulation
A simulated treatment environment tracks each OAR’s cumulative dose and limit. Its state includes the remaining margin, calculated as (limit − dose) / limit. The reward penalizes dose above a limit, weighted by organ risk; separate checks use configurable margins to determine success or failure. section 8.4
Listing 8.2 Constructing the state representation
def _get_state(self):
cum_norm = self.cum_doses / 100.0 #A
tumor_dose = self.cum_doses[0] #B
tumor_remaining = (self.target_dose - tumor_dose)
➥/ self.target_dose #B
tumor_remaining = np.clip(tumor_remaining, -1.0, 1.0) #B
oar_doses = self.cum_doses[1:] #C
oar_limits = self.organ_limits[1:] #C
oar_margins = (oar_limits - oar_doses) / oar_limits #C
oar_margins = np.clip(oar_margins, -1.0, 1.0) #C
tumor_size_norm = (
(self.tumor_size - self.min_tumor_size)
/ (self.max_tumor_size - self.min_tumor_size)
) #D
tumor_size_norm = np.clip(tumor_size_norm, 0.0, 1.0) #D
frac_progress = self.current_fraction
➥/ float(self.n_fractions) #E
state = np.concatenate(
[
cum_norm,
np.array([tumor_remaining], dtype=np.float32),
oar_margins,
np.array([tumor_size_norm], dtype=np.float32),
np.array([frac_progress], dtype=np.float32),
]
) #F
return state.astype(np.float32)
The state representation calculates an OAR margin for each simulated organ, alongside tumor dose and treatment progress. section 8.4
