.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "howto/howto_examples/run_pyAFQ_with_GPU.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_run_pyAFQ_with_GPU.py: ============================================ Running pyAFQ using the GPU for tractography ============================================ Running pyAFQ using the GPU for tractography is as simple as (1) Installing GPUStreamlines using `pip install` and (2) passing in the ``tractography_ngpus`` parameter when you create your GroupAFQ object. To install GPUStreamlines, do: `pip install git+https://github.com/dipy/GPUStreamlines.git` That's step 1 complete! The rest of this example is the same as the GroupAFQ example except with the ``tractography_ngpus`` parameter set. .. GENERATED FROM PYTHON SOURCE LINES 14-20 .. code-block:: Python from AFQ.api.group import GroupAFQ import AFQ.data.fetch as afd import os.path as op import plotly .. GENERATED FROM PYTHON SOURCE LINES 21-26 We start with some example data. The data we will use here is generated from the `Stanford HARDI dataset `_. We then setup our myafq object which we will use to demonstrate the clobber method. .. GENERATED FROM PYTHON SOURCE LINES 26-34 .. code-block:: Python afd.organize_stanford_data() tracking_params = dict(n_seeds=1000000, random_seeds=True, rng_seed=2025, trx=True) .. GENERATED FROM PYTHON SOURCE LINES 35-40 Running with the GPU -------------------- We will use the GPU for tractography. This is done by passing in `tractography_ngpus` That's it! .. GENERATED FROM PYTHON SOURCE LINES 40-49 .. code-block:: Python myafq = GroupAFQ( bids_path=op.join(afd.afq_home, 'stanford_hardi'), preproc_pipeline='vistasoft', tracking_params=tracking_params, tractography_ngpus=1) # From here, pyAFQ should run normally bundle_html = myafq.export("all_bundles_figure") plotly.io.show(bundle_html["01"][0]) **Estimated memory usage:** 0 MB .. _sphx_glr_download_howto_howto_examples_run_pyAFQ_with_GPU.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: run_pyAFQ_with_GPU.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: run_pyAFQ_with_GPU.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: run_pyAFQ_with_GPU.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_