nipype icon indicating copy to clipboard operation
nipype copied to clipboard

[ENH] String Interpolation

Open zachlindsey opened this issue 1 year ago • 0 comments
trafficstars

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.

zachlindsey avatar Apr 15 '24 18:04 zachlindsey