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

import typing
import pathlib
from styxdefs import *
import dataclasses

LONGMC_METADATA = Metadata(
    id="51a04d5ffd0bb81591249e8acfb084306bc3edcb.boutiques",
    name="longmc",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


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


def longmc(
    cross_tp_name: str,
    base_name: str,
    subjects_dir: str,
    conform_to_hires: bool = False,
    subject_name: str | None = None,
    no_force_update: bool = False,
    runner: Runner | None = None,
) -> LongmcOutputs:
    """
    Perform motion correction for the longitudinal recon-all stream when creating
    the longitudinal timepoint of a subject.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        cross_tp_name: Cross time point name for the longitudinal analysis.
        base_name: Base name for the longitudinal analysis.
        subjects_dir: Set the SUBJECTS_DIR directory.
        conform_to_hires: Option to conform input to high-resolution.
        subject_name: Subject name override, must be declared after -long.
        no_force_update: Do not force update.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `LongmcOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(LONGMC_METADATA)
    cargs = []
    cargs.append("longmc")
    cargs.extend([
        "-long",
        cross_tp_name
    ])
    cargs.append(base_name)
    if conform_to_hires:
        cargs.append("-conf2hires")
    cargs.extend([
        "-sd",
        subjects_dir
    ])
    if subject_name is not None:
        cargs.extend([
            "-s",
            subject_name
        ])
    if no_force_update:
        cargs.append("-no-force-update")
    ret = LongmcOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "LONGMC_METADATA",
    "LongmcOutputs",
    "longmc",
]
