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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRI_MODIFY_METADATA = Metadata(
    id="358c84f244977ad8d56905af20cc90fb0f1f3919.boutiques",
    name="mri_modify",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


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


def mri_modify(
    x_ras: list[float],
    y_ras: list[float],
    z_ras: list[float],
    cras: list[float],
    x_size: float,
    y_size: float,
    z_size: float,
    tr: float,
    te: float,
    ti: float,
    fa: float,
    xform: str,
    input_volume: InputPathType,
    output_volume: str,
    runner: Runner | None = None,
) -> MriModifyOutputs:
    """
    Tool for modifying MRI image headers.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        x_ras: X direction cosines (xr, xa, xs).
        y_ras: Y direction cosines (yr, ya, ys).
        z_ras: Z direction cosines (zr, za, zs).
        cras: Center RAS coordinates (cr, ca, cs).
        x_size: Size of voxel in X dimension.
        y_size: Size of voxel in Y dimension.
        z_size: Size of voxel in Z dimension.
        tr: Repetition time (TR).
        te: Echo time (TE).
        ti: Inversion time (TI).
        fa: Flip angle (degrees).
        xform: New transformation file name.
        input_volume: Input volume.
        output_volume: Output volume.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MriModifyOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRI_MODIFY_METADATA)
    cargs = []
    cargs.append("mri_modify")
    cargs.extend([
        "-xras",
        *map(str, x_ras)
    ])
    cargs.extend([
        "-yras",
        *map(str, y_ras)
    ])
    cargs.extend([
        "-zras",
        *map(str, z_ras)
    ])
    cargs.extend([
        "-cras",
        *map(str, cras)
    ])
    cargs.extend([
        "-xsize",
        str(x_size)
    ])
    cargs.extend([
        "-ysize",
        str(y_size)
    ])
    cargs.extend([
        "-zsize",
        str(z_size)
    ])
    cargs.extend([
        "-tr",
        str(tr)
    ])
    cargs.extend([
        "-te",
        str(te)
    ])
    cargs.extend([
        "-ti",
        str(ti)
    ])
    cargs.extend([
        "-fa",
        str(fa)
    ])
    cargs.extend([
        "-xform",
        xform
    ])
    cargs.append(execution.input_file(input_volume))
    cargs.append(output_volume)
    ret = MriModifyOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRI_MODIFY_METADATA",
    "MriModifyOutputs",
    "mri_modify",
]
