AFQ.api

Module Contents

Classes

BundleDict

AFQ

class AFQ.api.BundleDict(bundle_info=BUNDLES, seg_algo='afq', resample_to=None)[source]

Bases: collections.abc.MutableMapping

gen_all(self)[source]
__setitem__(self, key, item)[source]
__getitem__(self, key)[source]
__len__(self)[source]
__delitem__(self, key)[source]
__iter__(self)[source]
copy(self)[source]
resample_all_roi(self)[source]
class AFQ.api.AFQ(bids_path, bids_filters={'suffix': 'dwi'}, preproc_pipeline='all', participant_labels=None, output_dir=None, custom_tractography_bids_filters=None, b0_threshold=50, robust_tensor_fitting=False, min_bval=None, max_bval=None, reg_template='mni_T1', reg_subject='power_map', brain_mask=B0Mask(), mapping=SynMap(), profile_weights='gauss', bundle_info=None, parallel_params={'engine': 'serial'}, scalars=['dti_fa', 'dti_md'], virtual_frame_buffer=False, viz_backend='plotly_no_gif', tracking_params=None, segmentation_params=None, clean_params=None, **kwargs)[source]

Bases: object

_get_best_scalar(self)[source]
get_reg_template(self)[source]
__getattribute__(self, attr)[source]

Return getattr(self, name).

combine_profiles(self)[source]
get_streamlines_json(self)[source]
export_all(self, viz=True, afqbrowser=True, xforms=True, indiv=True)[source]

Exports all the possible outputs

Parameters
vizbool

Whether to output visualizations. This includes tract profile plots, a figure containing all bundles, and, if using the AFQ segmentation algorithm, individual bundle figures. Default: True

afqbrowserbool

Whether to output an AFQ-Browser from this AFQ instance. Default: True

xformsbool

Whether to output the reg_template image in subject space and, depending on if it is possible based on the mapping used, to output the b0 in template space. Default: True

indivbool

Whether to output individual bundles in their own files, in addition to the one file containing all bundles. If using the AFQ segmentation algorithm, individual ROIs are also output. Default: True

upload_to_s3(self, s3fs, remote_path)[source]

Upload entire AFQ derivatives folder to S3

assemble_AFQ_browser(self, output_path=None, metadata=None, page_title='AFQ Browser', page_subtitle='', page_title_link='', page_subtitle_link='')[source]

Assembles an instance of the AFQ-Browser from this AFQ instance. First, we generate the combined tract profile if it is not already generated. This includes running the full AFQ pipeline if it has not already run. The combined tract profile is one of the outputs of export_all. Second, we generate a streamlines.json file from the bundle recognized in the first subject’s first session. Third, we call AFQ-Browser’s assemble to assemble an AFQ-Browser instance in output_path.

Parameters
output_pathstr

Path to location to create this instance of the browser in. Called “target” in AFQ Browser API. If None, bids_path/derivatives/afq_browser is used. Default: None

metadatastr

Path to subject metadata csv file. If None, an metadata file containing only subject ID is created. This file requires a “subjectID” column to work. Default: None

page_titlestr

Page title. If None, prompt is sent to command line. Default: “AFQ Browser”

page_subtitlestr

Page subtitle. If None, prompt is sent to command line. Default: “”

page_title_linkstr

Title hyperlink (including http(s)://). If None, prompt is sent to command line. Default: “”

page_subtitle_linkstr

Subtitle hyperlink (including http(s)://). If None, prompt is sent to command line. Default: “”