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

import typing
import pathlib
from styxdefs import *
import dataclasses

SIENA_DIFF_METADATA = Metadata(
    id="e8aca2fd67e31bd3e2c0994ac03b8c6a57e6de78.boutiques",
    name="siena_diff",
    package="fsl",
    container_image_tag="brainlife/fsl:6.0.4-patched2",
)


class SienaDiffOutputs(typing.NamedTuple):
    """
    Output object returned when calling `siena_diff(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""


def siena_diff(
    input1_basename: str,
    input2_basename: str,
    debug_flag: bool = False,
    no_seg_flag: bool = False,
    self_corr_factor: float | None = None,
    ignore_z_flow_flag: bool = False,
    apply_std_mask_flag: bool = False,
    segment_options: str | None = None,
    runner: Runner | None = None,
) -> SienaDiffOutputs:
    """
    SIENA_diff: Analysis of longitudinal brain image differences.
    
    Author: FMRIB Analysis Group, University of Oxford
    
    URL: https://fsl.fmrib.ox.ac.uk/fsl/fslwiki
    
    Args:
        input1_basename: Input image 1 basename.
        input2_basename: Input image 2 basename.
        debug_flag: Debug - generate edge images and don't remove temporary\
            images.
        no_seg_flag: Don't segment grey+white separately (because there is poor\
            grey-white contrast).
        self_corr_factor: Apply self-calibrating correction factor.
        ignore_z_flow_flag: Ignore flow in z (may be beneficial if top of brain\
            is missing).
        apply_std_mask_flag: Apply <input1_basename>_stdmask to brain edge\
            points.
        segment_options: Options to be passed to segmentation (type 'fast' to\
            get these).
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `SienaDiffOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(SIENA_DIFF_METADATA)
    cargs = []
    cargs.append("siena_diff")
    cargs.append(input1_basename)
    cargs.append(input2_basename)
    if debug_flag:
        cargs.append("-d")
    if no_seg_flag:
        cargs.append("-2")
    if self_corr_factor is not None:
        cargs.extend([
            "-c",
            str(self_corr_factor)
        ])
    if ignore_z_flow_flag:
        cargs.append("-i")
    if apply_std_mask_flag:
        cargs.append("-m")
    if segment_options is not None:
        cargs.extend([
            "-s",
            segment_options
        ])
    ret = SienaDiffOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "SIENA_DIFF_METADATA",
    "SienaDiffOutputs",
    "siena_diff",
]
