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

Method compute_pad_width

monai/transforms/croppad/array.py:339–342  ·  view source on GitHub ↗
(self, spatial_shape: Sequence[int])

Source from the content-addressed store, hash-verified

337 super().__init__(mode=mode, lazy=lazy, **kwargs)
338
339 def compute_pad_width(self, spatial_shape: Sequence[int]) -> tuple[tuple[int, int]]:
340 new_size = compute_divisible_spatial_size(spatial_shape=spatial_shape, k=self.k)
341 spatial_pad = SpatialPad(spatial_size=new_size, method=self.method)
342 return spatial_pad.compute_pad_width(spatial_shape)
343
344
345class Crop(InvertibleTransform, LazyTransform):

Callers

nothing calls this directly

Calls 3

compute_pad_widthMethod · 0.95
SpatialPadClass · 0.85

Tested by

no test coverage detected