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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRI_VOLSYNTH_METADATA = Metadata(
    id="656047848a60982264a81504c030cd41366f6765.boutiques",
    name="mri_volsynth",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


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


def mri_volsynth(
    output_volid: str,
    template: str | None = None,
    nframes: float | None = None,
    offset_flag: bool = False,
    offset_mid_flag: bool = False,
    curv: str | None = None,
    dim: list[float] | None = None,
    res: list[float] | None = None,
    vox_size: list[float] | None = None,
    tr: float | None = None,
    cdircos: list[float] | None = None,
    rdircos: list[float] | None = None,
    sdircos: list[float] | None = None,
    c_ras: list[float] | None = None,
    p0: list[float] | None = None,
    precision: str | None = None,
    seed: float | None = None,
    seedfile: InputPathType | None = None,
    pdf: str | None = None,
    bb: list[float] | None = None,
    gmean: float | None = None,
    gstd: float | None = None,
    delta_crsf: list[float] | None = None,
    delta_val: float | None = None,
    delta_val_off: float | None = None,
    grid: list[float] | None = None,
    dof: float | None = None,
    dof_num: float | None = None,
    dof_den: float | None = None,
    rescale_flag: bool = False,
    val_a: float | None = None,
    val_b: float | None = None,
    vox_radius: float | None = None,
    mm_radius: float | None = None,
    sphere_center: list[float] | None = None,
    hsc: list[float] | None = None,
    abs_flag: bool = False,
    cp: InputPathType | None = None,
    spike: float | None = None,
    fwhm: float | None = None,
    sum2: InputPathType | None = None,
    dim_surf_flag: bool = False,
    ctab: InputPathType | None = None,
    runner: Runner | None = None,
) -> MriVolsynthOutputs:
    """
    Synthesizes a volume with specified geometry and probability distribution
    function.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        output_volid: Output volume path id and format.
        template: Template volume id.
        nframes: Override template number of frames.
        offset_flag: Use template as intensity offset.
        offset_mid_flag: Use middle frame of template as intensity offset.
        curv: Save output as curvature, uses lh.thickness as template. Requires\
            subject and hemisphere.
        dim: Specify dimensionality nc nr ns nf.
        res: Voxel resolution dc dr ds df (df is TR, in msec).
        vox_size: Change template voxel resolution and dimension dc dr ds.
        tr: Time between frames in msec.
        cdircos: Column cosine direction x, y, z.
        rdircos: Row cosine direction x, y, z.
        sdircos: Slice cosine direction x, y, z.
        c_ras: RAS coordinates of 'center' voxel c_r c_a c_s.
        p0: First voxel coordinates p0r p0a p0s.
        precision: Precision of the output (e.g., float).
        seed: Seed for the random number generator.
        seedfile: Write seed value to this file.
        pdf: Probability distribution function (e.g., gaussian, uniform, const).
        bb: Bounding box c r s dc dr ds (In=ValA, Out=ValB).
        gmean: Mean for the gaussian distribution.
        gstd: Standard deviation for the gaussian distribution.
        delta_crsf: Delta's col, row, slice, and frame coordinates.
        delta_val: Delta value.
        delta_val_off: Delta background value.
        grid: Grid dimensions dcol, drow, dslice.
        dof: Degrees of freedom for t and chi2 distributions.
        dof_num: Numerator degrees of freedom for F distribution.
        dof_den: Denominator degrees of freedom for F distribution.
        rescale_flag: Rescale z, t, F, or chi2 after smoothing.
        val_a: Set ValA.
        val_b: Set ValB.
        vox_radius: Radius in voxels for sphere.
        mm_radius: Radius in mm for sphere.
        sphere_center: Sphere center coordinates column, row, slice.
        hsc: Multiply each frame by a random number between min and max.
        abs_flag: Compute absolute value.
        cp: Set control point voxels to 1.
        spike: Set all values at a given time point to 1e9.
        fwhm: Smooth by Full Width at Half Maximum (FWHM) in mm.
        sum2: Save sum of volume squared into specified file.
        dim_surf_flag: Set dimension to nvertices x 1 x 1.
        ctab: Embed color table.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MriVolsynthOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRI_VOLSYNTH_METADATA)
    cargs = []
    cargs.append("mri_volsynth")
    cargs.extend([
        "--o",
        output_volid
    ])
    if template is not None:
        cargs.extend([
            "--template",
            template
        ])
    if nframes is not None:
        cargs.extend([
            "--nframes",
            str(nframes)
        ])
    if offset_flag:
        cargs.append("--offset")
    if offset_mid_flag:
        cargs.append("--offset-mid")
    if curv is not None:
        cargs.extend([
            "--curv",
            curv
        ])
    if dim is not None:
        cargs.extend([
            "--dim",
            *map(str, dim)
        ])
    if res is not None:
        cargs.extend([
            "--res",
            *map(str, res)
        ])
    if vox_size is not None:
        cargs.extend([
            "--vox-size",
            *map(str, vox_size)
        ])
    if tr is not None:
        cargs.extend([
            "--tr",
            str(tr)
        ])
    if cdircos is not None:
        cargs.extend([
            "--cdircos",
            *map(str, cdircos)
        ])
    if rdircos is not None:
        cargs.extend([
            "--rdircos",
            *map(str, rdircos)
        ])
    if sdircos is not None:
        cargs.extend([
            "--sdircos",
            *map(str, sdircos)
        ])
    if c_ras is not None:
        cargs.extend([
            "--c_ras",
            *map(str, c_ras)
        ])
    if p0 is not None:
        cargs.extend([
            "--p0",
            *map(str, p0)
        ])
    if precision is not None:
        cargs.extend([
            "--precision",
            precision
        ])
    if seed is not None:
        cargs.extend([
            "--seed",
            str(seed)
        ])
    if seedfile is not None:
        cargs.extend([
            "--seedfile",
            execution.input_file(seedfile)
        ])
    if pdf is not None:
        cargs.extend([
            "--pdf",
            pdf
        ])
    if bb is not None:
        cargs.extend([
            "--bb",
            *map(str, bb)
        ])
    if gmean is not None:
        cargs.extend([
            "--gmean",
            str(gmean)
        ])
    if gstd is not None:
        cargs.extend([
            "--gstd",
            str(gstd)
        ])
    if delta_crsf is not None:
        cargs.extend([
            "--delta-crsf",
            *map(str, delta_crsf)
        ])
    if delta_val is not None:
        cargs.extend([
            "--delta-val",
            str(delta_val)
        ])
    if delta_val_off is not None:
        cargs.extend([
            "--delta-val-off",
            str(delta_val_off)
        ])
    if grid is not None:
        cargs.extend([
            "--grid",
            *map(str, grid)
        ])
    if dof is not None:
        cargs.extend([
            "--dof",
            str(dof)
        ])
    if dof_num is not None:
        cargs.extend([
            "--dof-num",
            str(dof_num)
        ])
    if dof_den is not None:
        cargs.extend([
            "--dof-den",
            str(dof_den)
        ])
    if rescale_flag:
        cargs.append("--rescale")
    if val_a is not None:
        cargs.extend([
            "--val-a",
            str(val_a)
        ])
    if val_b is not None:
        cargs.extend([
            "--val-b",
            str(val_b)
        ])
    if vox_radius is not None:
        cargs.extend([
            "--vox-radius",
            str(vox_radius)
        ])
    if mm_radius is not None:
        cargs.extend([
            "--mm-radius",
            str(mm_radius)
        ])
    if sphere_center is not None:
        cargs.extend([
            "--sphere-center",
            *map(str, sphere_center)
        ])
    if hsc is not None:
        cargs.extend([
            "--hsc",
            *map(str, hsc)
        ])
    if abs_flag:
        cargs.append("--abs")
    if cp is not None:
        cargs.extend([
            "--cp",
            execution.input_file(cp)
        ])
    if spike is not None:
        cargs.extend([
            "--spike",
            str(spike)
        ])
    if fwhm is not None:
        cargs.extend([
            "--fwhm",
            str(fwhm)
        ])
    if sum2 is not None:
        cargs.extend([
            "--sum2",
            execution.input_file(sum2)
        ])
    if dim_surf_flag:
        cargs.append("--dim-surf")
    if ctab is not None:
        cargs.extend([
            "--ctab",
            execution.input_file(ctab)
        ])
    ret = MriVolsynthOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRI_VOLSYNTH_METADATA",
    "MriVolsynthOutputs",
    "mri_volsynth",
]
