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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRIS_MULTIMODAL_SURFACE_PLACEMENT_METADATA = Metadata(
    id="0cfb3e00bbd6f85769e241237d86c23951a65897.boutiques",
    name="mris_multimodal_surface_placement",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


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


def mris_multimodal_surface_placement(
    input_surface: InputPathType,
    output_surface: InputPathType,
    sphere_surface: InputPathType,
    normals: str,
    values_: str,
    step_size: float,
    number_of_steps: float,
    gradient_sigma: float,
    aseg_aparc: InputPathType,
    white_surface: InputPathType,
    prob_of_csf: float,
    t1_image: InputPathType,
    t2_image: InputPathType,
    flair_image: InputPathType,
    debug_vertex: float | None = None,
    min_max: bool = False,
    runner: Runner | None = None,
) -> MrisMultimodalSurfacePlacementOutputs:
    """
    FreeSurfer command for multimodal surface placement.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        input_surface: Input surface file.
        output_surface: Output surface file.
        sphere_surface: Sphere surface file.
        normals: Normals file in VTK format.
        values_: Values file in VTK format.
        step_size: Step size.
        number_of_steps: Number of steps.
        gradient_sigma: Gradient sigma value.
        aseg_aparc: ASEG APARC image file.
        white_surface: White surface file.
        prob_of_csf: Probability of CSF.
        t1_image: T1-weighted image file.
        t2_image: T2-weighted image file.
        flair_image: FLAIR image file.
        debug_vertex: Debug vertex index.
        min_max: Toggle between min or max operation.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MrisMultimodalSurfacePlacementOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRIS_MULTIMODAL_SURFACE_PLACEMENT_METADATA)
    cargs = []
    cargs.append("mris_multimodal_surface_placement")
    cargs.extend([
        "-i",
        execution.input_file(input_surface)
    ])
    cargs.extend([
        "-o",
        execution.input_file(output_surface)
    ])
    cargs.extend([
        "-b",
        execution.input_file(sphere_surface)
    ])
    cargs.extend([
        "-n",
        normals
    ])
    cargs.extend([
        "-v",
        values_
    ])
    if debug_vertex is not None:
        cargs.extend([
            "-d",
            str(debug_vertex)
        ])
    cargs.extend([
        "-s",
        str(step_size)
    ])
    cargs.extend([
        "-k",
        str(number_of_steps)
    ])
    cargs.extend([
        "-g",
        str(gradient_sigma)
    ])
    cargs.extend([
        "-a",
        execution.input_file(aseg_aparc)
    ])
    cargs.extend([
        "-w",
        execution.input_file(white_surface)
    ])
    cargs.extend([
        "-p",
        str(prob_of_csf)
    ])
    cargs.extend([
        "-t1",
        execution.input_file(t1_image)
    ])
    cargs.extend([
        "-t2",
        execution.input_file(t2_image)
    ])
    cargs.extend([
        "-flair",
        execution.input_file(flair_image)
    ])
    if min_max:
        cargs.append("-min/max")
    ret = MrisMultimodalSurfacePlacementOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRIS_MULTIMODAL_SURFACE_PLACEMENT_METADATA",
    "MrisMultimodalSurfacePlacementOutputs",
    "mris_multimodal_surface_placement",
]
