Package: nipype2pydra
Nipype2Pydra is a command-line tool for semi-automatically porting command interfaces
and workflows written from theNipypeworkflow engine to its successorPydra. It has
been designed so that any required manual-specifications are stored in separate YAML
specification files, which is read ahead of the conversion, so once designed the
conversion can be re-run to pick up changes in newer versions of theNipypecode without
having to redo the manual steps.Basic UsageTo convert aNipypeinterface to aPydratask run thenipype2pydra taskcommand and
pass it the conversion specification YAML file and the root of the package to save the
generated module, e.g.:$ nipype2pydra task ants_registration_registration.yaml /path/to/package/rootThis will create a module file under the package root directory based on theoutput_modulefield in the specification, e.g:/path/to/package/root/output/module/pathIf that is missing and the nipype interface is in the standardnipype.interfacespackage, then it will be stored atpydra.tasks.with the same path end.Conversion SpecificationsWhile the conversions aim to as automatic as possible, there are structural
differences betweenNipypeandPydrathat require manual specification, and it might
be desirable to rename some of the inputs/outputs to more intuitive names. Such
specifications are stored inYAMLformat, such as the ANTs registration conversion
specification,task_name:n4_bias_field_correctionnipype_name:N4BiasFieldCorrectionnipype_module:nipype.interfaces.ants.segmentationinputs:omit:# list[str] - fields to omit from the Pydra interfacerename:# dict[str, str] - fields to rename in the Pydra interfacetypes:# 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/nifti1mask_image:medimage/nifti1weight_image:medimage/nifti1bias_image:medimage/nifti1metadata:# 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 interfacerename:# dict[str, str] - fields to rename in the Pydra interfacetypes:# 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/nifti1bias_image:medimage/nifti1callables:# dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py`# to set to the `callable` attribute of output fieldstemplates:# dict[str, str] - `output_file_template` values to be provided to output fieldsrequirements:# dict[str, list[str]] - input fields that are required to be provided for the output field to be presentDetailed description of the different options to go hereInstallationNipype2Pydracan be installed for Python >= 3.7 from PyPI with$python3-mpipinstallnipype2pydraLicenseThis work is licensed under aCreative Commons Attribution 4.0 International License