[docs]classBITE3(BITE):"""Pre- and post-resection MR images in BITE. *The goal of BITE is to share in vivo medical images of patients wtith brain tumors to facilitate the development and validation of new image processing algorithms.* Please check the `BITE website`_ for more information and acknowledgments instructions. .. _BITE website: http://nist.mni.mcgill.ca/bite-brain-images-of-tumors-for-evaluation-database/ Args: root: Root directory to which the dataset will be downloaded. transform: An instance of :class:`~torchio.transforms.transform.Transform`. download: If set to ``True``, will download the data into :attr:`root`. """# noqa: B950dirname='group3'def_download(self,root:Path):if(root/self.dirname).is_dir():returnroot.mkdir(exist_ok=True,parents=True)filename=f'{self.dirname}.tar.gz'url=self.base_url+filenamedownload_and_extract_archive(url,download_root=root,md5='e415b63887c40b727c45552614b44634',)(root/filename).unlink()# cleanupdef_get_subjects_list(self,root:Path):subjects_dir=root/self.dirnamesubjects=[]foriinrange(1,15):ifi==13:continue# no MRI for this subjectsubject_id=f'{i:02d}'subject_dir=subjects_dir/subject_idpreop_path=subject_dir/f'{subject_id}_preop_mri.mnc'postop_path=subject_dir/f'{subject_id}_postop_mri.mnc'images_dict:Dict[str,Image]={}images_dict['preop']=ScalarImage(preop_path)images_dict['postop']=ScalarImage(postop_path)forfpinsubject_dir.glob('*tumor*'):images_dict[fp.stem[3:]]=LabelMap(fp)subject=Subject(images_dict)subjects.append(subject)returnsubjects