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

Method __init__

monai/transforms/croppad/array.py:730–743  ·  view source on GitHub ↗
(
        self,
        roi_size: Sequence[int] | int,
        num_samples: int,
        max_roi_size: Sequence[int] | int | None = None,
        random_center: bool = True,
        random_size: bool = False,
        lazy: bool = False,
    )

Source from the content-addressed store, hash-verified

728 backend = RandSpatialCrop.backend
729
730 def __init__(
731 self,
732 roi_size: Sequence[int] | int,
733 num_samples: int,
734 max_roi_size: Sequence[int] | int | None = None,
735 random_center: bool = True,
736 random_size: bool = False,
737 lazy: bool = False,
738 ) -> None:
739 LazyTransform.__init__(self, lazy)
740 if num_samples < 1:
741 raise ValueError(f"num_samples must be positive, got {num_samples}.")
742 self.num_samples = num_samples
743 self.cropper = RandSpatialCrop(roi_size, max_roi_size, random_center, random_size, lazy)
744
745 def set_random_state(
746 self, seed: int | None = None, state: np.random.RandomState | None = None

Callers

nothing calls this directly

Calls 2

RandSpatialCropClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected