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

import typing
import pathlib
from styxdefs import *
import dataclasses

MULTIPLY_IMAGES_METADATA = Metadata(
    id="33f54529d3b0ca62abce96ec3a46f1a5f1f34ff3.boutiques",
    name="multiply_images",
    package="ants",
    container_image_tag="antsx/ants:v2.5.3",
)


class MultiplyImagesOutputs(typing.NamedTuple):
    """
    Output object returned when calling `multiply_images(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_product_image_outfile: OutputPathType
    """Average image file."""


def multiply_images(
    dimension: typing.Literal[3, 2],
    first_input: InputPathType,
    output_product_image: InputPathType,
    second_input_2: float | None = None,
    num_threads: int | None = 1,
    runner: Runner | None = None,
) -> MultiplyImagesOutputs:
    """
    Multiply 2 images; 2nd image file may also be floating point numerical value,
    and program will act accordingly -- i.e. read as a number. Program handles
    vector and tensor images as well.
    
    Author: Advanced Normalization Tools (ANTs) Contributors
    
    URL: https://github.com/ANTsX/ANTs
    
    Args:
        dimension: 3 or 2. Image dimension (2 or 3).
        first_input: Image 1.
        output_product_image: Outputfname.nii.gz: the name of the resulting\
            image.
        second_input_2: file or string or a float. Image 2 or multiplication\
            weight.
        num_threads: Number of itk threads to use.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MultiplyImagesOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MULTIPLY_IMAGES_METADATA)
    cargs = []
    cargs.append("MultiplyImages")
    cargs.append(str(dimension))
    cargs.append(execution.input_file(first_input))
    if second_input_2 is not None:
        cargs.append(str(second_input_2))
    cargs.append(execution.input_file(output_product_image))
    if num_threads is not None:
        cargs.append(str(num_threads))
    ret = MultiplyImagesOutputs(
        root=execution.output_file("."),
        output_product_image_outfile=execution.output_file(pathlib.Path(output_product_image).name),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MULTIPLY_IMAGES_METADATA",
    "MultiplyImagesOutputs",
    "multiply_images",
]
