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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRIS_AA_SHRINKWRAP_METADATA = Metadata(
    id="35496254b602549d226c6de261156b86767e1155.boutiques",
    name="mris_AA_shrinkwrap",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


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


def mris_aa_shrinkwrap(
    t1_vol: InputPathType,
    pd_vol: InputPathType,
    output_dir: str,
    omit_self_intersection: bool = False,
    create_curvature_area: bool = False,
    average_curvature: float | None = 10,
    white_only: bool = False,
    runner: Runner | None = None,
) -> MrisAaShrinkwrapOutputs:
    """
    This program positions the tessellation of the cortical surface at the white
    matter surface, then the gray matter surface and generates surface files for
    these surfaces as well as a 'curvature' file for the cortical thickness, and a
    surface file which approximates layer IV of the cortical sheet.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        t1_vol: T1 volume file.
        pd_vol: PD volume file.
        output_dir: Output directory.
        omit_self_intersection: Omit self-intersection and only generate\
            gray/white surface.
        create_curvature_area: Create curvature and area files from white\
            matter surface.
        average_curvature: Average curvature values a specified number of times\
            (default=10).
        white_only: Only generate white matter surface.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MrisAaShrinkwrapOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRIS_AA_SHRINKWRAP_METADATA)
    cargs = []
    cargs.append("mris_AA_shrinkwrap")
    cargs.append(execution.input_file(t1_vol))
    cargs.append(execution.input_file(pd_vol))
    cargs.append(output_dir)
    if omit_self_intersection:
        cargs.append("-q")
    if create_curvature_area:
        cargs.append("-c")
    if average_curvature is not None:
        cargs.extend([
            "-a",
            str(average_curvature)
        ])
    if white_only:
        cargs.append("-whiteonly")
    ret = MrisAaShrinkwrapOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRIS_AA_SHRINKWRAP_METADATA",
    "MrisAaShrinkwrapOutputs",
    "mris_aa_shrinkwrap",
]
