rewards#


class LabelmapClusteringBasedReward(n_landmarks: Sequence[int] = (4, 3, 1))[source]#

Reward metric based on the presence and location of anatomical landmarks.

compute_reward(state: LabelmapStateAction) float[source]#

Calculate the reward based on the presence and location of anatomical landmarks. First the tissue clusters are found using DBSCAN, then the reward is calculated by anatomy_based_rwd.

property range: tuple[float, float]#

Reward range is [-1, 0], where 0 is the best reward and -1 is the worst.

anatomy_based_rwd(tissue_clusters: TissueClusters, n_landmarks: tuple[int, int, int] = (4, 3, 1)) float[source]#

Calculate the reward based on the presence and location of anatomical landmarks.

Parameters:
  • tissue_clusters -- dictionary of tissues and their clusters

  • n_landmarks -- number of landmarks for each tissue, in the same order as TissueLabel

Returns:

reward value.