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)
| 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 | """ |
nothing calls this directly
no test coverage detected