smriprep.interfaces.gifti module

Interfaces for manipulating GIFTI files.

class smriprep.interfaces.gifti.MetricMath(from_file=None, resource_monitor=None, **inputs)[source]

Bases: SimpleInterface

Prepare GIFTI metric file for use in MSMSulc

This interface mirrors the action of the following portion of FreeSurfer2CaretConvertAndRegisterNonlinear.sh:

wb_command -set-structure ${metric_file} CORTEX_[LEFT|RIGHT]
wb_command -metric-math "var * -1" ${metric_file} -var var ${metric_file}
wb_command -set-map-names ${metric_file} -map 1 ${subject}_[L|R]_${metric}
# If abs:
wb_command -metric-math "abs(var)" ${metric_file} -var var ${metric_file}

We do not add palette information to the output file.

Mandatory Inputs:
  • hemisphere (‘L’ or ‘R’) – Hemisphere.

  • metric_file (a pathlike object or string representing an existing file) – Input GIFTI file.

  • operation (‘invert’ or ‘abs’ or ‘bin’) – Operation to perform.

Optional Inputs:
  • metric (a string) – Name of metric to invert.

  • subject_id (a string) – Subject ID.

Outputs:

metric_file (a pathlike object or string representing a file) – Output GIFTI file.