niwrap.ants.ants_transform_info

  1# This file was auto generated by Styx.
  2# Do not edit this file directly.
  3
  4import typing
  5import pathlib
  6from styxdefs import *
  7
  8ANTS_TRANSFORM_INFO_METADATA = Metadata(
  9    id="db110d69e8361c7a0293d1d70937a09c146e535a.boutiques",
 10    name="antsTransformInfo",
 11    package="ants",
 12    container_image_tag="antsx/ants:v2.5.3",
 13)
 14
 15
 16AntsTransformInfoParameters = typing.TypedDict('AntsTransformInfoParameters', {
 17    "__STYX_TYPE__": typing.Literal["antsTransformInfo"],
 18    "transform_file": InputPathType,
 19})
 20
 21
 22def dyn_cargs(
 23    t: str,
 24) -> typing.Any:
 25    """
 26    Get build cargs function by command type.
 27    
 28    Args:
 29        t: Command type.
 30    Returns:
 31        Build cargs function.
 32    """
 33    return {
 34        "antsTransformInfo": ants_transform_info_cargs,
 35    }.get(t)
 36
 37
 38def dyn_outputs(
 39    t: str,
 40) -> typing.Any:
 41    """
 42    Get build outputs function by command type.
 43    
 44    Args:
 45        t: Command type.
 46    Returns:
 47        Build outputs function.
 48    """
 49    return {
 50        "antsTransformInfo": ants_transform_info_outputs,
 51    }.get(t)
 52
 53
 54class AntsTransformInfoOutputs(typing.NamedTuple):
 55    """
 56    Output object returned when calling `ants_transform_info(...)`.
 57    """
 58    root: OutputPathType
 59    """Output root folder. This is the root folder for all outputs."""
 60    output_info: OutputPathType
 61    """Information of the provided transform file."""
 62
 63
 64def ants_transform_info_params(
 65    transform_file: InputPathType,
 66) -> AntsTransformInfoParameters:
 67    """
 68    Build parameters.
 69    
 70    Args:
 71        transform_file: The transform file to read. Supported formats include\
 72            HDF5, MINC, Matlab, and Txt.
 73    Returns:
 74        Parameter dictionary
 75    """
 76    params = {
 77        "__STYXTYPE__": "antsTransformInfo",
 78        "transform_file": transform_file,
 79    }
 80    return params
 81
 82
 83def ants_transform_info_cargs(
 84    params: AntsTransformInfoParameters,
 85    execution: Execution,
 86) -> list[str]:
 87    """
 88    Build command-line arguments from parameters.
 89    
 90    Args:
 91        params: The parameters.
 92        execution: The execution object for resolving input paths.
 93    Returns:
 94        Command-line arguments.
 95    """
 96    cargs = []
 97    cargs.append("antsTransformInfo")
 98    cargs.extend([
 99        "--file",
100        execution.input_file(params.get("transform_file"))
101    ])
102    return cargs
103
104
105def ants_transform_info_outputs(
106    params: AntsTransformInfoParameters,
107    execution: Execution,
108) -> AntsTransformInfoOutputs:
109    """
110    Build outputs object containing output file paths and possibly stdout/stderr.
111    
112    Args:
113        params: The parameters.
114        execution: The execution object for resolving input paths.
115    Returns:
116        Outputs object.
117    """
118    ret = AntsTransformInfoOutputs(
119        root=execution.output_file("."),
120        output_info=execution.output_file("transform_info.txt"),
121    )
122    return ret
123
124
125def ants_transform_info_execute(
126    params: AntsTransformInfoParameters,
127    execution: Execution,
128) -> AntsTransformInfoOutputs:
129    """
130    Provide information about an ITK transform file.
131    
132    Author: ANTs Developers
133    
134    URL: https://github.com/ANTsX/ANTs
135    
136    Args:
137        params: The parameters.
138        execution: The execution object.
139    Returns:
140        NamedTuple of outputs (described in `AntsTransformInfoOutputs`).
141    """
142    params = execution.params(params)
143    cargs = ants_transform_info_cargs(params, execution)
144    ret = ants_transform_info_outputs(params, execution)
145    execution.run(cargs)
146    return ret
147
148
149def ants_transform_info(
150    transform_file: InputPathType,
151    runner: Runner | None = None,
152) -> AntsTransformInfoOutputs:
153    """
154    Provide information about an ITK transform file.
155    
156    Author: ANTs Developers
157    
158    URL: https://github.com/ANTsX/ANTs
159    
160    Args:
161        transform_file: The transform file to read. Supported formats include\
162            HDF5, MINC, Matlab, and Txt.
163        runner: Command runner.
164    Returns:
165        NamedTuple of outputs (described in `AntsTransformInfoOutputs`).
166    """
167    runner = runner or get_global_runner()
168    execution = runner.start_execution(ANTS_TRANSFORM_INFO_METADATA)
169    params = ants_transform_info_params(
170        transform_file=transform_file,
171    )
172    return ants_transform_info_execute(params, execution)
173
174
175__all__ = [
176    "ANTS_TRANSFORM_INFO_METADATA",
177    "AntsTransformInfoOutputs",
178    "AntsTransformInfoParameters",
179    "ants_transform_info",
180    "ants_transform_info_params",
181]
ANTS_TRANSFORM_INFO_METADATA = Metadata(id='db110d69e8361c7a0293d1d70937a09c146e535a.boutiques', name='antsTransformInfo', package='ants', citations=None, container_image_tag='antsx/ants:v2.5.3')
class AntsTransformInfoOutputs(typing.NamedTuple):
55class AntsTransformInfoOutputs(typing.NamedTuple):
56    """
57    Output object returned when calling `ants_transform_info(...)`.
58    """
59    root: OutputPathType
60    """Output root folder. This is the root folder for all outputs."""
61    output_info: OutputPathType
62    """Information of the provided transform file."""

Output object returned when calling ants_transform_info(...).

AntsTransformInfoOutputs(root: pathlib._local.Path, output_info: pathlib._local.Path)

Create new instance of AntsTransformInfoOutputs(root, output_info)

root: pathlib._local.Path

Output root folder. This is the root folder for all outputs.

output_info: pathlib._local.Path

Information of the provided transform file.

class AntsTransformInfoParameters(typing.TypedDict):
transform_file: pathlib._local.Path | str
def ants_transform_info( transform_file: pathlib._local.Path | str, runner: styxdefs.types.Runner | None = None) -> AntsTransformInfoOutputs:
150def ants_transform_info(
151    transform_file: InputPathType,
152    runner: Runner | None = None,
153) -> AntsTransformInfoOutputs:
154    """
155    Provide information about an ITK transform file.
156    
157    Author: ANTs Developers
158    
159    URL: https://github.com/ANTsX/ANTs
160    
161    Args:
162        transform_file: The transform file to read. Supported formats include\
163            HDF5, MINC, Matlab, and Txt.
164        runner: Command runner.
165    Returns:
166        NamedTuple of outputs (described in `AntsTransformInfoOutputs`).
167    """
168    runner = runner or get_global_runner()
169    execution = runner.start_execution(ANTS_TRANSFORM_INFO_METADATA)
170    params = ants_transform_info_params(
171        transform_file=transform_file,
172    )
173    return ants_transform_info_execute(params, execution)

Provide information about an ITK transform file.

Author: ANTs Developers

URL: https://github.com/ANTsX/ANTs

Arguments:
  • transform_file: The transform file to read. Supported formats include HDF5, MINC, Matlab, and Txt.
  • runner: Command runner.
Returns:

NamedTuple of outputs (described in AntsTransformInfoOutputs).

def ants_transform_info_params( transform_file: pathlib._local.Path | str) -> AntsTransformInfoParameters:
65def ants_transform_info_params(
66    transform_file: InputPathType,
67) -> AntsTransformInfoParameters:
68    """
69    Build parameters.
70    
71    Args:
72        transform_file: The transform file to read. Supported formats include\
73            HDF5, MINC, Matlab, and Txt.
74    Returns:
75        Parameter dictionary
76    """
77    params = {
78        "__STYXTYPE__": "antsTransformInfo",
79        "transform_file": transform_file,
80    }
81    return params

Build parameters.

Arguments:
  • transform_file: The transform file to read. Supported formats include HDF5, MINC, Matlab, and Txt.
Returns:

Parameter dictionary