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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRI_SYNTHESIZE_METADATA = Metadata(
    id="f7b287047be218e070a0e814059c1a76d0ae4655.boutiques",
    name="mri_synthesize",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MriSynthesizeOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mri_synthesize(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    synthesized_output: OutputPathType
    """The synthesized FLASH acquisition output volume."""


def mri_synthesize(
    tr: float,
    alpha: float,
    te: float,
    t1_volume: InputPathType,
    pd_volume: InputPathType,
    output_volume: str,
    fixed_weight: bool = False,
    runner: Runner | None = None,
) -> MriSynthesizeOutputs:
    """
    This program synthesizes a FLASH acquisition based on previously computed T1/PD
    maps.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        tr: Repetition time (TR) for the synthesis.
        alpha: Flip angle (alpha) in degrees.
        te: Echo time (TE) for the synthesis.
        t1_volume: Path to the T1 volume.
        pd_volume: Path to the PD volume.
        output_volume: Path for the output volume.
        fixed_weight: Use a fixed weighting to generate an output volume with\
            optimal gray/white contrast.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MriSynthesizeOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRI_SYNTHESIZE_METADATA)
    cargs = []
    cargs.append("mri_synthesize")
    cargs.append(str(tr))
    cargs.append(str(alpha))
    cargs.append(str(te))
    cargs.append(execution.input_file(t1_volume))
    cargs.append(execution.input_file(pd_volume))
    cargs.append(output_volume)
    if fixed_weight:
        cargs.append("-w")
    ret = MriSynthesizeOutputs(
        root=execution.output_file("."),
        synthesized_output=execution.output_file(output_volume),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRI_SYNTHESIZE_METADATA",
    "MriSynthesizeOutputs",
    "mri_synthesize",
]
