interfaces.workbench.metric

MetricResample

Link to code

Wraps the executable command wb_command -metric-resample.

Resample a metric file to a different mesh

Resamples a metric file, given two spherical surfaces that are in register. If ADAP_BARY_AREA is used, exactly one of -area-surfs or -area-metrics must be specified.

The ADAP_BARY_AREA method is recommended for ordinary metric data, because it should use all data while downsampling, unlike BARYCENTRIC. The recommended areas option for most data is individual midthicknesses for individual data, and averaged vertex area metrics from individual midthicknesses for group average data.

The -current-roi option only masks the input, the output may be slightly dilated in comparison, consider using -metric-mask on the output when using -current-roi.

The -largest option results in nearest vertex behavior when used with BARYCENTRIC. When resampling a binary metric, consider thresholding at 0.5 after resampling rather than using -largest.

>>> from nipype.interfaces.workbench import MetricResample
>>> metres = MetricResample()
>>> metres.inputs.in_file = 'sub-01_task-rest_bold_space-fsaverage5.L.func.gii'
>>> metres.inputs.method = 'ADAP_BARY_AREA'
>>> metres.inputs.current_sphere = 'fsaverage5_std_sphere.L.10k_fsavg_L.surf.gii'
>>> metres.inputs.new_sphere = 'fs_LR-deformed_to-fsaverage.L.sphere.32k_fs_LR.surf.gii'
>>> metres.inputs.area_metrics = True
>>> metres.inputs.current_area = 'fsaverage5.L.midthickness_va_avg.10k_fsavg_L.shape.gii'
>>> metres.inputs.new_area = 'fs_LR.L.midthickness_va_avg.32k_fs_LR.shape.gii'
>>> metres.cmdline
'wb_command -metric-resample sub-01_task-rest_bold_space-fsaverage5.L.func.gii     fsaverage5_std_sphere.L.10k_fsavg_L.surf.gii     fs_LR-deformed_to-fsaverage.L.sphere.32k_fs_LR.surf.gii     ADAP_BARY_AREA fs_LR-deformed_to-fsaverage.L.sphere.32k_fs_LR.surf.out     -area-metrics fsaverage5.L.midthickness_va_avg.10k_fsavg_L.shape.gii     fs_LR.L.midthickness_va_avg.32k_fs_LR.shape.gii'

Inputs:

[Mandatory]
in_file: (a pathlike object or string representing an existing file)
        The metric file to resample
        argument: ``%s``, position: 0
current_sphere: (a pathlike object or string representing an existing
          file)
        A sphere surface with the mesh that the metric is currently on
        argument: ``%s``, position: 1
new_sphere: (a pathlike object or string representing an existing
          file)
        A sphere surface that is in register with <current-sphere> and has
        the desired output mesh
        argument: ``%s``, position: 2
method: ('ADAP_BARY_AREA' or 'BARYCENTRIC')
        The method name - ADAP_BARY_AREA method is recommended for ordinary
        metric data, because it should use all data while downsampling,
        unlike BARYCENTRIC. If ADAP_BARY_AREA is used, exactly one of
        area_surfs or area_metrics must be specified
        argument: ``%s``, position: 3

[Optional]
out_file: (a pathlike object or string representing a file)
        The output metric
        argument: ``%s``, position: 4
area_surfs: (a boolean)
        Specify surfaces to do vertex area correction based on
        argument: ``-area-surfs``, position: 5
        mutually_exclusive: area_metrics
area_metrics: (a boolean)
        Specify vertex area metrics to do area correction based on
        argument: ``-area-metrics``, position: 5
        mutually_exclusive: area_surfs
current_area: (a pathlike object or string representing an existing
          file)
        A relevant anatomical surface with <current-sphere> mesh OR a metric
        file with vertex areas for <current-sphere> mesh
        argument: ``%s``, position: 6
new_area: (a pathlike object or string representing an existing file)
        A relevant anatomical surface with <current-sphere> mesh OR a metric
        file with vertex areas for <current-sphere> mesh
        argument: ``%s``, position: 7
roi_metric: (a pathlike object or string representing an existing
          file)
        Input roi on the current mesh used to exclude non-data vertices
        argument: ``-current-roi %s``, position: 8
valid_roi_out: (a boolean)
        Output the ROI of vertices that got data from valid source vertices
        argument: ``-valid-roi-out``, position: 9
largest: (a boolean)
        Use only the value of the vertex with the largest weight
        argument: ``-largest``, position: 10
args: (a unicode string)
        Additional parameters to the command
        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', nipype default value: {})
        Environment variables

Outputs:

out_file: (a pathlike object or string representing an existing file)
        the output metric
roi_file: (a pathlike object or string representing a file)
        ROI of vertices that got data from valid source vertices