Ejemplo n.º 1
0
def prep_registration(args):
    logging.info("Checking whether the atlas exists")
    _, atlas_files_exist = check_atlas_install()
    if not atlas_files_exist:
        logging.warning("Atlas does not exist, downloading.")
        if args.download_path is None:
            args.download_path = os.path.join(temp_dir_path, "atlas.tar.gz")
        atlas_download.main(args.atlas, args.install_path, args.download_path)
        amend_cfg(
            new_atlas_folder=args.install_path, atlas=args.atlas,
        )
    if args.registration_config is None:
        args.registration_config = source_files.source_custom_config()

    logging.debug("Making registration directory")
    ensure_directory_exists(args.registration_output_folder)

    logging.debug("Copying registration config to output directory")
    copy_registration_config(
        args.registration_config, args.registration_output_folder
    )

    additional_images_downsample = {}
    if args.downsample_images:
        for idx, images in enumerate(args.downsample_images):
            name = Path(images).name
            additional_images_downsample[name] = images

    return args, additional_images_downsample
Ejemplo n.º 2
0
def prep_registration(args):
    """ If an atlas is not available, download it.
    """
    logging.info("Checking whether the atlas exists")
    _, atlas_files_exist = check_atlas_install(args.registration_config)

    if not atlas_files_exist:
        logging.warning("Atlas does not exist, downloading.")
        atlas_download(args.atlas, args.install_path, args.download_path)
        amend_cfg(
            new_atlas_folder=args.install_path,
            atlas=args.atlas,
        )

    logging.debug("Making registration directory")
    ensure_directory_exists(args.registration_output_folder)

    logging.debug("Copying registration config to output directory")
    copy_registration_config(args.registration_config,
                             args.registration_output_folder)

    additional_images_downsample = {}
    if args.downsample_images:
        for idx, images in enumerate(args.downsample_images):
            name = Path(images).name
            additional_images_downsample[name] = images

    return args, additional_images_downsample
Ejemplo n.º 3
0
def main():
    args = download_parser().parse_args()
    if not args.no_atlas:
        atlas_download(args.atlas, args.install_path, args.download_path)
    if not args.no_amend_config:
        print(f"install: {args.install_path}")
        amend_cfg(
            new_atlas_folder=args.install_path,
            atlas=args.atlas,
        )
Ejemplo n.º 4
0
def main():
    args = download_parser().parse_args()
    if args.download_path is None:
        args.download_path = os.path.join(temp_dir_path, "atlas.tar.gz")
    if not args.no_atlas:
        atlas.main(args.atlas, args.install_path, args.download_path)
    if not args.no_amend_config:
        amend_cfg(
            new_atlas_folder=args.install_path, atlas=args.atlas,
        )