def minctoecatWorkflow(name): workflow = pe.Workflow(name=name) #Define input node that will receive input from outside of workflow inputNode = pe.Node(niu.IdentityInterface(fields=["in_file", "header"]), name='inputNode') conversionNode = pe.Node(interface=minctoecatInterfaceCommand(), name="conversionNode") #conversionNode.inputs.out_file=name+'.v' sifNode = pe.Node(interface=sifCommand(), name="sifNode") eframeNode = pe.Node(interface=eframeCommand(), name="eframeNode") ###imgunitNode = pe.Node(interface=imgunitCommand(), name="imgunitCommand") ###imgunitNode.inputs.u = "Bq/cc" outputNode = pe.Node(niu.IdentityInterface(fields=["out_file"]), name='outputNode') workflow.connect(inputNode, 'in_file', conversionNode, 'in_file') workflow.connect(inputNode, 'in_file', sifNode, 'in_file') workflow.connect(inputNode, 'header', sifNode, 'header') workflow.connect(conversionNode, 'out_file', outputNode, 'out_file') workflow.connect(conversionNode, 'out_file', eframeNode, 'pet_file') workflow.connect(sifNode, 'out_file', eframeNode, 'frame_file') ###workflow.connect(eframeNode, 'out_file', imgunitNode, 'in_file') ###workflow.connect(imgunitNode, 'out_file', outputNode, 'out_file') return (workflow)
def _run_interface(self, runtime): conversionNode = minctoecatInterfaceCommand() conversionNode.inputs.in_file = self.inputs.in_file conversionNode.run() if isdefined(self.inputs.header): isotopeNode = e7emhdrInterface() isotopeNode.inputs.in_file = conversionNode.inputs.out_file isotopeNode.inputs.header = self.inputs.header isotopeNode.run() sifNode = sifCommand() sifNode.inputs.in_file = self.inputs.in_file sifNode.inputs.header = self.inputs.header sifNode.run() eframeNode = eframeCommand() eframeNode.inputs.frame_file = sifNode.inputs.out_file eframeNode.inputs.pet_file = isotopeNode.inputs.out_file eframeNode.run() imgunitNode = imgunitCommand() imgunitNode.inputs.in_file = eframeNode.inputs.pet_file imgunitNode.inputs.u = "Bq/cc" imgunitNode.run() self.inputs.out_file = imgunitNode.inputs.out_file else: self.inputs.out_file = conversionNode.inputs.out_file return runtime