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

import typing
import pathlib
from styxdefs import *
import dataclasses

CONF2HIRES_METADATA = Metadata(
    id="0daec93cecaaf674dbbc3d770b70999cf8bff082.boutiques",
    name="conf2hires",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


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


def conf2hires(
    subject: str,
    no_t2: bool = False,
    mm_norm_sigma: float | None = 8,
    no_flair: bool = False,
    threads: float | None = None,
    copy_bias_from_conf: bool = False,
    norm_opts_rca: bool = False,
    trilin: bool = False,
    no_dev: bool = False,
    bbr_t2: bool = False,
    first_peak_d1: bool = False,
    first_peak_d2: bool = False,
    stopmask: str | None = None,
    expert: str | None = None,
    force_update: bool = False,
    runner: Runner | None = None,
) -> Conf2hiresOutputs:
    """
    Places the surfaces on high resolution T1 (and maybe T2) volumes based on an
    initial placement on a conformed volume.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        subject: Subject identifier.
        no_t2: Disable T2 processing (default).
        mm_norm_sigma: Smoothing level for T2 mri_normalize (default is 8).
        no_flair: Disable FLAIR processing (default).
        threads: Number of threads to use.
        copy_bias_from_conf: Copy bias field from conformed instead of\
            computing directly.
        norm_opts_rca: Compute bias directly using recon-all opts to\
            mri_normalize.
        trilin: Use trilinear normalization (default, applies with\
            --copy-bias-from-conf).
        no_dev: Do not use mris_make_surfaces.dev (default).
        bbr_t2: Set BBR contrast type to t2.
        first_peak_d1: Refine surface targets in MRIScomputeBorderValues()\
            using first peak method D1.
        first_peak_d2: Refine surface targets in MRIScomputeBorderValues()\
            using first peak method D2.
        stopmask: Specify stop mask.
        expert: Use expert options.
        force_update: Force update of final surfaces.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `Conf2hiresOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(CONF2HIRES_METADATA)
    cargs = []
    cargs.append("conf2hires")
    cargs.extend([
        "--s",
        subject
    ])
    if no_t2:
        cargs.append("--no-t2")
    if mm_norm_sigma is not None:
        cargs.extend([
            "--mm-norm-sigma",
            str(mm_norm_sigma)
        ])
    if no_flair:
        cargs.append("--no-flair")
    if threads is not None:
        cargs.extend([
            "--threads",
            str(threads)
        ])
    if copy_bias_from_conf:
        cargs.append("--copy-bias-from-conf")
    if norm_opts_rca:
        cargs.append("--norm-opts-rca")
    if trilin:
        cargs.append("--trilin")
    if no_dev:
        cargs.append("--no-dev")
    if bbr_t2:
        cargs.append("--bbr-t2")
    if first_peak_d1:
        cargs.append("--first-peak-d1")
    if first_peak_d2:
        cargs.append("--first-peak-d2")
    if stopmask is not None:
        cargs.extend([
            "--stopmask",
            stopmask
        ])
    if expert is not None:
        cargs.extend([
            "--expert",
            expert
        ])
    if force_update:
        cargs.append("--force-update")
    ret = Conf2hiresOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "CONF2HIRES_METADATA",
    "Conf2hiresOutputs",
    "conf2hires",
]
