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

import typing
import pathlib
from styxdefs import *
import dataclasses

V__SHIFT_VOLUME_METADATA = Metadata(
    id="8632323dd36a0ba5f059c998ffcd7826b058d4be.boutiques",
    name="@Shift_Volume",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class VShiftVolumeOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v__shift_volume(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_file: OutputPathType
    """Shifted output dataset."""


def v__shift_volume(
    dset: InputPathType,
    prefix: str,
    rai_shift_vector: list[float] | None = None,
    mni_anat_to_mni: bool = False,
    mni_to_mni_anat: bool = False,
    no_cp: bool = False,
    runner: Runner | None = None,
) -> VShiftVolumeOutputs:
    """
    Tool to shift a dataset in the RAI coordinate system or between MNI anatomical
    space and MNI space.
    
    Author: AFNI Developers
    
    URL: https://afni.nimh.nih.gov/
    
    Args:
        dset: Input dataset, typically an anatomical dataset to be aligned to\
            BASE.
        prefix: Prefix for the output dataset.
        rai_shift_vector: Move dataset by dR, dA, dI mm (RAI coordinate system).
        mni_anat_to_mni: Move dataset from MNI Anatomical space to MNI space\
            (equivalent to -rai_shift 0 -4 -5).
        mni_to_mni_anat: Move dataset from MNI space to MNI Anatomical space\
            (equivalent to -rai_shift 0 4 5).
        no_cp: Do not create new data, shift the existing ones (use with\
            caution).
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `VShiftVolumeOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V__SHIFT_VOLUME_METADATA)
    cargs = []
    cargs.append("@Shift_Volume")
    if rai_shift_vector is not None:
        cargs.extend([
            "-rai_shift",
            *map(str, rai_shift_vector)
        ])
    if mni_anat_to_mni:
        cargs.append("-MNI_Anat_to_MNI")
    if mni_to_mni_anat:
        cargs.append("-MNI_to_MNI_Anat")
    cargs.extend([
        "-dset",
        execution.input_file(dset)
    ])
    if no_cp:
        cargs.append("-no_cp")
    cargs.extend([
        "-prefix",
        prefix
    ])
    ret = VShiftVolumeOutputs(
        root=execution.output_file("."),
        output_file=execution.output_file(prefix + ".nii.gz"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "VShiftVolumeOutputs",
    "V__SHIFT_VOLUME_METADATA",
    "v__shift_volume",
]
