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

import typing
import pathlib
from styxdefs import *
import dataclasses

FIXUP_MNI_PATHS_METADATA = Metadata(
    id="2bf5837eea05322482ae33a8bcc9d1f47a565a04.boutiques",
    name="fixup_mni_paths",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class FixupMniPathsOutputs(typing.NamedTuple):
    """
    Output object returned when calling `fixup_mni_paths(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    autocrop_backup: OutputPathType
    """Original file backup for autocrop"""
    field2imp_backup: OutputPathType
    """Original file backup for field2imp"""
    imp2field_backup: OutputPathType
    """Original file backup for imp2field"""
    make_template_backup: OutputPathType
    """Original file backup for make_template"""
    mritoself_backup: OutputPathType
    """Original file backup for mritoself"""
    mritotal_backup: OutputPathType
    """Original file backup for mritotal"""
    nu_correct_backup: OutputPathType
    """Original file backup for nu_correct"""
    nu_estimate_backup: OutputPathType
    """Original file backup for nu_estimate"""
    nu_estimate_np_and_em_backup: OutputPathType
    """Original file backup for nu_estimate_np_and_em"""
    nu_evaluate_backup: OutputPathType
    """Original file backup for nu_evaluate"""
    resample_labels_backup: OutputPathType
    """Original file backup for resample_labels"""
    sharpen_volume_backup: OutputPathType
    """Original file backup for sharpen_volume"""
    xfmtool_backup: OutputPathType
    """Original file backup for xfmtool"""


def fixup_mni_paths(
    verbose: bool = False,
    runner: Runner | None = None,
) -> FixupMniPathsOutputs:
    """
    A utility for patching MNI tools to ensure correct paths are used.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        verbose: Provide verbose output during the patch process.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `FixupMniPathsOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(FIXUP_MNI_PATHS_METADATA)
    cargs = []
    cargs.append("fixup_mni_paths")
    if verbose:
        cargs.append("-v")
    ret = FixupMniPathsOutputs(
        root=execution.output_file("."),
        autocrop_backup=execution.output_file("autocrop.old"),
        field2imp_backup=execution.output_file("field2imp.old"),
        imp2field_backup=execution.output_file("imp2field.old"),
        make_template_backup=execution.output_file("make_template.old"),
        mritoself_backup=execution.output_file("mritoself.old"),
        mritotal_backup=execution.output_file("mritotal.old"),
        nu_correct_backup=execution.output_file("nu_correct.old"),
        nu_estimate_backup=execution.output_file("nu_estimate.old"),
        nu_estimate_np_and_em_backup=execution.output_file("nu_estimate_np_and_em.old"),
        nu_evaluate_backup=execution.output_file("nu_evaluate.old"),
        resample_labels_backup=execution.output_file("resample_labels.old"),
        sharpen_volume_backup=execution.output_file("sharpen_volume.old"),
        xfmtool_backup=execution.output_file("xfmtool.old"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "FIXUP_MNI_PATHS_METADATA",
    "FixupMniPathsOutputs",
    "fixup_mni_paths",
]
