Пример #1
0
def atlas_download(atlas, atlas_dir, download_path):
    # Check if all the 4 .nii files are in the directory, else download again:
    if len(list((atlas_dir / atlas).glob("*.nii"))) < 4:
        atlas_dir.mkdir(exist_ok=True, parents=True)
        download(
            download_path,
            atlas_urls[atlas],
            install_path=atlas_dir,
            download_requires=download_requirements_gb[atlas],
            extract_requires=extract_requirements_gb[atlas],
        )

    else:
        print(f"Complete atlas already exists at "
              f"{atlas_dir}."
              f" Skipping download")
Пример #2
0
def main(atlas, atlas_dir, download_path):
    if not os.path.exists(os.path.join(atlas_dir, atlas, default_atlas_name)):
        ensure_directory_exists(atlas_dir)

        download(
            download_path,
            atlas_urls[atlas],
            atlas,
            install_path=atlas_dir,
            download_requires=download_requirements_gb[atlas],
            extract_requires=extract_requirements_gb[atlas],
        )

    else:
        print(f"Atlas already exists at "
              f"{atlas_dir}."
              f" Skipping download")