| Total Complexity | 2 |
| Total Lines | 18 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import torch |
||
| 2 | from ...data.subject import Subject |
||
| 3 | from ...torchio import TypePatchSize |
||
| 4 | from .weighted import WeightedSampler |
||
| 5 | |||
| 6 | |||
| 7 | class UniformSampler(WeightedSampler): |
||
| 8 | """Randomly extract patches from a volume with uniform probability. |
||
| 9 | |||
| 10 | Args: |
||
| 11 | patch_size: See :py:class:`~torchio.data.PatchSampler`. |
||
| 12 | """ |
||
| 13 | def __init__(self, patch_size: TypePatchSize): |
||
| 14 | super().__init__(patch_size) |
||
| 15 | |||
| 16 | def get_probability_map(self, sample: Subject) -> torch.Tensor: |
||
| 17 | return torch.ones(sample.shape) |
||
| 18 |