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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRIS_JACOBIAN_METADATA = Metadata(
    id="f32baf37cb24be970160e497e65bff0c90b9d331.boutiques",
    name="mris_jacobian",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MrisJacobianOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mris_jacobian(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_jacobian_file: OutputPathType
    """Output file containing the Jacobian of the surface mapping."""


def mris_jacobian(
    original_surface: InputPathType,
    mapped_surface: InputPathType,
    jacobian_file: str,
    log: bool = False,
    noscale: bool = False,
    invert: bool = False,
    runner: Runner | None = None,
) -> MrisJacobianOutputs:
    """
    This program computes the Jacobian of a surface mapping.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        original_surface: The original surface file.
        mapped_surface: The mapped surface file.
        jacobian_file: The output file name for the Jacobian.
        log: Compute and write out log of Jacobian.
        noscale: Don't scale Jacobian by total surface areas.
        invert: Compute -1/Jacobian for Jacobian < 1.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MrisJacobianOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRIS_JACOBIAN_METADATA)
    cargs = []
    cargs.append("mris_jacobian")
    cargs.append(execution.input_file(original_surface))
    cargs.append(execution.input_file(mapped_surface))
    cargs.append(jacobian_file)
    if log:
        cargs.append("-log")
    if noscale:
        cargs.append("-noscale")
    if invert:
        cargs.append("-invert")
    ret = MrisJacobianOutputs(
        root=execution.output_file("."),
        output_jacobian_file=execution.output_file(jacobian_file),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRIS_JACOBIAN_METADATA",
    "MrisJacobianOutputs",
    "mris_jacobian",
]
