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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRIS_EXTRACT_PATCHES_METADATA = Metadata(
    id="4b1b272c0e5d898fdbf11dee43aa5f15d5fc44a4.boutiques",
    name="mris_extract_patches",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MrisExtractPatchesOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mris_extract_patches(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""


def mris_extract_patches(
    subject: str,
    output_dir: str,
    runner: Runner | None = None,
) -> MrisExtractPatchesOutputs:
    """
    A tool for extracting patches from brain surfaces.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        subject: Subject from which patches are to be extracted.
        output_dir: Output directory where patches will be saved.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MrisExtractPatchesOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRIS_EXTRACT_PATCHES_METADATA)
    cargs = []
    cargs.append("mris_extract_patches")
    cargs.append(subject)
    cargs.append(output_dir)
    ret = MrisExtractPatchesOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRIS_EXTRACT_PATCHES_METADATA",
    "MrisExtractPatchesOutputs",
    "mris_extract_patches",
]
