nipype.interfaces.afni.base module

Provide a base interface to AFNI commands.

AFNICommand

Link to code

Bases: AFNICommandBase

Shared options for several AFNI commands.

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • num_threads (an integer) – Set number of threads. (Nipype default value: 1)

  • out_file (a pathlike object or string representing a file) – Output image file name. Maps to a command-line argument: -prefix %s.

  • outputtype (‘NIFTI’ or ‘AFNI’ or ‘NIFTI_GZ’) – AFNI output filetype.

property AFNICommand.num_threads

Get number of threads.

classmethod AFNICommand.set_default_output_type(outputtype)

Set the default output type for AFNI classes.

This method is used to set the default output type for all afni subclasses. However, setting this will not update the output type for any existing instances. For these, assign the <instance>.inputs.outputtype.

AFNICommandBase

Link to code

Bases: CommandLine

A base class to fix a linking problem in OSX and AFNI.

See also

This thread about the particular environment variable that fixes this problem.

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

AFNIPythonCommand

Link to code

Bases: AFNICommand

A subtype of AFNI command line for Python scripts.

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • num_threads (an integer) – Set number of threads. (Nipype default value: 1)

  • out_file (a pathlike object or string representing a file) – Output image file name. Maps to a command-line argument: -prefix %s.

  • outputtype (‘NIFTI’ or ‘AFNI’ or ‘NIFTI_GZ’) – AFNI output filetype.

property AFNIPythonCommand.cmd

Revise the command path.

class nipype.interfaces.afni.base.Info

Bases: nipype.interfaces.base.core.PackageInfo

Handle afni output type and version information.

ftypes = {'AFNI': '', 'NIFTI': '.nii', 'NIFTI_GZ': '.nii.gz'}
classmethod output_type_to_ext(outputtype)

Get the file extension for the given output type.

Parameters:

outputtype ({‘NIFTI’, ‘NIFTI_GZ’, ‘AFNI’}) – String specifying the output type.

Returns:

extension – The file extension for the output type.

Return type:

str

classmethod outputtype()

Set default output filetype.

AFNI has no environment variables, Output filetypes get set in command line calls Nipype uses AFNI as default

Return type:

None

static parse_version(raw_info)

Check and parse AFNI’s version.

static standard_image(img_name)

Grab an image from the standard location.

Could be made more fancy to allow for more relocatability

version_cmd = 'afni --version'
nipype.interfaces.afni.base.no_afni()

Check whether AFNI is not available.