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

import typing
import pathlib
from styxdefs import *
import dataclasses

CONVERT_TO_JPG_METADATA = Metadata(
    id="5bc8a9ac227d992d762dc5365725a949c90f5c17.boutiques",
    name="ConvertToJpg",
    package="ants",
    container_image_tag="antsx/ants:v2.5.3",
)


class ConvertToJpgOutputs(typing.NamedTuple):
    """
    Output object returned when calling `convert_to_jpg(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_jpg: OutputPathType
    """The converted JPG image."""


def convert_to_jpg(
    infile: InputPathType,
    outfile: str,
    runner: Runner | None = None,
) -> ConvertToJpgOutputs:
    """
    A tool to convert NIfTI images to JPG format.
    
    Author: ANTs Developers
    
    URL: https://github.com/ANTsX/ANTs
    
    Args:
        infile: The input file in NIfTI format.
        outfile: The output file in JPG format.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `ConvertToJpgOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(CONVERT_TO_JPG_METADATA)
    cargs = []
    cargs.append("ConvertToJpg" + execution.input_file(infile) + outfile)
    ret = ConvertToJpgOutputs(
        root=execution.output_file("."),
        output_jpg=execution.output_file(outfile),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "CONVERT_TO_JPG_METADATA",
    "ConvertToJpgOutputs",
    "convert_to_jpg",
]
