Nipype: issue geting stdout/stderr of antsRegistration in pipeline

Hello,

I’m trying to run antsRegistration in nipype and I’m having trouble getting the stdout/stderr from the actual executable.

I have this as part of a workflow, here is a small representative example:

def workflow(fixed_image: str, moving_image: str, config):
    reg_node = pipeline_engine.Node(Registration(), name="antsRegistration")
    reg_node.interface.terminal_output = 'stream'
    reg_node.inputs.fixed_image = fixed_image
    reg_node.inputs.moving_image = moving_image
    for key, val in config.items():
        setattr(reg_node.inputs, key, val)

    reg_workflow = pipeline_engine.Workflow(
        name="ants_atlas_registration_workflow", base_dir="/tmp/ants"
    )
    sink = pipeline_engine.Node(DataSink(), name="sink")
    sink.inputs.base_directory = str(base_dir)
    reg_workflow.connect(
            [
                (
                    reg_node,
                    sink,
                    [
                        ("warped_image", "output.@warped"),
                        ("inverse_warped_image", "output.@inverse_warped"),
                        ("save_state", "output.@save_state"),
                        ("composite_transform","output.@composite_transform")
                    ]
                )
            ]
      )
     reg_workflow.run()

I have also set the interface level logging to debug, and the output that I get is this:

211201-23:12:43,602 nipype.workflow INFO:
         [Node] Executing "antsRegistration" <nipype.interfaces.ants.registration.Registration>
[272885ms   INFO     ]  [Node] Executing "antsRegistration" <nipype.interfaces.ants.registration.Registration>
211201-23:12:43,607 nipype.interface DEBUG:
         collapse_output_transforms_True
211201-23:12:43,607 nipype.interface DEBUG:
         dimension_3
211201-23:12:43,608 nipype.interface DEBUG:
         initialize_transforms_per_stage_False
211201-23:12:43,609 nipype.interface DEBUG:
         verbose_False
211201-23:12:43,609 nipype.interface DEBUG:
         write_composite_transform_False

And then it just hangs for the duration of the antsRegistration command. I have also tried setting the terminal_output to file and checked the output.nipype file in the work directory, but there is nothing in it. And I’ve tried setting the input verbose to True, with no affect.

I’d appreciate any help getting the stdout/err from antsRegistration in this pipeline!

Thanks in advance!

  • Nate Richman