将Nipype任务和工作流程转换为Pydra语法的工具
项目描述
Nipype2Pydra是一个命令行工具,用于将使用Nipype工作流程引擎编写的命令接口和工作流程半自动地移植到其继任者Pydra。它被设计成将任何必需的手动规格存储在单独的YAML规格文件中,在转换之前读取,这样一旦设计好,就可以重新运行转换来获取Nipype代码的新版本中的更改,而无需重做手动步骤。
基本用法
要将Nipype接口转换为Pydra任务,请运行nipype2pydra task命令,并将转换规格YAML文件和要保存生成的模块的包根传递给它,例如
$ nipype2pydra task ants_registration_registration.yaml /path/to/package/root
这将根据规格中的output_module字段在包根目录下创建一个模块文件,例如
/path/to/package/root/output/module/path
如果缺少此文件,并且nipype界面位于标准nipype.interfaces包中,那么它将被存储在pydra.tasks下,路径相同。
转换规范
虽然转换旨在尽可能自动化,但Nipype和Pydra之间存在结构差异,需要手动指定,可能需要将一些输入/输出重命名为更直观的名称。这些规范存储在YAML格式中,例如ANTs配准转换规范。
task_name: n4_bias_field_correction
nipype_name: N4BiasFieldCorrection
nipype_module: nipype.interfaces.ants.segmentation
inputs:
omit:
# list[str] - fields to omit from the Pydra interface
rename:
# dict[str, str] - fields to rename in the Pydra interface
types:
# dict[str, type] - override inferred types (use "mime-like" string for file-format types,
# e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred
# from the nipype interface, but you may want to be more specific, particularly
# for file types, where specifying the format also specifies the file that will be
# passed to the field in the automatically generated unittests.
input_image: medimage/nifti1
mask_image: medimage/nifti1
weight_image: medimage/nifti1
bias_image: medimage/nifti1
metadata:
# dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1)
outputs:
omit:
# list[str] - fields to omit from the Pydra interface
rename:
# dict[str, str] - fields to rename in the Pydra interface
types:
# dict[str, type] - override inferred types (use "mime-like" string for file-format types,
# e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred
# from the nipype interface, but you may want to be more specific, particularly
# for file types, where specifying the format also specifies the file that will be
# passed to the field in the automatically generated unittests.
output_image: medimage/nifti1
bias_image: medimage/nifti1
callables:
# dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py`
# to set to the `callable` attribute of output fields
templates:
# dict[str, str] - `output_file_template` values to be provided to output fields
requirements:
# dict[str, list[str]] - input fields that are required to be provided for the output field to be present
在此处提供不同选项的详细描述
安装
Nipype2Pydra可以从PyPI安装Python >= 3.7,使用以下命令:
$ python3 -m pip install nipype2pydra
许可证
本作品受Creative Commons Attribution 4.0国际许可证许可。
项目详情
下载文件
下载适合您平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。
源分布
nipype2pydra-0.4.4.tar.gz (96.5 kB 查看哈希值)
构建分布
nipype2pydra-0.4.4-py3-none-any.whl (128.8 kB 查看哈希值)
关闭
nipype2pydra-0.4.4.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | fd8530e6b2dfab372deced9dc9e9b39b1af353538c966784a7655a03c49667ca |
|
MD5 | d12e33ed96a84b7594a82475a9df7ee7 |
|
BLAKE2b-256 | 70f81d0d11a4aacad9bcf19387a75f299682fb7ff705a139f5d208c5921d40fe |
关闭
nipype2pydra-0.4.4-py3-none-any.whl的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 6d629767eb08f5b80d01ba07fa0f29bd3b849d8084632f65fbf51e26be4c20d2 |
|
MD5 | 48996ca113d0b27a2083cbf41209fb60 |
|
BLAKE2b-256 | b8be65d0e6fa4205434660a46ddaa75fae1f44c92394e3f7d762b2cfd759867c |