# This file was auto generated by Styx.
# Do not edit this file directly.

import typing
import pathlib
from styxdefs import *
import dataclasses

PARC_ATLAS_JACKKNIFE_TEST_METADATA = Metadata(
    id="c3bca782ff73ffb7144b8a68ae203b8cb4791e7f.boutiques",
    name="parc_atlas_jackknife_test",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class ParcAtlasJackknifeTestOutputs(typing.NamedTuple):
    """
    Output object returned when calling `parc_atlas_jackknife_test(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    jackknife_output: OutputPathType
    """Output files written to the directory named 'jackknife'."""


def parc_atlas_jackknife_test(
    register: bool = False,
    reg_dist: str | None = None,
    reg_append: str | None = None,
    reg_copy: str | None = None,
    train: bool = False,
    classify: bool = False,
    test: bool = False,
    all_: bool = False,
    subjects_dir: str | None = None,
    freesurfer_home: str | None = None,
    binaries_path: str | None = None,
    dontrun: bool = False,
    runner: Runner | None = None,
) -> ParcAtlasJackknifeTestOutputs:
    """
    Tool for conducting a jackknife accuracy test using FreeSurfer atlases.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        register: Run mris_register: creates .sphere.reg files.
        reg_dist: Run mris_register with '-dist <arg>' flag.
        reg_append: Append <string> to end of ?h.sphere.reg.
        reg_copy: Copy ?h.sphere.reg<string> ?h.sphere.reg.
        train: Run mris_ca_train: creates .gcs files.
        classify: Run mris_ca_label: creates .annot files.
        test: Run mris_compute_parc_overlap.
        all_: Run train, classify, and test.
        subjects_dir: Override default subjects directory.
        freesurfer_home: Source a new FREESURFER_HOME.
        binaries_path: Specify override path to binaries.
        dontrun: Don't execute the commands.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `ParcAtlasJackknifeTestOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(PARC_ATLAS_JACKKNIFE_TEST_METADATA)
    cargs = []
    cargs.append("parc_atlas_jackknife_test")
    if register:
        cargs.append("-register")
    if reg_dist is not None:
        cargs.extend([
            "-reg_dist",
            reg_dist
        ])
    if reg_append is not None:
        cargs.extend([
            "-reg_append",
            reg_append
        ])
    if reg_copy is not None:
        cargs.extend([
            "-reg_copy",
            reg_copy
        ])
    if train:
        cargs.append("-train")
    if classify:
        cargs.append("-classify")
    if test:
        cargs.append("-test")
    if all_:
        cargs.append("-all")
    if subjects_dir is not None:
        cargs.extend([
            "-sd",
            subjects_dir
        ])
    if freesurfer_home is not None:
        cargs.extend([
            "-fshome",
            freesurfer_home
        ])
    if binaries_path is not None:
        cargs.extend([
            "-binhome",
            binaries_path
        ])
    if dontrun:
        cargs.append("-dontrun")
    ret = ParcAtlasJackknifeTestOutputs(
        root=execution.output_file("."),
        jackknife_output=execution.output_file("jackknife/*"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "PARC_ATLAS_JACKKNIFE_TEST_METADATA",
    "ParcAtlasJackknifeTestOutputs",
    "parc_atlas_jackknife_test",
]
