xcp_d.interfaces.workbench module
Custom wb_command interfaces.
- class xcp_d.interfaces.workbench.CiftiConvert(**inputs)[source]
Bases:
WBCommandWrapped 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:
{})num_threads (an integer) – Set number of threads. (Nipype default value:
1)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.CiftiCorrelation(**inputs)[source]
Bases:
WBCommandWrapped executable:
wb_command -cifti-correlation.Generate correlation of rows in CIFTI file.
This interface only supports parcellated time series files for now.
Examples
>>> cifticorrelation = CiftiCorrelation() >>> cifticorrelation.inputs.in_file = 'sub-01XX_task-rest_bold.ptseries.nii' >>> cifticorrelation.inputs.out_file = 'sub-01XX_task-rest_bold.pconn.nii' >>> cifticorrelation.cmdline wb_command -cifti-correlation sub-01XX_task-rest_bold.ptseries.nii sub-01XX_task-rest_bold.pconn.nii
- Mandatory Inputs:
in_file (a pathlike object or string representing an existing file) – Input file to correlate. 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:
{})num_threads (an integer) – Set number of threads. (Nipype default value:
1)out_file (a pathlike object or string representing a file) – Output cifti file. Maps to a command-line argument:
%s(position: 1).
- Outputs:
out_file (a pathlike object or string representing an existing file) – Output CIFTI file.
- class xcp_d.interfaces.workbench.CiftiCreateDenseFromTemplate(**inputs)[source]
Bases:
WBCommandWrapped 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.volume_all = "parcellation.nii.gz" >>> ccdft.inputs.from_cropped = True >>> ccdft.inputs.left_metric = "lh.func.gii" >>> ccdft.inputs.right_metric = "rh.func.gii" >>> ccdft.cmdline wb_command -cifti-create-dense-from-template sub-01_task-rest_bold.dtseries.nii resampled_parcellation.dscalar.nii -volume-all parcellation.nii.gz -from-cropped -metric CORTEX_LEFT lh.func.gii -metric CORTEX_RIGHT rh.func.gii
- Mandatory Inputs:
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.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:
{})from_cropped (a boolean) – Use input data from cropped volume files. Maps to a command-line argument:
-from-cropped(position: 3). (Nipype default value:False)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: 6).left_metric (a pathlike object or string representing an existing file) – Use input data from surface files. Input surface file. Maps to a command-line argument:
-metric CORTEX_LEFT %s(position: 4).num_threads (an integer) – Set number of threads. (Nipype default value:
1)out_file (a pathlike object or string representing a file) – The output cifti file. Maps to a command-line argument:
%s(position: 1).right_metric (a pathlike object or string representing an existing file) – Use input data from surface files. Input surface file. Maps to a command-line argument:
-metric CORTEX_RIGHT %s(position: 5).volume_all (a pathlike object or string representing an existing file) – Use input data from volume files. Input volume file. Maps to a command-line argument:
-volume-all %s(position: 2).
- Outputs:
out_file (a pathlike object or string representing an existing file) – Output CIFTI file.
- class xcp_d.interfaces.workbench.CiftiCreateDenseScalar(**inputs)[source]
Bases:
WBCommandWrapped 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).num_threads (an integer) – Set number of threads. (Nipype default value:
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.CiftiMath(**inputs)[source]
Bases:
WBCommandWrapped executable:
wb_command -cifti-math.Evaluate expression on CIFTI files.
I should use a dynamic trait for the variables going into the math expression, but I hardcoded data and mask because those are the only ones I’m currently using.
Examples
>>> ciftimath = CiftiMath() >>> ciftimath.inputs.data = 'sub-01XX_task-rest.dtseries.nii' >>> ciftimath.inputs.out_file = 'mathed_sub_01XX_task-rest.dtseries.nii' >>> ciftimath.inputs.expression = 'data * 2' >>> ciftimath.cmdline wb_command -cifti-math "data * 2" mathed_sub_01XX_task-rest.dtseries.nii -var data sub-01XX_task-rest.dtseries.nii
- Mandatory Inputs:
data (a pathlike object or string representing an existing file) – First data file to use in the math operation. Maps to a command-line argument:
-var data %s(position: 2).expression (a string) – Math expression. 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:
{})mask (a pathlike object or string representing an existing file) – Second data file to use in the math operation. Maps to a command-line argument:
-var mask %s -select 1 1(position: 3).num_threads (an integer) – Set number of threads. (Nipype default value:
1)out_file (a pathlike object or string representing a file) – Output cifti file. Maps to a command-line argument:
%s(position: 1).
- Outputs:
out_file (a pathlike object or string representing an existing file) – Output CIFTI file.
- class xcp_d.interfaces.workbench.CiftiParcellateWorkbench(**inputs)[source]
Bases:
WBCommandWrapped 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). (Nipype default value:MEAN)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).num_threads (an integer) – Set number of threads. (Nipype default value:
1)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(**inputs)[source]
Bases:
WBCommandWrapped 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:
{})num_threads (an integer) – Set number of threads. (Nipype default value:
1)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(**inputs)[source]
Bases:
WBCommandWrapped 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).num_threads (an integer) – Set number of threads. (Nipype default value:
1)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.CiftiSmooth(**inputs)[source]
Bases:
WBCommandWrapped executable:
wb_command -cifti-smoothing.Smooth a CIFTI file.
The input cifti file must have a brain models mapping on the chosen dimension, columns for .dtseries, and either for .dconn. By default, data in different structures is smoothed independently (i.e., “parcel constrained” smoothing), so volume structures that touch do not smooth across this boundary. Specify
merged_volumeto ignore these boundaries. Surface smoothing uses theGEO_GAUSS_AREAsmoothing method.The
*_corrected_areasoptions are intended for when it is unavoidable to smooth on group average surfaces, it is only an approximate correction for the reduction of structure in a group average surface. It is better to smooth the data on individuals before averaging, when feasible.The
fix_zeros_*options will treat values of zero as lack of data, and not use that value when generating the smoothed values, but will fill zeros with extrapolated values. The ROI should have a brain models mapping along columns, exactly matching the mapping of the chosen direction in the input file. Data outside the ROI is ignored.>>> from xcp_d.interfaces.workbench import CiftiSmooth >>> smooth = CiftiSmooth() >>> smooth.inputs.in_file = 'sub-01_task-rest.dtseries.nii' >>> smooth.inputs.sigma_surf = 4 >>> smooth.inputs.sigma_vol = 4 >>> smooth.inputs.direction = 'COLUMN' >>> smooth.inputs.right_surf = 'sub-01.R.midthickness.32k_fs_LR.surf.gii' >>> smooth.inputs.left_surf = 'sub-01.L.midthickness.32k_fs_LR.surf.gii' >>> smooth.cmdline 'wb_command -cifti-smoothing sub-01_task-rest.dtseries.nii 4.0 4.0 COLUMN smoothed_sub-01_task-rest.dtseries.nii -left-surface sub-01.L.midthickness.32k_fs_LR.surf.gii -right-surface sub-01.R.midthickness.32k_fs_LR.surf.gii'
- Mandatory Inputs:
direction (‘ROW’ or ‘COLUMN’) – Which dimension to smooth along, ROW or COLUMN. Maps to a command-line argument:
%s(position: 3).in_file (a pathlike object or string representing an existing file) – The input CIFTI file. Maps to a command-line argument:
%s(position: 0).left_surf (a pathlike object or string representing an existing file) – Specify the left surface to use. Maps to a command-line argument:
-left-surface %s(position: 5).right_surf (a pathlike object or string representing an existing file) – Specify the right surface to use. Maps to a command-line argument:
-right-surface %s(position: 7).sigma_surf (a float) – The sigma for the gaussian surface smoothing kernel, in mm. Maps to a command-line argument:
%s(position: 1).sigma_vol (a float) – The sigma for the gaussian volume smoothing kernel, in mm. 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.cerebellum_corrected_areas (a pathlike object or string representing an existing file) – Vertex areas (as a metric) to use instead of computing them from the cerebellum surface. Maps to a command-line argument:
cerebellum-corrected-areas %s(position: 10). Requires inputs:cerebellum_surf.cerebellum_surf (a pathlike object or string representing an existing file) – Specify the cerebellum surface to use. Maps to a command-line argument:
-cerebellum-surface %s(position: 9).cifti_roi (a pathlike object or string representing an existing file) – CIFTI file for ROI smoothing. Maps to a command-line argument:
-cifti-roi %s(position: 11).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:
{})fix_zeros_surf (a boolean) – Treat values of zero on the surface as missing data. Maps to a command-line argument:
-fix-zeros-surface(position: 13).fix_zeros_vol (a boolean) – Treat values of zero in the volume as missing data. Maps to a command-line argument:
-fix-zeros-volume(position: 12).left_corrected_areas (a pathlike object or string representing an existing file) – Vertex areas (as a metric) to use instead of computing them from the left surface. Maps to a command-line argument:
-left-corrected-areas %s(position: 6).merged_volume (a boolean) – Smooth across subcortical structure boundaries. Maps to a command-line argument:
-merged-volume(position: 14).num_threads (an integer) – Set number of threads. (Nipype default value:
1)out_file (a pathlike object or string representing a file) – The output CIFTI. Maps to a command-line argument:
%s(position: 4).right_corrected_areas (a pathlike object or string representing an existing file) – Vertex areas (as a metric) to use instead of computing them from the right surface. Maps to a command-line argument:
-right-corrected-areas %s(position: 8).
- Outputs:
out_file (a pathlike object or string representing an existing file) – Output CIFTI file.
- class xcp_d.interfaces.workbench.CiftiSurfaceResample(**inputs)[source]
Bases:
WBCommandWrapped executable:
wb_command -surface-resample.Resample a surface to a different mesh.
TODO: Improve documentation.
- Mandatory Inputs:
in_file (a pathlike object or string representing an existing file) – The surface file to resample. 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) – A sphere surface with the mesh that the input surface is currently on. 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:
{})method (‘BARYCENTRIC’ or ‘ADAP_BARY_AREA’) – The method name. The BARYCENTRIC method is generally recommended for anatomical surfaces, in order to minimize smoothing. Maps to a command-line argument:
%s(position: 3). (Nipype default value:BARYCENTRIC)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. Maps to a command-line argument:
%s(position: 2).num_threads (an integer) – Set number of threads. (Nipype default value:
1)out_file (a pathlike object or string representing a file) – The output surface file. 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.FixCiftiIntent(from_file=None, resource_monitor=None, **inputs)[source]
Bases:
SimpleInterfaceThis 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(**inputs)[source]
Bases:
WBCommandWrapped 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:
{})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:
%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(**inputs)[source]
Bases:
WBCommandWrapped 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:
{})num_threads (an integer) – Set number of threads. (Nipype default value:
1)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(**inputs)[source]
Bases:
WBCommandWrapped 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).num_threads (an integer) – Set number of threads. (Nipype default value:
1)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(**inputs)[source]
Bases:
WBCommandWrapped executable:
wb_command -surface-sphere-project-unproject.Copy registration deformations to different sphere.
A surface registration starts with an input sphere, and moves its vertices around on the sphere until it matches the template data. This means that the registration deformation is actually represented as the difference between two separate files - the starting sphere, and the registered sphere. Since the starting sphere of the registration may not have vertex correspondence to any other sphere (often, it is a native sphere), it can be inconvenient to manipulate or compare these deformations across subjects, etc.
The purpose of this command is to be able to apply these deformations onto a new sphere of the user’s choice, to make it easier to compare or manipulate them. Common uses are to concatenate two successive separate registrations (e.g. Human to Chimpanzee, and then Chimpanzee to Macaque) or inversion (for dedrifting or symmetric registration schemes).
<sphere-in> must already be considered to be in alignment with one of the two ends of the registration (if your registration is Human to Chimpanzee, <sphere-in> must be in register with either Human or Chimpanzee).
The ‘project-to’ sphere must be the side of the registration that is aligned with <sphere-in> (if your registration is Human to Chimpanzee, and <sphere-in> is aligned with Human, then ‘project-to’ should be the original Human sphere).
The ‘unproject-from’ sphere must be the remaining sphere of the registration (original vs deformed/registered). The output is as if you had run the same registration with <sphere-in> as the starting sphere, in the direction of deforming the ‘project-to’ sphere to create the ‘unproject-from’ sphere.
Note that this command cannot check for you what spheres are aligned with other spheres, and using the wrong spheres or in the incorrect order will not necessarily cause an error message. In some cases, it may be useful to use a new, arbitrary sphere as the input, which can be created with the -surface-create-sphere command.
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:
{})num_threads (an integer) – Set number of threads. (Nipype default value:
1)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.
- class xcp_d.interfaces.workbench.WBCommand(**inputs)[source]
Bases:
WBCommandA base interface for wb_command.
This inherits from Nipype’s WBCommand interface, but adds a num_threads input.
- 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:
{})
- property num_threads
Get number of threads.