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

import typing
import pathlib
from styxdefs import *
import dataclasses

DMRI_VOX2VOX_METADATA = Metadata(
    id="c170241b240c3ff4893542415ea2cb91ac0b3c6c.boutiques",
    name="dmri_vox2vox",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


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


def dmri_vox2vox(
    input_files: list[InputPathType],
    output_files: list[str],
    input_reference: InputPathType,
    output_reference: InputPathType,
    affine_registration: InputPathType,
    nonlinear_registration: InputPathType,
    input_directory: str | None = None,
    output_directory: str | None = None,
    inverse_nonlinear: bool = False,
    debug: bool = False,
    check_options: bool = False,
    help_: bool = False,
    version: bool = False,
    runner: Runner | None = None,
) -> DmriVox2voxOutputs:
    """
    Tool for voxel-to-voxel transformations in diffusion MRI data processing.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        input_files: Input text file(s).
        output_files: Output text file(s), as many as inputs.
        input_reference: Input reference volume.
        output_reference: Output reference volume.
        affine_registration: Affine registration file (.mat) to be applied\
            first.
        nonlinear_registration: Nonlinear registration file (.m3z) to be\
            applied second.
        input_directory: Input directory, if specified, names of input text\
            files are relative to this.
        output_directory: Output directory, if specified, names of output text\
            files are relative to this.
        inverse_nonlinear: Apply inverse of nonlinear warp when --regnl is used.
        debug: Turn on debugging.
        check_options: Check options and exit without running.
        help_: Print out information on how to use this program.
        version: Print out version and exit.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `DmriVox2voxOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(DMRI_VOX2VOX_METADATA)
    cargs = []
    cargs.append("dmri_vox2vox")
    cargs.extend([
        "--in",
        *[execution.input_file(f) for f in input_files]
    ])
    if input_directory is not None:
        cargs.extend([
            "--indir",
            input_directory
        ])
    cargs.extend([
        "--out",
        *output_files
    ])
    if output_directory is not None:
        cargs.extend([
            "--outdir",
            output_directory
        ])
    cargs.extend([
        "--inref",
        execution.input_file(input_reference)
    ])
    cargs.extend([
        "--outref",
        execution.input_file(output_reference)
    ])
    cargs.extend([
        "--reg",
        execution.input_file(affine_registration)
    ])
    cargs.extend([
        "--regnl",
        execution.input_file(nonlinear_registration)
    ])
    if inverse_nonlinear:
        cargs.append("--invnl")
    if debug:
        cargs.append("--debug")
    if check_options:
        cargs.append("--checkopts")
    if help_:
        cargs.append("--help")
    if version:
        cargs.append("--version")
    ret = DmriVox2voxOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "DMRI_VOX2VOX_METADATA",
    "DmriVox2voxOutputs",
    "dmri_vox2vox",
]
