The pyAFQ API methods#
After defining your pyAFQ API object, you can ask for the output of any step of the pipeline. It is common for users to just call export_all (for example, myafq.export_all()). However, if the user only wants the tractography, the user can instead call myafq.export(“streamlines”). Here is a list of all of pyAFQ’s possible outputs:
- dwi_data_file:
Path to DWI data file
- bval_file:
Path to bval file
- bvec_file:
Path to bvec file
- output_dir:
Path to output directory
- best_scalar:
Go-to scalar for visualizations
- base_fname:
Base file name for outputs
- pve_csf:
Cerebrospinal fluid partial volume estimate map
- pve_gm:
Gray matter partial volume estimate map
- pve_wm:
White matter partial volume estimate map
- n_threads:
Configure the number of threads to use for Numba
- low_mem:
whether to use low-memory versions of algorithms where available
- onnx_kwargs:
The execution provider to use for onnx models
- synthseg_model:
full path to the synthseg2 model segmentations
- mx_model:
full path to the multi-axial model for brain extraction outputs
- t1w_brain_mask:
full path to a nifti file containing brain mask from T1w image
- t1_masked:
full path to a nifti file containing the T1w masked
- t1_subcortex:
full path to a nifti file containing segmentation of subcortical structures from T1w image using Brainchop
- data:
DWI data as an ndarray for selected b values
- gtab:
A DIPY GradientTable with all the gradient information
- dwi:
DWI data in a Nifti1Image
- dwi_affine:
the affine transformation of the DWI data
- b0:
full path to a nifti file containing the mean b0
- t1w_over_b0:
full path to a nifti file containing the T1w over mean b0 which is a proxy for R1 [1]_
- masked_b0:
full path to a nifti file containing the mean b0 after applying the brain mask
- dti_tf:
DTI TensorFit object
- dti_params:
full path to a nifti file containing parameters for the DTI fit
- dti_s0:
s0 values of DTI fit
- fwdti_tf:
Free-water DTI TensorFit object
- fwdti_params:
Full path to a nifti file containing parameters for the free-water DTI fit.
- dki_tf:
DKI DiffusionKurtosisFit object
- dki_params:
full path to a nifti file containing parameters for the DKI fit
- dki_s0:
s0 values of DKI fit
- msdki_tf:
Mean Signal DKI DiffusionKurtosisFit object
- msdki_params:
full path to a nifti file containing parameters for the Mean Signal DKI fit
- msdki_s0:
s0 values of Mean Signal DKI fit
- msdki_msd:
full path to a nifti file containing the MSDKI mean signal diffusivity
- msdki_msk:
full path to a nifti file containing the MSDKI mean signal kurtosis
- csd_params:
full path to a nifti file containing parameters for the CSD fit
- csd_aodf_params:
full path to a nifti file containing SSST CSD ODFs filtered by unified filtering [1]
- csd_aodf_asi:
full path to a nifti file containing the CSD Asymmetric Index (ASI) [1]
- csd_aodf_opm:
full path to a nifti file containing the CSD odd-power map [1]
- csd_pmap:
full path to a nifti file containing the anisotropic power map
- csd_ai:
full path to a nifti file containing the anisotropic index
- gq_params:
full path to a nifti file containing ODF for the Generalized Q-Sampling
- gq_iso:
full path to a nifti file containing isotropic diffusion component
- rumba_params:
ODF for the RUMBA-SD model
- rumba_f_csf:
full path to a nifti file containing the CSF volume fraction for each voxel
- rumba_f_gm:
full path to a nifti file containing the GM volume fraction for each voxel
- rumba_f_wm:
full path to a nifti file containing the white matter volume fraction for each voxel
- opdt_params:
full path to a nifti file containing parameters for the Orientation Probability Density Transform shm_coeff
- opdt_gfa:
full path to a nifti file containing GFA
- opdt_pmap:
full path to a nifti file containing the anisotropic power map from OPDT
- opdt_ai:
full path to a nifti file containing the anisotropic index from OPDT
- csa_params:
full path to a nifti file containing parameters for the Constant Solid Angle shm_coeff
- csa_gfa:
full path to a nifti file containing GFA
- csa_pmap:
full path to a nifti file containing the anisotropic power map from CSA
- csa_ai:
full path to a nifti file containing the anisotropic index from CSA
- fwdti_fa:
full path to a nifti file containing the Free-water DTI fractional anisotropy
- fwdti_md:
full path to a nifti file containing the Free-water DTI mean diffusivity
- fwdti_fwf:
full path to a nifti file containing the Free-water DTI free water fraction
- dti_fa:
full path to a nifti file containing the DTI fractional anisotropy
- dti_lt0:
Image of first element in the DTI tensor according to DIPY convention i.e. Dxx (rate of diffusion from the left to right side of the brain)
- dti_lt1:
Image of second element in the DTI tensor according to DIPY convention i.e. Dyy (rate of diffusion from the posterior to anterior part of the brain)
- dti_lt2:
Image of third element in the DTI tensor according to DIPY convention i.e. Dzz (rate of diffusion from the inferior to superior part of the brain)
- dti_lt3:
Image of fourth element in the DTI tensor according to DIPY convention i.e. Dxy (rate of diffusion in the xy plane indicating the relationship between the x and y directions)
- dti_lt4:
Image of fifth element in the DTI tensor according to DIPY convention i.e. Dxz (rate of diffusion in the xz plane indicating the relationship between the x and z directions)
- dti_lt5:
Image of sixth element in the DTI tensor according to DIPY convention i.e. Dyz (rate of diffusion in the yz plane indicating the relationship between the y and z directions)
- dti_cfa:
full path to a nifti file containing the DTI color fractional anisotropy
- dti_pdd:
full path to a nifti file containing the DTI principal diffusion direction
- dti_md:
full path to a nifti file containing the DTI mean diffusivity
- dti_ga:
full path to a nifti file containing the DTI geodesic anisotropy
- dti_rd:
full path to a nifti file containing the DTI radial diffusivity
- dti_ad:
full path to a nifti file containing the DTI axial diffusivity
- dki_kt0:
Image of first element in the DKI kurtosis model
- dki_kt1:
Image of second element in the DKI kurtosis model
- dki_kt2:
Image of third element in the DKI kurtosis model
- dki_kt3:
Image of fourth element in the DKI kurtosis model
- dki_kt4:
Image of fifth element in the DKI kurtosis model
- dki_kt5:
Image of sixth element in the DKI kurtosis model
- dki_kt6:
Image of seventh element in the DKI kurtosis model
- dki_kt7:
Image of eighth element in the DKI kurtosis model
- dki_kt8:
Image of ninth element in the DKI kurtosis model
- dki_kt9:
Image of tenth element in the DKI kurtosis model
- dki_kt10:
Image of eleventh element in the DKI kurtosis model
- dki_kt11:
Image of twelfth element in the DKI kurtosis model
- dki_kt12:
Image of thirteenth element in the DKI kurtosis model
- dki_kt13:
Image of fourteenth element in the DKI kurtosis model
- dki_kt14:
Image of fifteenth element in the DKI kurtosis model
- dki_lt0:
Image of first element in the DTI tensor from DKI
- dki_lt1:
Image of second element in the DTI tensor from DKI
- dki_lt2:
Image of third element in the DTI tensor from DKI
- dki_lt3:
Image of fourth element in the DTI tensor from DKI
- dki_lt4:
Image of fifth element in the DTI tensor from DKI
- dki_lt5:
Image of sixth element in the DTI tensor from DKI
- dki_cfa:
full path to a nifti file containing the DKI color fractional anisotropy
- dki_fa:
full path to a nifti file containing the DKI fractional anisotropy
- dki_md:
full path to a nifti file containing the DKI mean diffusivity
- dki_awf:
full path to a nifti file containing the DKI axonal water fraction
- dki_mk:
full path to a nifti file containing the DKI mean kurtosis file
- dki_kfa:
full path to a nifti file containing the DKI kurtosis FA file
- dki_cl:
full path to a nifti file containing the DKI linearity file
- dki_cp:
full path to a nifti file containing the DKI planarity file
- dki_cs:
full path to a nifti file containing the DKI sphericity file
- dki_ga:
full path to a nifti file containing the DKI geodesic anisotropy
- dki_rd:
full path to a nifti file containing the DKI radial diffusivity
- dki_ad:
full path to a nifti file containing the DKI axial diffusivity
- dki_rk:
full path to a nifti file containing the DKI radial kurtosis
- dki_ak:
full path to a nifti file containing the DKI axial kurtosis file
- brain_mask:
full path to a nifti file containing the brain mask
- bundle_dict:
Dictionary defining the different bundles to be segmented
- reg_template:
a Nifti1Image containing the template for registration
- tmpl_name:
the name of the template space for file outputs
- wm_gm_interface:
full path to a nifti file containing the white matter/gray matter interface
- pve_internal:
WM+GM+CSF segmentation
- msmtcsd_params:
full path to a nifti file containing parameters for the MSMT CSD white matter fit
- msmtcsd_gm:
full path to a nifti file containing parameters for the MSMT CSD gray matter fit
- msmtcsd_csf:
full path to a nifti file containing parameters for the MSMT CSD cerebrospinal fluid fit
- msmt_apm:
full path to a nifti file containing the anisotropic power map
- msmt_aodf_params:
full path to a nifti file containing MSMT CSD ODFs filtered by unified filtering [1]
- msmt_aodf_asi:
full path to a nifti file containing the MSMT CSD Asymmetric Index (ASI) [1]
- msmt_aodf_opm:
full path to a nifti file containing the MSMT CSD odd-power map [1]
- msmt_aodf_nufid:
full path to a nifti file containing the MSMT CSD Number of fiber directions (nufid) map [1]
- csd_aodf_nufid:
full path to a nifti file containing the CSD Number of fiber directions (nufid) map [1]
- b0_warped:
full path to a nifti file containing b0 transformed to template space
- template_xform:
full path to a nifti file containing registration template transformed to subject space
- rois:
dictionary of full paths to Nifti1Image files of ROIs transformed to subject space
- mapping:
mapping from subject to template space.
- reg_subject:
Nifti1Image which represents this subject when registering the subject to the template
- bundles:
full path to a trk/trx file containing containing segmented streamlines, labeled by bundle
- indiv_bundles:
dictionary of paths, where each path is a full path to a trk file containing the streamlines of a given bundle.
- sl_counts:
full path to a JSON file containing streamline counts
- bundle_lengths:
full path to a CSV file containing median + min + max bundle lengths
- density_maps:
full path to 4d nifti file containing streamline counts per voxel per bundle, where the 4th dimension encodes the bundle
- profiles:
full path to a CSV file containing tract profiles
- scalar_dict:
dictionary mapping scalar names to their respective file paths
- streamlines:
full path to the complete, unsegmented tractography file
- all_bundles_figure:
figure for the visualization of the recognized bundles in the subject’s brain.
- indiv_bundles_figures:
list of full paths to html or gif files containing visualizations of individual bundles
- tract_profile_plots:
list of full paths to png files, where files contain plots of the tract profiles
- viz_backend:
An instance of the AFQ.viz.utils.viz_backend class.
- citations:
Export Bibtex citation file for methods used by pyAFQ.