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

import typing
import pathlib
from styxdefs import *
import dataclasses

FIX_SUBJECT_METADATA = Metadata(
    id="61bfaf4767ebcb038e8eec8be58f3650a3ee7f43.boutiques",
    name="fix_subject",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


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


def fix_subject(
    arguments: str | None = None,
    runner: Runner | None = None,
) -> FixSubjectOutputs:
    """
    Tool to fix subjects in FreeSurfer, encountered errors due to incorrect path
    handling.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        arguments: Arguments for fix_subject command. Currently, help output\
            shows directory errors. Ensure the correct paths are used.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `FixSubjectOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(FIX_SUBJECT_METADATA)
    cargs = []
    cargs.append("fix_subject")
    if arguments is not None:
        cargs.append(arguments)
    ret = FixSubjectOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "FIX_SUBJECT_METADATA",
    "FixSubjectOutputs",
    "fix_subject",
]
