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

import typing
import pathlib
from styxdefs import *
import dataclasses

ROBUSTFOV_METADATA = Metadata(
    id="ba96504ba58594a00f41b8ac2107f15c773bd4a9.boutiques",
    name="robustfov",
    package="fsl",
    container_image_tag="mcin/fsl:6.0.5",
)


class RobustfovOutputs(typing.NamedTuple):
    """
    Output object returned when calling `robustfov(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_roi_volume: OutputPathType
    """ROI volume output"""
    output_matrix_file: OutputPathType
    """Matrix output (ROI to full FOV)"""


def robustfov(
    input_file: InputPathType,
    runner: Runner | None = None,
) -> RobustfovOutputs:
    """
    Reduce FOV of image to remove lower head and neck.
    
    Author: University of Oxford (Mark Jenkinson)
    
    URL: https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/robustfov
    
    Args:
        input_file: Input image file.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `RobustfovOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(ROBUSTFOV_METADATA)
    cargs = []
    cargs.append("robustfov")
    cargs.append("[OPTIONS]")
    cargs.append("-i")
    cargs.extend([
        "-i",
        execution.input_file(input_file)
    ])
    cargs.append("[-r")
    cargs.append("OUTPUT_IMAGE]")
    ret = RobustfovOutputs(
        root=execution.output_file("."),
        output_roi_volume=execution.output_file("[OUTPUT_IMAGE].nii.gz"),
        output_matrix_file=execution.output_file("[MATRIX_OUTPUT].txt"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "ROBUSTFOV_METADATA",
    "RobustfovOutputs",
    "robustfov",
]
