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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRI_COMPUTE_CHANGE_MAP_METADATA = Metadata(
    id="4cf0713520dd67c2b0f360d78cb6a13011d05e50.boutiques",
    name="mri_compute_change_map",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MriComputeChangeMapOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mri_compute_change_map(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    out_change_map: OutputPathType
    """Output change map registered with Volume 1"""


def mri_compute_change_map(
    volume1: InputPathType,
    volume2: InputPathType,
    transform: InputPathType,
    outvolume: str,
    mean_filter: bool = False,
    gaussian_sigma: float | None = None,
    runner: Runner | None = None,
) -> MriComputeChangeMapOutputs:
    """
    Compute the change map between two MRI volumes.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        volume1: First volume (e.g. volume1.mgz).
        volume2: Second volume, transformed into the space of Volume 1 (e.g.\
            volume2.mgz).
        transform: Transform that takes Volume 2 coordinates into Volume 1\
            space.
        outvolume: Output change map volume (e.g. change_map.mgz).
        mean_filter: Apply mean filter to the output before writing.
        gaussian_sigma: Smooth with Gaussian filter of specified sigma before\
            writing.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MriComputeChangeMapOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRI_COMPUTE_CHANGE_MAP_METADATA)
    cargs = []
    cargs.append("mri_compute_change_map")
    if mean_filter:
        cargs.append("-m")
    if gaussian_sigma is not None:
        cargs.extend([
            "-s",
            str(gaussian_sigma)
        ])
    cargs.append(execution.input_file(volume1))
    cargs.append(execution.input_file(volume2))
    cargs.append(execution.input_file(transform))
    cargs.append(outvolume)
    ret = MriComputeChangeMapOutputs(
        root=execution.output_file("."),
        out_change_map=execution.output_file(outvolume),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRI_COMPUTE_CHANGE_MAP_METADATA",
    "MriComputeChangeMapOutputs",
    "mri_compute_change_map",
]
