| Conditions | 2 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | from .weighted import WeightedSampler |
||
| 21 | def get_probability_map(self, sample): |
||
| 22 | """Return binarized image for sampling.""" |
||
| 23 | if self.probability_map_name in sample: |
||
| 24 | data = sample[self.probability_map_name].data > 0.5 |
||
| 25 | else: |
||
| 26 | message = ( |
||
| 27 | f'Image "{self.probability_map_name}"' |
||
| 28 | f' not found in subject sample: {sample}' |
||
| 29 | ) |
||
| 30 | raise KeyError(message) |
||
| 31 | return data |
||
| 32 |