| Conditions | 1 |
| Total Lines | 10 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import torch |
||
| 16 | def get_sample(self, image_shape): |
||
| 17 | t1 = torch.rand(*image_shape) |
||
| 18 | prob = torch.zeros_like(t1) |
||
| 19 | prob[3, 3, 3] = 1 |
||
| 20 | subject = torchio.Subject( |
||
| 21 | t1=torchio.Image(tensor=t1), |
||
| 22 | prob=torchio.Image(tensor=prob), |
||
| 23 | ) |
||
| 24 | sample = torchio.ImagesDataset([subject])[0] |
||
| 25 | return sample |
||
| 26 |