[ENH]: Enable stdout and stderr capturing for AFNI commands #234

Merged
synchon merged 3 commits from fix/afni-log-capture into main 2023-06-27 08:59:28 +00:00
3 changed files with 7 additions and 3 deletions

View file

@ -0,0 +1 @@
Enable ``stdout`` and ``stderr`` capture for AFNI commands by `Synchon Mandal`_

View file

@ -70,12 +70,11 @@ class ALFFEstimator:
If AFNI command fails.
"""
logger.info(f"AFNI command to be executed: {cmd}")
# TODO: Figure out how to capture stdout and stderr
process = subprocess.run(
cmd,
stdin=subprocess.DEVNULL,
# stdout=subprocess.STDOUT,
# stderr=subprocess.STDOUT,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
shell=True,
check=False,
)

View file

@ -173,6 +173,8 @@ class ReHoEstimator:
reho_process = subprocess.run(
reho_cmd_str, # string needed with shell=True
stdin=subprocess.DEVNULL,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
shell=True, # needed for respecting $PATH
check=False,
)
@ -205,6 +207,8 @@ class ReHoEstimator:
convert_process = subprocess.run(
convert_cmd_str, # string needed with shell=True
stdin=subprocess.DEVNULL,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
shell=True, # needed for respecting $PATH
check=False,
)