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

import typing
import pathlib
from styxdefs import *
import dataclasses

OCT_REGISTER_MOSAIC_METADATA = Metadata(
    id="3c0f1193be4788ada8c34632e6598409865db885.boutiques",
    name="oct_register_mosaic",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class OctRegisterMosaicOutputs(typing.NamedTuple):
    """
    Output object returned when calling `oct_register_mosaic(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    registered_output: OutputPathType
    """The registered output volume"""


def oct_register_mosaic(
    tiles_or_mosaic_list: list[str],
    output_volume: str,
    downsample: float | None = None,
    weight_file: InputPathType | None = None,
    runner: Runner | None = None,
) -> OctRegisterMosaicOutputs:
    """
    Tool for registering multiple OCT (Optical Coherence Tomography) tiles or a
    mosaic list into a single output volume.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        tiles_or_mosaic_list: OCT tile images to be registered or a file\
            listing the mosaic tiles.
        output_volume: Output registered volume.
        downsample: Use Gaussian downsampling specified number of times.
        weight_file: File with tile weights to use in tile averaging.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `OctRegisterMosaicOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(OCT_REGISTER_MOSAIC_METADATA)
    cargs = []
    cargs.append("oct_register_mosaic")
    cargs.extend(tiles_or_mosaic_list)
    cargs.append(output_volume)
    if downsample is not None:
        cargs.extend([
            "-D",
            str(downsample)
        ])
    if weight_file is not None:
        cargs.extend([
            "-W",
            execution.input_file(weight_file)
        ])
    ret = OctRegisterMosaicOutputs(
        root=execution.output_file("."),
        registered_output=execution.output_file(output_volume),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "OCT_REGISTER_MOSAIC_METADATA",
    "OctRegisterMosaicOutputs",
    "oct_register_mosaic",
]
