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

Method compute_pad_width

monai/transforms/croppad/array.py:121–130  ·  view source on GitHub ↗

dynamically compute the pad width according to the spatial shape. the output is the amount of padding for all dimensions including the channel. Args: spatial_shape: spatial shape of the original image.

(self, spatial_shape: Sequence[int])

Source from the content-addressed store, hash-verified

119 self.kwargs = kwargs
120
121 def compute_pad_width(self, spatial_shape: Sequence[int]) -> tuple[tuple[int, int]]:
122 """
123 dynamically compute the pad width according to the spatial shape.
124 the output is the amount of padding for all dimensions including the channel.
125
126 Args:
127 spatial_shape: spatial shape of the original image.
128
129 """
130 raise NotImplementedError(f"subclass {self.__class__.__name__} must implement this method.")
131
132 def __call__( # type: ignore[override]
133 self,

Callers 2

__call__Method · 0.95
crop_padMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected