Conditions | 2 |
Total Lines | 8 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import SimpleITK as sitk |
||
17 | def apply_transform(self, subject): |
||
18 | for image in self.get_images(subject): |
||
19 | assert image.data.ndim == 4 and image.data.shape[0] == 1 |
||
20 | sitk_image = image.as_sitk() |
||
21 | contour = sitk.BinaryContour(sitk_image) |
||
22 | tensor, _ = self.sitk_to_nib(contour) |
||
23 | image.set_data(tensor) |
||
24 | return subject |
||
25 |