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

import typing
import pathlib
from styxdefs import *
import dataclasses

UNPACK_MNC_TCL_METADATA = Metadata(
    id="54eec142d994829a43977ef77cc7f837f8d06635.boutiques",
    name="unpack_mnc.tcl",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class UnpackMncTclOutputs(typing.NamedTuple):
    """
    Output object returned when calling `unpack_mnc_tcl(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    unpacked_file: OutputPathType | None
    """Unpacked output MINC file"""


def unpack_mnc_tcl(
    verbose: bool = False,
    output_dir: str | None = None,
    input_file: InputPathType | None = None,
    runner: Runner | None = None,
) -> UnpackMncTclOutputs:
    """
    A tool for unpacking MINC format images.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        verbose: Verbose output messages.
        output_dir: Output directory for unpacked files.
        input_file: Specify a custom input file for unpacking.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `UnpackMncTclOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(UNPACK_MNC_TCL_METADATA)
    cargs = []
    cargs.append("unpack_mnc.tcl")
    if verbose:
        cargs.append("-v")
    if output_dir is not None:
        cargs.extend([
            "-o",
            output_dir
        ])
    if input_file is not None:
        cargs.extend([
            "-i",
            execution.input_file(input_file)
        ])
    ret = UnpackMncTclOutputs(
        root=execution.output_file("."),
        unpacked_file=execution.output_file(output_dir + "/unpacked_data.mnc") if (output_dir is not None) else None,
    )
    execution.run(cargs)
    return ret


__all__ = [
    "UNPACK_MNC_TCL_METADATA",
    "UnpackMncTclOutputs",
    "unpack_mnc_tcl",
]
