<reponame>Raelag0112/clinicadl
import click

from clinicadl.utils import cli_param


@click.command(name="trivial")
@cli_param.argument.caps_directory
@cli_param.argument.generated_caps
@cli_param.option.participant_list
@cli_param.option.n_subjects
@click.option(
    "--mask_path",
    type=str,
    default=None,
    help="Path to the extracted masks to generate the two labels. "
         "Default will try to download masks and store them at '~/.cache/clinicadl'.",
)
@click.option(
    "--atrophy_percent",
    type=float,
    default=60.0,
    help="Percentage of atrophy applied.",
)
def cli(
    caps_directory,
    generated_caps_directory,
    participants_tsv,
    n_subjects,
    mask_path,
    atrophy_percent,
):
    """Generation of trivial dataset with addition of synthetic brain atrophy.

    CAPS_DIRECTORY is the CAPS folder from where input brain images will be loaded.

    GENERATED_CAPS_DIRECTORY is a CAPS folder where the trivial dataset will be saved.
    """
    from .generate import generate_trivial_dataset

    generate_trivial_dataset(
        caps_directory=caps_directory,
        tsv_path=participants_tsv,
        output_dir=generated_caps_directory,
        n_subjects=n_subjects,
        mask_path=mask_path,
        atrophy_percent=atrophy_percent,
    )


if __name__ == "__main__":
    cli()

import click

from clinicadl.utils import cli_param


@click.command(name="trivial")
@cli_param.argument.caps_directory
@cli_param.argument.generated_caps
@cli_param.option.participant_list
@cli_param.option.n_subjects
@click.option(
    "--mask_path",
    type=str,
    default=None,
    help="Path to the extracted masks to generate the two labels. "
         "Default will try to download masks and store them at '~/.cache/clinicadl'.",
)
@click.option(
    "--atrophy_percent",
    type=float,
    default=60.0,
    help="Percentage of atrophy applied.",
)
def cli(
    caps_directory,
    generated_caps_directory,
    participants_tsv,
    n_subjects,
    mask_path,
    atrophy_percent,
):
    """Generation of trivial dataset with addition of synthetic brain atrophy.

    CAPS_DIRECTORY is the CAPS folder from where input brain images will be loaded.

    GENERATED_CAPS_DIRECTORY is a CAPS folder where the trivial dataset will be saved.
    """
    from .generate import generate_trivial_dataset

    generate_trivial_dataset(
        caps_directory=caps_directory,
        tsv_path=participants_tsv,
        output_dir=generated_caps_directory,
        n_subjects=n_subjects,
        mask_path=mask_path,
        atrophy_percent=atrophy_percent,
    )


if __name__ == "__main__":
    cli()
Generation of trivial dataset with addition of synthetic brain atrophy.      CAPS_DIRECTORY is the CAPS folder from where input brain images will be loaded.      GENERATED_CAPS_DIRECTORY is a CAPS folder where the trivial dataset will be saved.