nipy / nipype

Workflows and interfaces for neuroimaging packages
https://nipype.readthedocs.org/en/latest/
Other
751 stars 530 forks source link

[ENH] String Interpolation #3646

Open zachlindsey opened 7 months ago

zachlindsey commented 7 months ago

Summary

It would be nice if there was an interface StringInterpolate that allowed something like the following:

interpolate = utility.StringInterpolate()

interpolate.inputs.input_string = "{greeting}, {name}!"
interpolate.inputs.greeting = "Hello"
interpolate.inputs.name = "Nipype"

res = interpolate.run()

assert res.outputs.output_string == "Hello, Nipype!"

Only input_string is required, the rest are simply added. This is especially handy as an input to a CommandLine node, where the args are supplied by other nodes.