| Total Complexity | 2 |
| Total Lines | 13 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | from typing import Union, Sequence |
||
| 2 | import torch |
||
| 3 | from .weighted import WeightedSampler |
||
| 4 | |||
| 5 | |||
| 6 | class UniformSampler(WeightedSampler): |
||
| 7 | """Randomly extract patches from a volume with uniform probability.""" |
||
| 8 | def __init__(self, patch_size: Union[int, Sequence[int]]): |
||
| 9 | super().__init__(patch_size) |
||
| 10 | |||
| 11 | def get_probability_map(self, sample): |
||
| 12 | return torch.ones(sample.shape) |
||
| 13 |