Can I suppress the output for a single Node?

I’ve got a couple steps in my Nipype workflow that use a MapNode to iterate over many, many frames of a 4D timeseries. This leads to an awful lot of clutter in stdout, with thousands of lines I don’t need to see.
Is it possible to suppress the output for just these particular MapNodes? I still need to keep the outputs of the rest of the workflow for troubleshooting purposes. Thanks in advance.

Edit: To be specific, I’m not looking to suppress the interface output, but the Node output messages, which say things like “[Node] Setting-up …”, “[Node] Running …”, etc.

Hi,

Did you find the solution ? I also found the enormous outputs of nipype is a pain in either opening jupyter notebook or debugging.

Yun

you can suppress terminal output for a single node by altering the interface’s terminal_output attribute. For example:

mymapnode = MapNode(AnInterface(), name='mymapnode')
mymapnode.inputs.terminal_output = 'none'

should suppress AnInterface's stdout / stderr.

Thank you very much! However, this does not seem work for “Node”.

What kind of interface are you using? For custom Functions, I’m not able to suppress output, but it should work for any command line interfaces.

flirt from fsl interface.

My mistake, there is no easy way to suppress select Node’s stdout/stderr. The terminal_output attribute only covers an Interface. However, you could disable Node/Workflow logging as a whole by altering the specific logger, for example:

import nipype
import logging
logging.getLogger('nipype.workflow').setLevel(0)
1 Like

Great! Thank you very much! Super helpful.