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

import typing
import pathlib
from styxdefs import *
import dataclasses

DICOM_TO_RAW_METADATA = Metadata(
    id="7eb027b7c5690d1e6ebc29a721254ed558470f1d.boutiques",
    name="dicom_to_raw",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class DicomToRawOutputs(typing.NamedTuple):
    """
    Output object returned when calling `dicom_to_raw(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_raw_file: OutputPathType
    """Output raw file(s)"""


def dicom_to_raw(
    input_dicom: InputPathType,
    runner: Runner | None = None,
) -> DicomToRawOutputs:
    """
    Reads images from DICOM file and writes them to raw file(s).
    
    Author: AFNI Developers
    
    URL: https://afni.nimh.nih.gov/
    
    Args:
        input_dicom: Input DICOM file.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `DicomToRawOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(DICOM_TO_RAW_METADATA)
    cargs = []
    cargs.append("dicom_to_raw")
    cargs.append(execution.input_file(input_dicom))
    ret = DicomToRawOutputs(
        root=execution.output_file("."),
        output_raw_file=execution.output_file(pathlib.Path(input_dicom).name + ".raw.0001"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "DICOM_TO_RAW_METADATA",
    "DicomToRawOutputs",
    "dicom_to_raw",
]
