| Total Complexity | 3 |
| Total Lines | 16 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import torch |
||
| 2 | import torchio as tio |
||
| 3 | from ...utils import TorchioTestCase |
||
| 4 | |||
| 5 | |||
| 6 | class TestContour(TorchioTestCase): |
||
| 7 | """Tests for `Contour`.""" |
||
| 8 | def test_one_hot(self): |
||
| 9 | image = self.sample_subject.label |
||
| 10 | tio.Contour()(image) |
||
| 11 | |||
| 12 | def test_multichannel(self): |
||
| 13 | label_map = tio.LabelMap(tensor=torch.rand(2, 3, 3, 3) > 1) |
||
| 14 | with self.assertRaises(RuntimeError): |
||
| 15 | tio.Contour()(label_map) |
||
| 16 |