:py:mod:`AFQ.api.group` ======================= .. py:module:: AFQ.api.group Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: AFQ.api.group.GroupAFQ Functions ~~~~~~~~~ .. autoapisummary:: AFQ.api.group.get_afq_bids_entities_fname .. py:function:: get_afq_bids_entities_fname() .. py:class:: GroupAFQ(bids_path, bids_filters={'suffix': 'dwi'}, preproc_pipeline='all', participant_labels=None, output_dir=None, parallel_params={'engine': 'serial'}, bids_layout_kwargs={}, **kwargs) Bases: :py:obj:`object` .. py:attribute:: clobber .. py:method:: combine_profiles() .. py:method:: get_streamlines_json() .. py:method:: export(attr_name='help', collapse=True) .. py:method:: export_up_to(attr_name='help') .. py:method:: export_all(viz=True, afqbrowser=True, xforms=True, indiv=True) Exports all the possible outputs :Parameters: **viz** : bool 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 **afqbrowser** : bool Whether to output an AFQ-Browser from this AFQ instance. Default: True **xforms** : bool 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 **indiv** : bool 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 .. !! processed by numpydoc !! .. py:method:: cmd_outputs(cmd='rm', dependent_on=None, exceptions=[], suffix='') Perform some command some or all outputs of pyafq. This is useful if you change a parameter and need to recalculate derivatives that depend on it. Some examples: cp, mv, rm . -r will be automtically added when necessary. :Parameters: **cmd** : str Command to run on outputs. Default: 'rm' **dependent_on** : str or None Which derivatives to perform command on . If None, perform on all. If "track", perform on all derivatives that depend on the tractography. If "recog", perform on all derivatives that depend on the bundle recognition. Default: None **exceptions** : list of str Name outputs that the command should not be applied to. Default: [] **suffix** : str Parts of command that are used after the filename. Default: "" .. !! processed by numpydoc !! .. py:method:: make_all_participant_montages(images_per_row=2) Generate montage of all bundles for a all subjects. :Parameters: **images_per_row** : int Number of bundle images per row in output file. Default: 2 :Returns: filename of montage images .. .. !! processed by numpydoc !! .. py:method:: group_montage(bundle_name, size, view, direc, slice_pos=None) Generate montage file(s) of a given bundle at a given angle. :Parameters: **bundle_name** : str Name of bundle to visualize, should be the same as in the bundle dictionary. **size** : tuple of int The number of columns and rows for each file. **view** : str Which view to display. Can be one of sagittal, coronal, or axial. **direc** : str Which direction to views. Can be one of left, right, top, bottom, front, back **slice_pos** : float, or None If float, indicates the fractional position along the perpendicular axis to the slice. Currently only works with plotly. If None, no slice is displayed. :Returns: list of filenames of montage images .. .. !! processed by numpydoc !! .. py:method:: combine_bundle(bundle_name) Transforms a given bundle to reg_template space for all subjects then merges them to one trk file. Useful for visualizing the variability in the bundle across subjects. Note: currently only implemented using built-in SynMap :Parameters: **bundle_name** : str .. **Name of the bundle to transform, should be one of the bundles in** .. **bundle_dict.** .. .. !! processed by numpydoc !! .. py:method:: upload_to_s3(s3fs, remote_path) Upload entire AFQ derivatives folder to S3 .. !! processed by numpydoc !! .. py:method:: export_group_density(boolify=True) Generate a group density map by combining single subject density maps. :Parameters: **boolify** : bool Whether to turn subject streamline count images into booleans before adding them into the group density map. .. !! processed by numpydoc !! .. py:method:: assemble_AFQ_browser(output_path=None, metadata=None, page_title='AFQ Browser', page_subtitle='', page_title_link='', page_subtitle_link='') 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_path** : str 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 **metadata** : str 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_title** : str Page title. If None, prompt is sent to command line. Default: "AFQ Browser" **page_subtitle** : str Page subtitle. If None, prompt is sent to command line. Default: "" **page_title_link** : str Title hyperlink (including http(s)://). If None, prompt is sent to command line. Default: "" **page_subtitle_link** : str Subtitle hyperlink (including http(s)://). If None, prompt is sent to command line. Default: "" .. !! processed by numpydoc !!