eXtensible Connectivity Pipeline-style quality control files

Generate eXtensible Connectivity Pipeline-style quality control files

Columns

substr

subject label [1]

sesstr

session label [1]

taskstr

task label [1]

runint

run index [1]

descstr

description [1]

spacestr

space label [1]

meanFDfloat

mean Jenkinson framewise displacement [2] CPAC.generate_motion_statistics.calculate_FD_J

relMeansRMSMotionfloat

“mean value of RMS motion” [3]

relMaxRMSMotionfloat

“maximum vaue of RMS motion” [3]

meanDVInitfloat

“mean DVARS” [3]

meanDVFinalfloat

“mean DVARS” [3]

nVolCensoredint

“total number of volume(s) censored [3]

nVolsRemovedint

number of volumes in derivative minus number of volumes in original functional scan

motionDVCorrInitfloat

“correlation of RMS and DVARS before regresion” [3]

motionDVCorrFinalfloat

“correlation of RMS and DVARS after regresion” [3]

coregDicefloat

“Coregsitration of Functional and T1w:[…] Dice index” [3] [4]

coregJaccardfloat

“Coregsitration of Functional and T1w:[…] Jaccard index” [3] [4]

coregCrossCorrfloat

“Coregsitration of Functional and T1w:[…] cross correlation” [3] [4]

coregCoveragfloat

“Coregsitration of Functional and T1w:[…] Coverage index” [3] [4]

normDicefloat

“Normalization of T1w/Functional to Template:[…] Dice index” [3] [4]

normJaccardfloat

“Normalization of T1w/Functional to Template:[…] Jaccard index” [3] [4]

normCrossCorrfloat

“Normalization of T1w/Functional to Template:[…] cross correlation” [3] [4]

normCoveragefloat

“Normalization of T1w/Functional to Template:[…] Coverage index” [3] [4]

CPAC.qc.xcp.calculate_overlap(image_pair)[source]

Function to calculate Dice, Jaccard, CrossCorr and Coverage:cite:cite-Penn19 from a pair of arrays

Parameters:
image_pair2-tuple

array of which to calculate overlaps metrics

Returns:
coefficentsdict
coeffiecients[‘dice’]float

Dice index

coeffiecients[‘jaccard’]float

Jaccard index

coeffiecients[‘cross_corr’]float

cross-correlation

coeffiecients[‘coverage’]float

coverage index

Examples

>>> import numpy as np
>>> a1 = np.array([0, 0, 0, 1, 1, 1])
>>> a2 = np.array([0, 0, 1, 1, 0, 1])
>>> tuple(calculate_overlap((a1, a2)).values())
(0.6666666666666666, 0.5, 0.33333333333333326, 0.6666666666666666)
>>> tuple(calculate_overlap((a1, a1)).values())
(1.0, 1.0, 0.9999999999999998, 1.0)
>>> tuple(calculate_overlap((a2, a2)).values())
(1.0, 1.0, 0.9999999999999998, 1.0)
CPAC.qc.xcp.dvcorr(dvars, fdj)[source]

Function to correlate DVARS and FD-J

CPAC.qc.xcp.generate_xcp_qc(space, desc, original_anat, final_anat, original_func, final_func, space_T1w_bold, movement_parameters, dvars, censor_indices, framewise_displacement_jenkinson, dvars_after, fdj_after, template=None)[source]

Function to generate an RBC-style QC CSV

Parameters:
spacestr

‘native’ or ‘template’

descstr

description string

original_anatstr

path to original ‘T1w’ image

final_anatstr

path to ‘desc-preproc_T1w’ image

original_funcstr

path to original ‘bold’ image

final_boldstr

path to ‘desc-preproc_bold’ image

space_T1w_boldstr

path to ‘space-T1w_desc-mean_bold’ image

movement_parameters: str

path to movement parameters

dvarsstr

path to DVARS before motion correction

censor_indiceslist

list of indices of censored volumes

framewise_displacement_jenkinsonstr

path to framewise displacement (Jenkinson) before motion correction

dvars_afterstr

path to DVARS on final ‘bold’ image

fdj_afterstr

path to framewise displacement (Jenkinson) on final ‘bold’ image

templatestr

path to template

Returns:
str

path to desc-xcp_quality TSV

CPAC.qc.xcp.qc_xcp_native(wf, cfg, strat_pool, pipe_num, opt=None)[source]
{‘name’: ‘qc_xcp_native’,

‘config’: [‘pipeline_setup’, ‘output_directory’, ‘quality_control’], ‘switch’: [‘generate_xcpqc_files’], ‘option_key’: ‘None’, ‘option_val’: ‘None’, ‘inputs’: [(‘bold’, ‘subject’, ‘scan’, ‘T1w’, ‘max-displacement’, ‘dvars’,

‘censor-indices’, ‘desc-preproc_bold’, ‘desc-preproc_T1w’, ‘space-T1w_desc-mean_bold’, ‘space-bold_desc-brain_mask’, ‘movement-parameters’, ‘framewise-displacement-jenkinson’, ‘rels-displacement’, ‘coordinate-transformation’)],

‘outputs’: [‘desc-xcp_quality’]}

CPAC.qc.xcp.qc_xcp_skullstripped(wf, cfg, strat_pool, pipe_num, opt=None)[source]

Same as qc_xcp_native except no motion inputs. Node Block: {‘name’: ‘qc_xcp_skullstripped’,

‘config’: [‘pipeline_setup’, ‘output_directory’, ‘quality_control’], ‘switch’: [‘generate_xcpqc_files’], ‘option_key’: ‘None’, ‘option_val’: ‘None’, ‘inputs’: [(‘bold’, ‘subject’, ‘scan’, ‘T1w’, ‘desc-preproc_bold’,

‘desc-preproc_T1w’, ‘space-T1w_desc-mean_bold’, ‘space-bold_desc-brain_mask’)],

‘outputs’: [‘desc-xcp_quality’]}

CPAC.qc.xcp.qc_xcp_template(wf, cfg, strat_pool, pipe_num, opt=None)[source]
{‘name’: ‘qc_xcp_template’,

‘config’: [‘pipeline_setup’, ‘output_directory’, ‘quality_control’], ‘switch’: [‘generate_xcpqc_files’], ‘option_key’: ‘None’, ‘option_val’: ‘None’, ‘inputs’: [(‘bold’, ‘subject’, ‘scan’, ‘T1w’,

‘T1w-brain-template-funcreg’, ‘space-T1w_desc-mean_bold’, ‘space-template_desc-preproc_bold’, ‘desc-preproc_T1w’, ‘space-template_desc-bold_mask’)],

‘outputs’: [‘space-template_desc-xcp_quality’]}

CPAC.qc.xcp.strings_from_bids(final_func)[source]

Function to gather BIDS entities into a dictionary

Parameters:
final_funcstr
Returns:
dict

Examples

>>> fake_path = (
...     '/path/to/sub-fakeSubject_ses-fakeSession_task-peer_run-3_'
...     'atlas-Schaefer400_space-MNI152NLin6_res-1x1x1_'
...     'desc-NilearnPearson_connectome.tsv')
>>> strings_from_bids(fake_path)['desc']
'NilearnPearson'
>>> strings_from_bids(fake_path)['space']
'MNI152NLin6'

References

[1] (1,2,3,4,5,6)

BIDS-contributors. 2021. Appendix IX: Entities. The Brain Imaging Data Structure (BIDS) Specification, 1.6.0

[2]

Jenkinson, M., Bannister, P., Brady, M., and Smith, S. 2002 October. Improved optimization for the robust and accurate linear registration and motion correction of brain images. Neuroimage, 17 :2 , pp. 825–841 doi:10.1006/nimg.2002.1132

[3] (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)

Ciric, R., Rosen, A. F. G., Erus, G., Cieslak, M., Adebimpe, A., Cook, P. A., Bassett, D. S., Davatzikos, C., Wolf, D. H., and Satterthwaite, T. D. 2019. Quality control dictionary. xcpEngine 1.0 documentation, a7254873

[4] (1,2,3,4,5,6,7,8)

The Lifespan Informatics and Neuroimaging Center at the University of Pennylvannia, 2019 January. maskOverlap.R.