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

Method __iter__

monai/data/grid_dataset.py:429–440  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

427 return len(self.data) * self.samples_per_image # type: ignore
428
429 def __iter__(self):
430 for image in super().__iter__():
431 patches = self.patch_func(image)
432 if len(patches) != self.samples_per_image:
433 raise RuntimeWarning(
434 f"`patch_func` must return a sequence of length: samples_per_image={self.samples_per_image}."
435 )
436 for patch in patches:
437 out_patch = patch
438 if self.patch_transform is not None:
439 out_patch = apply_transform(self.patch_transform, patch, map_items=False)
440 yield out_patch

Callers 1

__iter__Method · 0.45

Calls 1

apply_transformFunction · 0.90

Tested by

no test coverage detected