diff --git a/docs/changes/newsfragments/234.enh b/docs/changes/newsfragments/234.enh new file mode 100644 index 000000000..60eddbb85 --- /dev/null +++ b/docs/changes/newsfragments/234.enh @@ -0,0 +1 @@ +Enable ``stdout`` and ``stderr`` capture for AFNI commands by `Synchon Mandal`_ diff --git a/junifer/markers/falff/falff_estimator.py b/junifer/markers/falff/falff_estimator.py index 035a9eaca..f6bf57cae 100644 --- a/junifer/markers/falff/falff_estimator.py +++ b/junifer/markers/falff/falff_estimator.py @@ -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, ) diff --git a/junifer/markers/reho/reho_estimator.py b/junifer/markers/reho/reho_estimator.py index 8d3d2802f..211c5d44c 100644 --- a/junifer/markers/reho/reho_estimator.py +++ b/junifer/markers/reho/reho_estimator.py @@ -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, )