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

import typing
import pathlib
from styxdefs import *
import dataclasses

TKREGISTERFV_METADATA = Metadata(
    id="5ebc1a63857c8578925dcc917e8e3ae5ac3c4e9b.boutiques",
    name="tkregisterfv",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


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


def tkregisterfv(
    reg: InputPathType,
    mov: InputPathType | None = None,
    targ: InputPathType | None = None,
    subject: str | None = None,
    fstarg: InputPathType | None = None,
    sd: str | None = None,
    seg: InputPathType | None = None,
    aseg_flag: bool = False,
    aparc_aseg_flag: bool = False,
    opacity: float | None = None,
    surfs_flag: bool = False,
    pial_surfs_flag: bool = False,
    all_surfs_flag: bool = False,
    no_surfs_flag: bool = False,
    lh_only_flag: bool = False,
    rh_only_flag: bool = False,
    surf: InputPathType | None = None,
    aux_s: InputPathType | None = None,
    plane: str | None = None,
    no_config_flag: bool = False,
    mov2: InputPathType | None = None,
    reg2: InputPathType | None = None,
    mov3: InputPathType | None = None,
    reg3: InputPathType | None = None,
    heat_flag: bool = False,
    regheader_flag: bool = False,
    params: list[float] | None = None,
    flip_x_flag: bool = False,
    flip_y_flag: bool = False,
    flip_z_flag: bool = False,
    fstal: bool = False,
    aux: InputPathType | None = None,
    runner: Runner | None = None,
) -> TkregisterfvOutputs:
    """
    A script that runs freeview with arguments like tkregister, focusing on LTA
    files.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        reg: LTA registration file.
        mov: Moving image volume.
        targ: Target image volume.
        subject: Subject identifier for FreeSurfer directories.
        fstarg: Freesurfer target volume instead of orig.mgz.
        sd: FreeSurfer SUBJECTS_DIR environment variable.
        seg: Segmentation volume to load.
        aseg_flag: Load aseg.mgz as segmentation volume.
        aparc_aseg_flag: Load aparc+aseg.mgz as segmentation volume.
        opacity: Set segmentation volume opacity.
        surfs_flag: Load left and right hemisphere white matter surfaces.
        pial_surfs_flag: Load pial surfaces instead of white matter surfaces.
        all_surfs_flag: Load both pial and white matter surfaces.
        no_surfs_flag: Do not load any surfaces.
        lh_only_flag: Load only left hemisphere surface.
        rh_only_flag: Load only right hemisphere surface.
        surf: Explicit path to surface to load.
        aux_s: Explicit path to auxiliary surface to load.
        plane: Plane view: cor, sag, ax.
        no_config_flag: Do not automatically raise transform config window.
        mov2: Provide a second moving image volume.
        reg2: Provide a second registration file.
        mov3: Provide a third moving image volume.
        reg3: Provide a third registration file.
        heat_flag: Use heat map color tables for all volumes.
        regheader_flag: Create registration file assuming the two volumes share\
            a RAS.
        params: Affine matrix parameters: translations in mm, rotations in\
            degrees.
        flip_x_flag: Regheader with rx=180.
        flip_y_flag: Regheader with ry=180.
        flip_z_flag: Regheader with rz=180.
        fstal: Modify the talairach.xfm with subject.
        aux: Load auxiliary volumes with registration.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `TkregisterfvOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(TKREGISTERFV_METADATA)
    cargs = []
    cargs.append("tkregisterfv")
    if mov is not None:
        cargs.extend([
            "--mov",
            execution.input_file(mov)
        ])
    if targ is not None:
        cargs.extend([
            "--targ",
            execution.input_file(targ)
        ])
    cargs.extend([
        "--reg",
        execution.input_file(reg)
    ])
    if subject is not None:
        cargs.extend([
            "--s",
            subject
        ])
    if fstarg is not None:
        cargs.extend([
            "--fstarg",
            execution.input_file(fstarg)
        ])
    if sd is not None:
        cargs.extend([
            "--sd",
            sd
        ])
    if seg is not None:
        cargs.extend([
            "--seg",
            execution.input_file(seg)
        ])
    if aseg_flag:
        cargs.append("--aseg")
    if aparc_aseg_flag:
        cargs.append("--aparc+aseg")
    if opacity is not None:
        cargs.extend([
            "--opacity",
            str(opacity)
        ])
    if surfs_flag:
        cargs.append("--surfs")
    if pial_surfs_flag:
        cargs.append("--pial-surfs")
    if all_surfs_flag:
        cargs.append("--all-surfs")
    if no_surfs_flag:
        cargs.append("--no-surfs")
    if lh_only_flag:
        cargs.append("--lh-only")
    if rh_only_flag:
        cargs.append("--rh-only")
    if surf is not None:
        cargs.extend([
            "--surf",
            execution.input_file(surf)
        ])
    if aux_s is not None:
        cargs.extend([
            "--aux-surf",
            execution.input_file(aux_s)
        ])
    if plane is not None:
        cargs.extend([
            "--plane",
            plane
        ])
    if no_config_flag:
        cargs.append("--no-config")
    if mov2 is not None:
        cargs.extend([
            "--mov2",
            execution.input_file(mov2)
        ])
    if reg2 is not None:
        cargs.extend([
            "--reg2",
            execution.input_file(reg2)
        ])
    if mov3 is not None:
        cargs.extend([
            "--mov3",
            execution.input_file(mov3)
        ])
    if reg3 is not None:
        cargs.extend([
            "--reg3",
            execution.input_file(reg3)
        ])
    if heat_flag:
        cargs.append("--heat")
    if regheader_flag:
        cargs.append("--regheader")
    if params is not None:
        cargs.extend([
            "--params",
            *map(str, params)
        ])
    if flip_x_flag:
        cargs.append("--flip-x")
    if flip_y_flag:
        cargs.append("--flip-y")
    if flip_z_flag:
        cargs.append("--flip-z")
    if fstal:
        cargs.append("--fstal")
    if aux is not None:
        cargs.extend([
            "--aux",
            execution.input_file(aux)
        ])
    ret = TkregisterfvOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "TKREGISTERFV_METADATA",
    "TkregisterfvOutputs",
    "tkregisterfv",
]
