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

import typing
import pathlib
from styxdefs import *
import dataclasses

FSLCOMPLEX_METADATA = Metadata(
    id="7b0a519cc8c2bf2ab20b79371bcb5b1194faec91.boutiques",
    name="fslcomplex",
    package="fsl",
    container_image_tag="brainlife/fsl:6.0.4-patched2",
)


class FslcomplexOutputs(typing.NamedTuple):
    """
    Output object returned when calling `fslcomplex(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    result_output_file: OutputPathType
    """The resulting output file from the specified operation."""


def fslcomplex(
    input_file: InputPathType,
    output_file: InputPathType,
    output_type: typing.Literal["-realabs", "-realphase", "-realpolar", "-realcartesian", "-complex", "-complexpolar", "-complexsplit", "-complexmerge", "-copyonly"],
    start_vol: int | None = None,
    end_vol: int | None = None,
    runner: Runner | None = None,
) -> FslcomplexOutputs:
    """
    Tool for manipulating complex-valued MR data.
    
    Author: FMRIB Analysis Group, University of Oxford
    
    URL: https://fsl.fmrib.ox.ac.uk/fsl/fslwiki
    
    Args:
        input_file: Input volume (e.g. complexvol.nii.gz).
        output_file: Output volume (e.g. absvol.nii.gz).
        output_type: Output type (determines the operation to perform).
        start_vol: Start volume (optional).
        end_vol: End volume (optional).
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `FslcomplexOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(FSLCOMPLEX_METADATA)
    cargs = []
    cargs.append("fslcomplex")
    cargs.append(execution.input_file(input_file))
    cargs.append(execution.input_file(output_file))
    cargs.append(output_type)
    if start_vol is not None:
        cargs.append(str(start_vol))
    if end_vol is not None:
        cargs.append(str(end_vol))
    ret = FslcomplexOutputs(
        root=execution.output_file("."),
        result_output_file=execution.output_file(pathlib.Path(output_file).name),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "FSLCOMPLEX_METADATA",
    "FslcomplexOutputs",
    "fslcomplex",
]
