.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "howto/howto_examples/plot_recobundles.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_howto_howto_examples_plot_recobundles.py: ========================================= Using RecoBundles for bundle recognition ========================================= For bundle recognition, pyAFQ defaults to use the waypoint ROI approach described in [Yeatman2012]_. However, as an alternative approach, pyAFQ also supports using the RecoBundles algorithm [Garyfallidis2017]_, which uses an atlas of bundles in streamlines. This example shows how to use RecoBundles for bundle recognition. The code closely resembles the code used in :ref:`sphx_glr_tutorial_examples_plot_001-plot_afq_api.py`. .. GENERATED FROM PYTHON SOURCE LINES 15-27 .. code-block:: Python import os.path as op import AFQ.data.fetch as afd from AFQ.api.group import GroupAFQ afd.organize_stanford_data(clear_previous_afq="track") tracking_params = dict(n_seeds=25000, random_seeds=True, rng_seed=42) .. GENERATED FROM PYTHON SOURCE LINES 28-35 Defining the segmentation params -------------------------------- We also refer to bundle recognition as the "segmentation" of the tractogram. Parameters of this process are set through a dictionary input to the `segmentation_params` argument of the GroupAFQ object. In this case, we set the `seg_algo` to "reco", which tells pyAFQ to use the RecoBundles algorithm for bundle recognition. .. GENERATED FROM PYTHON SOURCE LINES 35-48 .. code-block:: Python myafq = GroupAFQ( output_dir=op.join(afd.afq_home, 'stanford_hardi', 'derivatives', 'recobundles'), bids_path=op.join(afd.afq_home, 'stanford_hardi'), # Set the algorithm to use RecoBundles for bundle recognition: segmentation_params={'seg_algo': 'reco'}, preproc_pipeline='vistasoft', tracking_params=tracking_params, viz_backend_spec='plotly_no_gif') fig_files = myafq.export_all() .. rst-class:: sphx-glr-script-out .. code-block:: none 0%| | 0/179864.0 [00:00` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_recobundles.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_