Closed sulantha2006 closed 8 months ago
Resolution: Deepcopy the Function Interface before creating the Node solves this issue.
func_interface = copy.deepcopy(image_stats)
node = Node(func_interface, name=name)
I don't know if the other devs have encountered this issue. Any explanations?
Generally interfaces are not reusable. Glad you solved your problem.
Summary
Nipype does not set all inputs of a Function Node if this node was used previously
Actual behavior
The function Node has two inputs (Graph correctly shows the two inputs). However, in execution, only 1 input is set in the std log. This is only true when the same function is used previously (different node with different name; but the same function to execute). The function uses the previously set input for the absent input and continues.
Graph for the node with two inputs properly identified.
STD log for the Node (One with the issue):
Previous Node (same function, but different node). As expected; both mask_file and input_file are correctly set.
The report.rst file for the failing node (pet_refval_refmask) however shows the mask_file value that was passed for the node that was run previously (pet_refval_refmask_t1Native).
Expected behavior
The inputs need to be properly set.