(
self,
keys: KeysCollection,
sigma: Sequence[float] | float = 5.0,
heatmap_keys: KeysCollection | None = None,
ref_image_keys: KeysCollection | None = None,
spatial_shape: Sequence[int] | Sequence[Sequence[int]] | None = None,
truncated: float = 4.0,
normalize: bool = True,
dtype: np.dtype | torch.dtype | type = np.float32,
allow_missing_keys: bool = False,
)
| 592 | _ERR_REF_NO_SHAPE = "Reference data must define a shape attribute." |
| 593 | |
| 594 | def __init__( |
| 595 | self, |
| 596 | keys: KeysCollection, |
| 597 | sigma: Sequence[float] | float = 5.0, |
| 598 | heatmap_keys: KeysCollection | None = None, |
| 599 | ref_image_keys: KeysCollection | None = None, |
| 600 | spatial_shape: Sequence[int] | Sequence[Sequence[int]] | None = None, |
| 601 | truncated: float = 4.0, |
| 602 | normalize: bool = True, |
| 603 | dtype: np.dtype | torch.dtype | type = np.float32, |
| 604 | allow_missing_keys: bool = False, |
| 605 | ) -> None: |
| 606 | super().__init__(keys, allow_missing_keys) |
| 607 | self.heatmap_keys = self._prepare_heatmap_keys(heatmap_keys) |
| 608 | self.ref_image_keys = self._prepare_optional_keys(ref_image_keys) |
| 609 | self.static_shapes = self._prepare_shapes(spatial_shape) |
| 610 | self.generator = GenerateHeatmap( |
| 611 | sigma=sigma, spatial_shape=None, truncated=truncated, normalize=normalize, dtype=dtype |
| 612 | ) |
| 613 | |
| 614 | def __call__(self, data: Mapping[Hashable, Any]) -> dict[Hashable, Any]: |
| 615 | d = dict(data) |
nothing calls this directly
no test coverage detected