| Conditions | 2 |
| Total Lines | 17 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import urllib.parse |
||
| 9 | def __init__(self, version=1998): |
||
| 10 | self.name = 'NIFTI_ovine_05mm' |
||
| 11 | self.url_dir = urllib.parse.urljoin(self.url_base, 'sheep/') |
||
| 12 | self.filename = f'{self.name}.zip' |
||
| 13 | self.url = urllib.parse.urljoin(self.url_dir, self.filename) |
||
| 14 | download_root = get_torchio_cache_dir() / self.name |
||
| 15 | if download_root.is_dir(): |
||
| 16 | print(f'Using cache found in {download_root}') |
||
| 17 | else: |
||
| 18 | download_and_extract_archive( |
||
| 19 | self.url, |
||
| 20 | download_root=download_root, |
||
| 21 | filename=self.filename, |
||
| 22 | ) |
||
| 23 | t1_path = download_root / 'ovine_model_05.nii' |
||
| 24 | super().__init__( |
||
| 25 | t1=Image(t1_path) |
||
| 26 | ) |
||
| 27 |