capsul.subprocess module

The capsul.subprocess module provides interfaces similar to those of the standard subprocess module, specialized to call specific neuroimaging software such as FSL, SPM or FreeSurfer. It provides Popen, call(), check_call() and check_outputs() replacement functions which work in the selected specific environment.

capsul.subprocess.fsl submodule

capsul.subprocess.spm submodule

Classes

Popen

Functions

find_spm()

check_spm_configuration()

check_configuration_values()

auto_configuration()

spm_command()

call()

check_call()

check_output()

class capsul.subprocess.spm.Popen(study_config, batch_file, **kwargs)[source]

Equivalent to Python soma.subprocess.Popen for SPM batch

Create new Popen instance.

capsul.subprocess.spm.auto_configuration(study_config)[source]

Obsolete.

Try to automatically set the study_config configuration for SPM.

capsul.subprocess.spm.call(study_config, batch_file, **kwargs)[source]

Equivalent to Python soma.subprocess.call for SPM batch

capsul.subprocess.spm.check_call(study_config, batch_file, **kwargs)[source]

Equivalent to Python soma.subprocess.check_call for SPM batch

capsul.subprocess.spm.check_configuration_values(study_config)[source]

Obsolete.

Check if the configuration is valid to run SPM and returns an error message if there is an error or None if everything is good.

capsul.subprocess.spm.check_output(study_config, batch_file, **kwargs)[source]

Equivalent to Python soma.subprocess.check_output for SPM batch

capsul.subprocess.spm.check_spm_configuration(study_config)[source]

Obsolete.

Check thas study_config configuration is valid to call SPM commands. If not, try to automatically configure SPM. Finally raises an EnvironmentError if configuration is still wrong.

capsul.subprocess.spm.find_spm(spm_version='', matlab_exec='matlab', matlab_path=None)[source]

Function to return the root directory of SPM.

Parameters:
  • spm_version (str (default='')) – if given, the version to use when running spm<version> in Matlab.

  • matlab (str (default='matlab')) – if given, is the path to the Matlab executable.

  • matlab_path (str (default None)) – if given, is a Matlab expression fed to addpath.

Returns:

last_line – the SPM root directory

Return type:

str