xcp_d.interfaces.workbench module

Custom wb_command interfaces.

class xcp_d.interfaces.workbench.ApplyAffine(command=None, terminal_output=None, write_cmdline=False, **inputs)[source]

Bases: WBCommand

Wrapped executable: wb_command -surface-apply-affine.

Interface for wb_command’s -surface-apply-affine command.

wb_command -surface-apply-affine
    <in-surf> - the surface to transform
    <affine> - the affine file
    <out-surf> - output - the output transformed surface

    [-flirt] - MUST be used if affine is a flirt affine
        <source-volume> - the source volume used when generating the affine
        <target-volume> - the target volume used when generating the affine

For flirt matrices, you must use the -flirt option, because flirt matrices are not a complete description of the coordinate transform they represent. If the -flirt option is not present, the affine must be a nifti ‘world’ affine, which can be obtained with the -convert-affine command, or aff_conv from the 4dfp suite.

Mandatory Inputs:
  • affine (a pathlike object or string representing an existing file) – The affine file. Maps to a command-line argument: %s (position: 1).

  • in_file (a pathlike object or string representing an existing file) – The input file. Maps to a command-line argument: %s (position: 0).

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: {})

  • out_file (a pathlike object or string representing a file) – Maps to a command-line argument: %s (position: 2).

Outputs:

out_file (a pathlike object or string representing an existing file) – Output file.

class xcp_d.interfaces.workbench.ApplyWarpfield(command=None, terminal_output=None, write_cmdline=False, **inputs)[source]

Bases: WBCommand

Wrapped executable: wb_command -surface-apply-warpfield.

Apply warpfield to surface file.

wb_command -surface-apply-warpfield
    <in-surf> - the surface to transform
    <warpfield> - the INVERSE warpfield
    <out-surf> - output - the output transformed surface

    [-fnirt] - MUST be used if using a fnirt warpfield
        <forward-warp> - the forward warpfield

Warping a surface requires the INVERSE of the warpfield used to warp the volume it lines up with. The header of the forward warp is needed by the -fnirt option in order to correctly interpret the displacements in the fnirt warpfield.

If the -fnirt option is not present, the warpfield must be a nifti ‘world’ warpfield, which can be obtained with the -convert-warpfield command.

Mandatory Inputs:
  • in_file (a pathlike object or string representing an existing file) – The input file. Maps to a command-line argument: %s (position: 0).

  • warpfield (a pathlike object or string representing an existing file) – The warpfield file. Maps to a command-line argument: %s (position: 1).

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: {})

  • forward_warp (a pathlike object or string representing a file) – Fnirt forward warpfield. Maps to a command-line argument: -fnirt %s (position: 3).

  • out_file (a pathlike object or string representing a file) – Maps to a command-line argument: %s (position: 2).

Outputs:

out_file (a pathlike object or string representing an existing file) – Output file.

class xcp_d.interfaces.workbench.ChangeXfmType(from_file=None, resource_monitor=None, **inputs)[source]

Bases: SimpleInterface

Change transform type.

Mandatory Inputs:

in_transform (a pathlike object or string representing an existing file) – Maps to a command-line argument: %s (position: 0).

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: {})

Outputs:

out_transform (a pathlike object or string representing an existing file)

class xcp_d.interfaces.workbench.CiftiChangeMapping(command=None, terminal_output=None, write_cmdline=False, **inputs)[source]

Bases: WBCommand

Wrapped executable: wb_command -cifti-change-mapping.

Convert to scalar, copy mapping, etc.

Take an existing cifti file and change one of the mappings. Exactly one of -series, -scalar, or -from-cifti must be specified. The direction can be either an integer starting from 1, or the strings ‘ROW’ or ‘COLUMN’.

Examples

>>> ccdft = CiftiChangeMapping()
>>> ccdft.inputs.data_cifti = "tpl-fsLR_atlas-Gordon_den-32k_dseg.dlabel.nii"
>>> ccdft.inputs.direction = "ROW"
>>> ccdft.inputs.cifti_out = "out.dscalar.nii"
>>> ccdft.inputs.scalar = True
>>> ccdft.cmdline
wb_command -cifti-change-mapping         tpl-fsLR_atlas-Gordon_den-32k_dseg.dlabel.nii         ROW         out.dscalar.nii         -scalar
Mandatory Inputs:
  • data_cifti (a pathlike object or string representing an existing file) – The cifti file to use the data from. Maps to a command-line argument: %s (position: 0).

  • direction (‘ROW’ or ‘COLUMN’) – Which mapping to parcellate (integer, ROW, or COLUMN). Maps to a command-line argument: %s (position: 1).

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

  • cifti_out (a pathlike object or string representing a file) – The output cifti file. Maps to a command-line argument: %s (position: 2).

  • 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: {})

  • scalar (a boolean) – Set the mapping to scalar. Maps to a command-line argument: -scalar (position: 3). (Nipype default value: False)

Outputs:

cifti_out (a pathlike object or string representing an existing file) – Output CIFTI file.

class xcp_d.interfaces.workbench.CiftiConvert(command=None, terminal_output=None, write_cmdline=False, **inputs)[source]

Bases: WBCommand

Wrapped executable: wb_command -cifti-convert.

Convert between CIFTI and NIFTI file formats.

Examples

>>> cifticonvert = CiftiConvert()
>>> cifticonvert.inputs.in_file = 'sub-01_task-rest_bold.dscalar.nii'
>>> cifticonvert.target = "to"
>>> cifticonvert.cmdline
wb_command -cifti-convert -to-nifti 'sub-01_task-rest_bold.dscalar.nii'         'sub-01_task-rest_bold_converted.nii.gz'
Mandatory Inputs:
  • in_file (a pathlike object or string representing an existing file) – The input file. Maps to a command-line argument: %s (position: 1).

  • target (‘from’ or ‘to’) – Convert either to or from nifti. Maps to a command-line argument: -%s-nifti (position: 0).

Optional Inputs:
  • TR (a float) – Repetition time in seconds. Used to reset timepoints. Maps to a command-line argument: -reset-timepoints %s 0 (position: 4).

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

  • cifti_template (a pathlike object or string representing an existing file) – A cifti file with the dimension(s) and mapping(s) that should be used. Maps to a command-line argument: %s (position: 2).

  • 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: {})

  • out_file (a pathlike object or string representing an existing file) – The output file. Maps to a command-line argument: %s (position: 3).

Outputs:

out_file (a pathlike object or string representing an existing file) – The output file.

class xcp_d.interfaces.workbench.CiftiCreateDenseFromTemplate(command=None, terminal_output=None, write_cmdline=False, **inputs)[source]

Bases: WBCommand

Wrapped executable: wb_command -cifti-create-dense-from-template.

Create CIFTI with matching dense map.

This command helps you make a new dscalar, dtseries, or dlabel cifti file that matches the brainordinate space used in another cifti file. The template file must have the desired brainordinate space in the mapping along the column direction (for dtseries, dscalar, dlabel, and symmetric dconn this is always the case). All input cifti files must have a brain models mapping along column and use the same volume space and/or surface vertex count as the template for structures that they contain. If any input files contain label data, then input files with non-label data are not allowed, and the -series option may not be used.

Any structure that isn’t covered by an input is filled with zeros or the unlabeled key.

Examples

>>> ccdft = CiftiCreateDenseFromTemplate()
>>> ccdft.inputs.template_cifti = "sub-01_task-rest_bold.dtseries.nii"
>>> ccdft.inputs.label = "parcellation.dlabel.nii"
>>> ccdft.cmdline
wb_command -cifti-create-dense-from-template         sub-01_task-rest_bold.dtseries.nii         resampled_parcellation.dlabel.nii         -label parcellation.dlabel.nii
Mandatory Inputs:
  • label (a pathlike object or string representing an existing file) – Use input data from surface label files. Input label file. Maps to a command-line argument: -cifti %s (position: 2).

  • template_cifti (a pathlike object or string representing an existing file) – File to match brainordinates of. Maps to a command-line argument: %s (position: 0).

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

  • cifti_out (a pathlike object or string representing a file) – The output cifti file. Maps to a command-line argument: %s (position: 1).

  • 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: {})

Outputs:

cifti_out (a pathlike object or string representing an existing file) – Output CIFTI file.

class xcp_d.interfaces.workbench.CiftiCreateDenseScalar(command=None, terminal_output=None, write_cmdline=False, **inputs)[source]

Bases: WBCommand

Wrapped executable: wb_command -cifti-create-dense-scalar.

Extract volumetric data from CIFTI file (.dtseries).

Other structures can also be extracted. The input cifti file must have a brain models mapping on the chosen dimension, columns for .dtseries,

Examples

>>> cifticreatedensescalar = CiftiCreateDenseScalar()
>>> cifticreatedensescalar.inputs.out_file = 'sub_01_task-rest.dscalar.nii'
>>> cifticreatedensescalar.inputs.left_metric = 'sub_01_task-rest_hemi-L.func.gii'
>>> cifticreatedensescalar.inputs.left_metric = 'sub_01_task-rest_hemi-R.func.gii'
>>> cifticreatedensescalar.inputs.volume_data = 'sub_01_task-rest_subcortical.nii.gz'
>>> cifticreatedensescalar.inputs.structure_label_volume = 'sub_01_task-rest_labels.nii.gz'
>>> cifticreatedensescalar.cmdline
wb_command -cifti-create-dense-scalar 'sub_01_task-rest.dscalar.nii'         -left-metric 'sub_01_task-rest_hemi-L.func.gii'         -right-metric 'sub_01_task-rest_hemi-R.func.gii'         -volume-data 'sub_01_task-rest_subcortical.nii.gz' 'sub_01_task-rest_labels.nii.gz'
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: {})

  • left_metric (a pathlike object or string representing an existing file) – The input surface data from the left hemisphere. Maps to a command-line argument: -left-metric %s (position: 1).

  • out_file (a pathlike object or string representing a file) – The CIFTI output. Maps to a command-line argument: %s (position: 0).

  • right_metric (a pathlike object or string representing an existing file) – The input surface data from the right hemisphere. Maps to a command-line argument: -right-metric %s (position: 2).

  • structure_label_volume (a pathlike object or string representing an existing file) – A label file indicating the structure of each voxel in volume_data. Maps to a command-line argument: %s (position: 4).

  • volume_data (a pathlike object or string representing an existing file) – The input volumetric data. Maps to a command-line argument: -volume %s (position: 3).

Outputs:

out_file (a pathlike object or string representing an existing file) – Output CIFTI file.

class xcp_d.interfaces.workbench.CiftiParcellateWorkbench(command=None, terminal_output=None, write_cmdline=False, **inputs)[source]

Bases: WBCommand

Wrapped executable: wb_command -cifti-parcellate.

Extract timeseries from CIFTI file.

The input cifti file must have a brain models mapping on the chosen dimension, columns for .dtseries.

Examples

>>> ciftiparcel = CiftiParcellateWorkbench()
>>> ciftiparcel.inputs.in_file = 'sub-01XX_task-rest.dtseries.nii'
>>> ciftiparcel.inputs.out_file = 'sub_01XX_task-rest.ptseries.nii'
>>> ciftiparcel.inputs.atlas_label = 'schaefer_space-fsLR_den-32k_desc-400_atlas.dlabel.nii'
>>> ciftiparcel.inputs.direction = 'COLUMN'
>>> ciftiparcel.cmdline
wb_command -cifti-parcellate sub-01XX_task-rest.dtseries.nii     schaefer_space-fsLR_den-32k_desc-400_atlas.dlabel.nii COLUMN     sub_01XX_task-rest.ptseries.nii
Mandatory Inputs:
  • atlas_label (a pathlike object or string representing a file) – A cifti label file to use for the parcellation. Maps to a command-line argument: %s (position: 1).

  • direction (‘ROW’ or ‘COLUMN’) – Which mapping to parcellate (integer, ROW, or COLUMN). Maps to a command-line argument: %s (position: 2).

  • in_file (a pathlike object or string representing an existing file) – The cifti file to parcellate. Maps to a command-line argument: %s (position: 0).

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

  • cerebellum_area_metric (a pathlike object or string representing an existing file) – Specify the cerebellum surface metricto use. Maps to a command-line argument: -cerebellum-area-metric %s (position: 10).

  • cerebellum_area_surf (a pathlike object or string representing an existing file) – Specify the cerebellum surface to use. Maps to a command-line argument: -cerebellum-area-surf %s (position: 7).

  • cifti_weights (a pathlike object or string representing an existing file) – Use a cifti file containing weights. Maps to a command-line argument: -cifti-weights %s (position: 11).

  • cor_method (‘MEAN’ or ‘MAX’ or ‘MIN’ or ‘INDEXMAX’ or ‘INDEXMIN’ or ‘SUM’ or ‘PRODUCT’ or ‘STDEV’ or ‘SAMPSTDEV’ or ‘VARIANCE’ or ‘TSNR’ or ‘COV’ or ‘L2NORM’ or ‘MEDIAN’ or ‘MODE’ or ‘COUNT_NONZERO’) – Specify method of parcellation (default MEAN, or MODE if label data). Maps to a command-line argument: -method %s (position: 12).

  • 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: {})

  • left_area_metric (a pathlike object or string representing an existing file) – Specify the left surface metric to use. Maps to a command-line argument: -left-area-metric %s (position: 8).

  • left_area_surf (a pathlike object or string representing an existing file) – Specify the left surface to use. Maps to a command-line argument: -left-area-surface %s (position: 5).

  • only_numeric (a boolean) – Exclude non-numeric values. Maps to a command-line argument: -only-numeric (position: 13).

  • out_file (a pathlike object or string representing a file) – Output cifti file. Maps to a command-line argument: %s (position: 3).

  • right_area_metric (a pathlike object or string representing an existing file) – Specify the right surface metric to use. Maps to a command-line argument: -right-area-metric %s (position: 9).

  • right_area_surf (a pathlike object or string representing an existing file) – Specify the right surface to use. Maps to a command-line argument: -right-area-surface %s (position: 6).

  • spatial_weights (a string) – Use voxel volume and either vertex areas or metric files as weights. Maps to a command-line argument: -spatial-weights (position: 4).

Outputs:

out_file (a pathlike object or string representing an existing file) – Output CIFTI file.

class xcp_d.interfaces.workbench.CiftiSeparateMetric(command=None, terminal_output=None, write_cmdline=False, **inputs)[source]

Bases: WBCommand

Wrapped executable: wb_command  -cifti-separate.

Extract left or right hemisphere surfaces from CIFTI file (.dtseries).

Other structures can also be extracted. The input cifti file must have a brain models mapping on the chosen dimension, columns for .dtseries,

Examples

>>> ciftiseparate = CiftiSeparateMetric()
>>> ciftiseparate.inputs.in_file = 'sub-01XX_task-rest.dtseries.nii'
>>> ciftiseparate.inputs.metric = "CORTEX_LEFT" # extract left hemisphere
>>> ciftiseparate.inputs.out_file = 'sub_01XX_task-rest_hemi-L.func.gii'
>>> ciftiseparate.inputs.direction = 'COLUMN'
>>> ciftiseparate.cmdline
wb_command  -cifti-separate 'sub-01XX_task-rest.dtseries.nii'  COLUMN       -metric CORTEX_LEFT 'sub_01XX_task-rest_hemi-L.func.gii'
Mandatory Inputs:
  • direction (‘ROW’ or ‘COLUMN’) – Which dimension to smooth along, ROW or COLUMN. Maps to a command-line argument: %s (position: 1).

  • in_file (a pathlike object or string representing an existing file) – The input dense series. Maps to a command-line argument: %s (position: 0).

  • metric (a string) – Which of the structure eg CORTEX_LEFT CORTEX_RIGHTcheck https://www.humanconnectome.org/software/workbench-command/-cifti-separate . Maps to a command-line argument: -metric %s (position: 2).

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: {})

  • out_file (a pathlike object or string representing a file) – The gifti output, either left and right. Maps to a command-line argument: %s (position: 3).

Outputs:

out_file (a pathlike object or string representing an existing file) – Output CIFTI file.

class xcp_d.interfaces.workbench.CiftiSeparateVolumeAll(command=None, terminal_output=None, write_cmdline=False, **inputs)[source]

Bases: WBCommand

Wrapped executable: wb_command  -cifti-separate.

Extract volumetric data from CIFTI file (.dtseries).

Other structures can also be extracted. The input cifti file must have a brain models mapping on the chosen dimension, columns for .dtseries,

Examples

>>> ciftiseparate = CiftiSeparateVolumeAll()
>>> ciftiseparate.inputs.in_file = 'sub-01_task-rest.dtseries.nii'
>>> ciftiseparate.inputs.out_file = 'sub_01_task-rest_volumetric_data.nii.gz'
>>> ciftiseparate.inputs.label_file = 'sub_01_task-rest_labels.nii.gz'
>>> ciftiseparate.inputs.direction = 'COLUMN'
>>> ciftiseparate.cmdline
wb_command  -cifti-separate 'sub-01XX_task-rest.dtseries.nii' COLUMN         -volume-all 'sub_01_task-rest_volumetric_data.nii.gz'         -label 'sub_01_task-rest_labels.nii.gz'
Mandatory Inputs:
  • direction (‘ROW’ or ‘COLUMN’) – Which dimension to smooth along, ROW or COLUMN. Maps to a command-line argument: %s (position: 1).

  • in_file (a pathlike object or string representing an existing file) – The input dense series. Maps to a command-line argument: %s (position: 0).

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: {})

  • label_file (a pathlike object or string representing a file) – A discrete segmentation NIFTI output. Maps to a command-line argument: -label %s (position: 3).

  • out_file (a pathlike object or string representing a file) – The NIFTI output. Maps to a command-line argument: -volume-all %s -crop (position: 2).

Outputs:
  • label_file (a pathlike object or string representing an existing file) – NIFTI file with labels.

  • out_file (a pathlike object or string representing an existing file) – NIFTI file with volumetric data.

class xcp_d.interfaces.workbench.CiftiSurfaceResample(command=None, terminal_output=None, write_cmdline=False, **inputs)[source]

Bases: WBCommand

Wrapped executable: wb_command  -surface-resample.

Resample a surface from one sphere to another.

TODO: Improve documentation.

Mandatory Inputs:

in_file (a pathlike object or string representing an existing file) – The gifti file. Maps to a command-line argument: %s (position: 0).

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

  • current_sphere (a pathlike object or string representing an existing file) – the current sphere surface in gifti for in_file. Maps to a command-line argument: %s (position: 1).

  • 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: {})

  • metric (a string) – fixed for anatomic. Maps to a command-line argument: %s (position: 3).

  • new_sphere (a pathlike object or string representing an existing file) – the new sphere surface to be resample the in_file to, eg fsaverag5 or fsl32k. Maps to a command-line argument: %s (position: 2).

  • out_file (a pathlike object or string representing a file) – The gifti output, either left and right. Maps to a command-line argument: %s (position: 4).

Outputs:

out_file (a pathlike object or string representing an existing file) – Output gifti file.

class xcp_d.interfaces.workbench.ConvertAffine(command=None, terminal_output=None, write_cmdline=False, **inputs)[source]

Bases: WBCommand

Wrapped executable: wb_command -convert-affine.

Interface for wb_command’s -convert-affine command.

Mandatory Inputs:
  • fromwhat (a string) – World, itk, or flirt. Maps to a command-line argument: -from-%s (position: 0).

  • in_file (a pathlike object or string representing an existing file) – The input file. Maps to a command-line argument: %s (position: 1).

  • towhat (a string) – World, itk, or flirt. Maps to a command-line argument: -to-%s (position: 2).

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: {})

  • out_file (a pathlike object or string representing a file) – Maps to a command-line argument: %s (position: 3).

Outputs:

out_file (a pathlike object or string representing an existing file) – Output file.

class xcp_d.interfaces.workbench.FixCiftiIntent(from_file=None, resource_monitor=None, **inputs)[source]

Bases: SimpleInterface

This is not technically a Connectome Workbench interface, but it is related.

CiftiSmooth (-cifti-smooth) overwrites the output file’s intent to match a dtseries extension, even when it is a dscalar file. This interface sets the appropriate intent based on the extension.

We initially tried using a _post_run_hook in a modified version of the CiftiSmooth interface, but felt that the errors being raised were too opaque.

If in_file has the correct intent code, it will be returned without modification.

Mandatory Inputs:

in_file (a pathlike object or string representing an existing file) – CIFTI file to check.

Outputs:

out_file (a pathlike object or string representing an existing file) – Fixed CIFTI file.

class xcp_d.interfaces.workbench.ShowScene(command=None, terminal_output=None, write_cmdline=False, **inputs)[source]

Bases: WBCommand

Wrapped executable: wb_command -show-scene.

Offscreen rendering of scene to an image file.

Notes

wb_command -show-scene

<scene-file> - scene file <scene-name-or-number> - name or number (starting at one) of the scene in

the scene file

<image-file-name> - output image file name <image-width> - width of output image(s), in pixels <image-height> - height of output image(s), in pixels

[-use-window-size] - Override image size with window size

[-no-scene-colors] - Do not use background and foreground colors in scene

[-set-map-yoke] - Override selected map index for a map yoking group.

<Map Yoking Roman Numeral> - Roman numeral identifying the map yoking group (I, II, III, IV, V, VI, VII, VIII, IX, X) <Map Index> - Map index for yoking group. Indices start at 1 (one)

[-conn-db-login] - Login for scenes with files in Connectome Database

<Username> - Connectome DB Username <Password> - Connectome DB Password

Render content of browser windows displayed in a scene into image file(s). The image file name should be similar to “capture.png”. If there is only one image to render, the image name will not change. If there is more than one image to render, an index will be inserted into the image name: “capture_01.png”, “capture_02.png” etc.

If the scene references files in the Connectome Database, the “-conn-db-login” option is available for providing the username and password. If this options is not specified, the username and password stored in the user’s preferences is used.

The image format is determined by the image file extension. The available image formats may vary by operating system. Image formats available on this system are:

bmp jpeg jpg png ppm tif tiff

The result of using the “-use-window-size” option is dependent upon the version used to create the scene.

  • Versions 1.2 and newer contain the width and

height of the graphics region. The output image will be the width and height from the scene and the image width and height specified on the command line is ignored. * If the scene does not contain the width and height of the graphics region, the width and height specified on the command line is used for the size of the output image.

Mandatory Inputs:
  • image_height (an integer) – Height of output image(s), in pixels. Maps to a command-line argument: %s (position: 4).

  • image_width (an integer) – Width of output image(s), in pixels. Maps to a command-line argument: %s (position: 3).

  • scene_file (a pathlike object or string representing an existing file) – Maps to a command-line argument: %s (position: 0).

  • scene_name_or_number (an integer or a string) – Name or number (starting at one) of the scene in the scene file. Maps to a command-line argument: %s (position: 1).

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: {})

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

Outputs:

out_file (a pathlike object or string representing an existing file) – Output image file name.

class xcp_d.interfaces.workbench.SurfaceAverage(command=None, terminal_output=None, write_cmdline=False, **inputs)[source]

Bases: WBCommand

Wrapped executable: wb_command -surface-average.

Average surface files together.

wb_command -surface-average
    <surface-out> - output - the output averaged surface
    [-stddev] - compute 3D sample standard deviation
        <stddev-metric-out> - output - the output metric for 3D sample standard deviation
    [-uncertainty] - compute caret5 'uncertainty'
        <uncert-metric-out> - output - the output metric for uncertainty
    [-surf] - repeatable - specify a surface to include in the average
        <surface> - a surface file to average
    [-weight] - specify a weighted average
        <weight> - the weight to use (default 1)

The 3D sample standard deviation is computed as ‘sqrt(sum(squaredlength(xyz - mean(xyz)))/(n - 1))’.

Uncertainty is a legacy measure used in caret5, and is computed as ‘sum(length(xyz - mean(xyz)))/n’.

When weights are used, the 3D sample standard deviation treats them as reliability weights.

Mandatory Inputs:
  • surface_in1 (a pathlike object or string representing an existing file) – Specify a surface to include in the average. Maps to a command-line argument: -surf %s (position: 1).

  • surface_in2 (a pathlike object or string representing an existing file) – Specify a surface to include in the average. Maps to a command-line argument: -surf %s (position: 2).

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: {})

  • out_file (a pathlike object or string representing a file) – Output - the output averaged surface. Maps to a command-line argument: %s (position: 0).

Outputs:

out_file (a pathlike object or string representing an existing file) – Output file.

class xcp_d.interfaces.workbench.SurfaceGenerateInflated(command=None, terminal_output=None, write_cmdline=False, **inputs)[source]

Bases: WBCommand

Wrapped executable: wb_command -surface-generate-inflated.

Generate inflated surface.

wb_command -surface-generate-inflated
<anatomical-surface-in> - the anatomical surface
<inflated-surface-out> - output - the output inflated surface
<very-inflated-surface-out> - output - the output very inflated surface

[-iterations-scale] - optional iterations scaling
    <iterations-scale-value> - iterations-scale value

Generate inflated and very inflated surfaces. The output surfaces are ‘matched’ (have same XYZ range) to the anatomical surface. In most cases, an iterations-scale of 1.0 (default) is sufficient. However, if the surface contains a large number of vertices (150,000), try an iterations-scale of 2.5.

Mandatory Inputs:

anatomical_surface_in (a pathlike object or string representing an existing file) – The anatomical surface. Maps to a command-line argument: %s (position: 0).

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: {})

  • inflated_out_file (a pathlike object or string representing a file) – Output - the output inflated surface. Maps to a command-line argument: %s (position: 1).

  • iterations_scale_value (a float) – Iterations-scale value. Maps to a command-line argument: -iterations-scale %f (position: 3).

  • very_inflated_out_file (a pathlike object or string representing a file) – Output - the output very inflated surface. Maps to a command-line argument: %s (position: 2).

Outputs:
  • inflated_out_file (a pathlike object or string representing an existing file) – Inflated output file.

  • very_inflated_out_file (a pathlike object or string representing an existing file) – Very inflated output file.

class xcp_d.interfaces.workbench.SurfaceSphereProjectUnproject(command=None, terminal_output=None, write_cmdline=False, **inputs)[source]

Bases: WBCommand

Wrapped executable: wb_command -surface-sphere-project-unproject.

Copy registration deformations to different sphere.

wb_command -surface-sphere-project-unproject
    <sphere-in> - a sphere with the desired output mesh
    <sphere-project-to> - a sphere that aligns with sphere-in
    <sphere-unproject-from> - <sphere-project-to> deformed to the desired output space
    <sphere-out> - output - the output sphere
Mandatory Inputs:
  • in_file (a pathlike object or string representing an existing file) – A sphere with the desired output mesh. Maps to a command-line argument: %s (position: 0).

  • sphere_project_to (a pathlike object or string representing an existing file) – A sphere that aligns with sphere-in. Maps to a command-line argument: %s (position: 1).

  • sphere_unproject_from (a pathlike object or string representing an existing file) – Deformed to the desired output space. Maps to a command-line argument: %s (position: 2).

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: {})

  • out_file (a pathlike object or string representing a file) – The sphere output file. Maps to a command-line argument: %s (position: 3).

Outputs:

out_file (a pathlike object or string representing an existing file) – Output file.