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

import typing
import pathlib
from styxdefs import *
import dataclasses

V__MOVE_TO_SERIES_DIRS_METADATA = Metadata(
    id="43e65ff4ccb7c662ae1bcaef0b7fb14c99b76809.boutiques",
    name="@move.to.series.dirs",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


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


def v__move_to_series_dirs(
    dicom_files: list[InputPathType],
    action: typing.Literal["copy", "move"] | None = None,
    dprefix: str | None = None,
    tag: str | None = None,
    test: bool = False,
    help_: bool = False,
    hist: bool = False,
    ver: bool = False,
    runner: Runner | None = None,
) -> VMoveToSeriesDirsOutputs:
    """
    Partition DICOM files into series directories by copying or moving them to new
    series directories.
    
    Author: AFNI Developers
    
    URL: https://afni.nimh.nih.gov/
    
    Args:
        dicom_files: Specify input DICOM files (e.g., IMG*).
        action: Specify action to perform: copy or move. Default is copy.
        dprefix: Specify directory root for output series directories. Default\
            is current directory.
        tag: Specify the DICOM tag to use for partitioning. Default is\
            0020,0011 (REL Series Number).
        test: Run in test mode, only show what would be done without actually\
            moving any files.
        help_: Show help information.
        hist: Show modification history.
        ver: Show version number.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `VMoveToSeriesDirsOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V__MOVE_TO_SERIES_DIRS_METADATA)
    cargs = []
    cargs.append("@move.to.series.dirs")
    if action is not None:
        cargs.extend([
            "-action",
            action
        ])
    if dprefix is not None:
        cargs.extend([
            "-dprefix",
            dprefix
        ])
    if tag is not None:
        cargs.extend([
            "-tag",
            tag
        ])
    if test:
        cargs.append("-test")
    if help_:
        cargs.append("-help")
    if hist:
        cargs.append("-hist")
    if ver:
        cargs.append("-ver")
    cargs.extend([execution.input_file(f) for f in dicom_files])
    ret = VMoveToSeriesDirsOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "VMoveToSeriesDirsOutputs",
    "V__MOVE_TO_SERIES_DIRS_METADATA",
    "v__move_to_series_dirs",
]
