[ENH]: Enable stdout and stderr capturing for AFNI commands #234
3 changed files with 7 additions and 3 deletions
1
docs/changes/newsfragments/234.enh
Normal file
1
docs/changes/newsfragments/234.enh
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
Enable ``stdout`` and ``stderr`` capture for AFNI commands by `Synchon Mandal`_
|
||||||
|
|
@ -70,12 +70,11 @@ class ALFFEstimator:
|
||||||
If AFNI command fails.
|
If AFNI command fails.
|
||||||
"""
|
"""
|
||||||
logger.info(f"AFNI command to be executed: {cmd}")
|
logger.info(f"AFNI command to be executed: {cmd}")
|
||||||
# TODO: Figure out how to capture stdout and stderr
|
|
||||||
process = subprocess.run(
|
process = subprocess.run(
|
||||||
cmd,
|
cmd,
|
||||||
stdin=subprocess.DEVNULL,
|
stdin=subprocess.DEVNULL,
|
||||||
# stdout=subprocess.STDOUT,
|
stdout=subprocess.PIPE,
|
||||||
# stderr=subprocess.STDOUT,
|
stderr=subprocess.STDOUT,
|
||||||
shell=True,
|
shell=True,
|
||||||
check=False,
|
check=False,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -173,6 +173,8 @@ class ReHoEstimator:
|
||||||
reho_process = subprocess.run(
|
reho_process = subprocess.run(
|
||||||
reho_cmd_str, # string needed with shell=True
|
reho_cmd_str, # string needed with shell=True
|
||||||
stdin=subprocess.DEVNULL,
|
stdin=subprocess.DEVNULL,
|
||||||
|
stdout=subprocess.PIPE,
|
||||||
|
stderr=subprocess.STDOUT,
|
||||||
shell=True, # needed for respecting $PATH
|
shell=True, # needed for respecting $PATH
|
||||||
check=False,
|
check=False,
|
||||||
)
|
)
|
||||||
|
|
@ -205,6 +207,8 @@ class ReHoEstimator:
|
||||||
convert_process = subprocess.run(
|
convert_process = subprocess.run(
|
||||||
convert_cmd_str, # string needed with shell=True
|
convert_cmd_str, # string needed with shell=True
|
||||||
stdin=subprocess.DEVNULL,
|
stdin=subprocess.DEVNULL,
|
||||||
|
stdout=subprocess.PIPE,
|
||||||
|
stderr=subprocess.STDOUT,
|
||||||
shell=True, # needed for respecting $PATH
|
shell=True, # needed for respecting $PATH
|
||||||
check=False,
|
check=False,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue