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

Method __init__

monai/transforms/post/array.py:553–564  ·  view source on GitHub ↗

Initialize the connectivity and limit the labels for which holes are filled. Args: applied_labels: Labels for which to fill holes. Defaults to None, that is filling holes for all labels. connectivity: Maximum number of orthogonal hops to consider a pixel/vox

(self, applied_labels: Iterable[int] | int | None = None, connectivity: int | None = None)

Source from the content-addressed store, hash-verified

551 backend = [TransformBackends.NUMPY]
552
553 def __init__(self, applied_labels: Iterable[int] | int | None = None, connectivity: int | None = None) -> None:
554 """
555 Initialize the connectivity and limit the labels for which holes are filled.
556
557 Args:
558 applied_labels: Labels for which to fill holes. Defaults to None, that is filling holes for all labels.
559 connectivity: Maximum number of orthogonal hops to consider a pixel/voxel as a neighbor.
560 Accepted values are ranging from 1 to input.ndim. Defaults to a full connectivity of ``input.ndim``.
561 """
562 super().__init__()
563 self.applied_labels = ensure_tuple(applied_labels) if applied_labels else None
564 self.connectivity = connectivity
565
566 def __call__(self, img: NdarrayOrTensor) -> NdarrayOrTensor:
567 """

Callers

nothing calls this directly

Calls 2

ensure_tupleFunction · 0.90
__init__Method · 0.45

Tested by

no test coverage detected