Skip to content

Commit

Permalink
Merge branch 'master' of github.com:yeatmanlab/pyAFQ
Browse files Browse the repository at this point in the history
  • Loading branch information
arokem committed Aug 15, 2024
2 parents 5277cb0 + 34c6817 commit d17f9ec
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/source/howto/usage/kwargs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ brain_mask_definition: instance from `AFQ.definitions.image`, optional
bundle_info: strings, dict, or BundleDict, optional
List of bundle names to include in segmentation,
or a bundle dictionary (see BundleDict for inspiration),
or a BundleDict. See `Defining Custom Bundle Dictionaries`
or a BundleDict. See `Defining Custom Bundle Dictionaries <https://yeatmanlab.github.io/pyAFQ/reference/bundledict.html>`_
in the `usage` section of pyAFQ's documentation for details.
If None, will get all appropriate bundles for the chosen
segmentation algorithm.
Expand Down Expand Up @@ -233,6 +233,6 @@ viz_backend_spec: str, optional
Default: "plotly_no_gif"

virtual_frame_buffer: bool, optional
Whether to use a virtual fram buffer. This is neccessary if
Whether to use a virtual fram buffer. This is necessary if
generating GIFs in a headless environment. Default: False

34 changes: 31 additions & 3 deletions docs/source/reference/bundledict.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ key-value pairs::
- 'length': dicitonary containing 'min_len' and 'max_len'


For an example, see "Plotting the Optic Radiations" in :ref:`examples`.


When doing bundle recognition, streamlines are filtered out from the whole
tractography according to the series of steps defined in the bundle
dictionaries. Of course, no one bundle uses every step, but here is the order
Expand All @@ -68,3 +65,34 @@ If, for debugging purposes, you want to save out the streamlines
remaining after each step, set `save_intermediates` to a path in
`segmentation_params`. Then the streamlines will be saved out after each step
to that path. Only do this for one subject at a time.


Custom bundle definitions such as the OR, and the standard BundleDict can be
combined through addition. For an example, see "Plotting the Optic Radiations" in :ref:`examples`.
Some tracts, such as the Vertical Occipital Fasciculus, may be defined relative
to other tracts. In those cases, the custom tract definitions should appear in the BundleDict
object after the reference tracts have been defined. These reference tracts can
be included as keys in the same dictionary for that tract. For example::

newVOF = abd.BundleDict({
'Left Vertical Occipital': {'cross_midline': False,
'space': 'template',
'start': templates['VOF_L_start'],
'end': templates['VOF_L_end'],
'inc_addtol': [4, 0],
'Left Arcuate': {
'node_thresh': 20},
'Left Posterior Arcuate': {
'node_thresh': 1,
'core': 'Posterior'},
'Left Inferior Longitudinal': {
'core': 'Left'},
'primary_axis': 2,
'primary_axis_percentage': 40}
})

This definition of the VOF in the custom BundleDict would first require left ARC, left pARC, and left ILF
to be defined, in the same way the tiebreaker above works. You would then construct your custom
BundleDict like this. The order of addition matters here::

BundleDictCustomVOF = abd.default18_bd() + newVOF

0 comments on commit d17f9ec

Please sign in to comment.