def _fetch_template_surface_files( template: str, data_dir: Union[str, Path], layer: Optional[str] = None, ) -> Tuple[str, str]: """Fetches surface files. Parameters ---------- template : str Name of the surface template. Valid values are "fslr32k", "fsaverage", "fsaverage3", "fsaverage4", "fsaverage5", "fsaverage6", "civet41k", "civet164k". layer : str, optional Name of the cortical surface of interest. Valid values are "white", "smoothwm", "pial", "inflated", "sphere" for fsaverage surfaces; "midthickness", "inflated", "vinflated" for "fslr32k"; "mid, "white" for civet surfaces; and "sphere" for "civet41k" If None, defaults to "pial", "midthickness", or "mid", by default None. data_dir : str, optional Directory to save the data, by default None. Returns ------- Tuple of str Surface files. """ if template == "fslr32k": layer = layer if layer else "midthickness" bunch = nnt_datasets.fetch_conte69(data_dir=str(data_dir)) elif template == "civet41k" or template == "civet164k": layer = layer if layer else "mid" if layer == "sphere": return _fetch_civet_spheres(template, data_dir=Path(data_dir)) else: bunch = nnt_datasets.fetch_civet(density=template[5:], version="v2", data_dir=str(data_dir)) else: layer = layer if layer else "pial" bunch = nnt_datasets.fetch_fsaverage(version=template, data_dir=str(data_dir)) return bunch[layer]
def test_fetch_conte69(tmpdir): conte = datasets.fetch_conte69(data_dir=tmpdir, verbose=0) assert all( hasattr(conte, k) for k in ['midthickness', 'inflated', 'vinflated', 'info'])