MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / __init__

Method __init__

monai/transforms/post/dictionary.py:594–612  ·  view source on GitHub ↗
(
        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,
    )

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls 5

_prepare_heatmap_keysMethod · 0.95
_prepare_shapesMethod · 0.95
GenerateHeatmapClass · 0.90
__init__Method · 0.45

Tested by

no test coverage detected