.. 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-28 .. code-block:: Python import os.path as op import AFQ.data.fetch as afd from AFQ.api.group import GroupAFQ import AFQ.api.bundle_dict as abd 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 29-36 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 use `abd.reco_bd(16)`, which tells pyAFQ to use the RecoBundles algorithm for bundle recognition. .. GENERATED FROM PYTHON SOURCE LINES 36-49 .. 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: bundle_info=abd.reco_bd(16), 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/12916 [00:00` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_recobundles.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_recobundles.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_