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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRI_COPY_PARAMS_METADATA = Metadata(
    id="04ff7772827c0d2910e0be4cad90ac6d7da938f2.boutiques",
    name="mri_copy_params",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MriCopyParamsOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mri_copy_params(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_volume: OutputPathType
    """Output volume file with parameters copied."""


def mri_copy_params(
    in_vol: InputPathType,
    template_vol: InputPathType,
    out_vol: str,
    size_flag: bool = False,
    runner: Runner | None = None,
) -> MriCopyParamsOutputs:
    """
    A tool to replace the volume parameters of an input volume with those of a
    template volume.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        in_vol: Input volume file whose parameters will be replaced.
        template_vol: Template volume file whose parameters will be copied.
        out_vol: Output volume file with replaced parameters.
        size_flag: Force copying of voxel sizes when resolutions vary.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MriCopyParamsOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRI_COPY_PARAMS_METADATA)
    cargs = []
    cargs.append("mri_copy_params")
    cargs.append(execution.input_file(in_vol))
    cargs.append(execution.input_file(template_vol))
    cargs.append(out_vol)
    if size_flag:
        cargs.append("--size")
    ret = MriCopyParamsOutputs(
        root=execution.output_file("."),
        output_volume=execution.output_file(out_vol),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRI_COPY_PARAMS_METADATA",
    "MriCopyParamsOutputs",
    "mri_copy_params",
]
