From ed2f4091d6396e14101044ddfc39642567d5af2e Mon Sep 17 00:00:00 2001 From: Howard Chiu <137316255+chiuhoward@users.noreply.github.com> Date: Fri, 9 Aug 2024 14:25:04 -0700 Subject: [PATCH 1/3] Update kwargs.rst Created link to Defining Custom Bundle Dictionaries page in documentation --- docs/source/howto/usage/kwargs.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/source/howto/usage/kwargs.rst b/docs/source/howto/usage/kwargs.rst index 8a799f4d..bee5141a 100644 --- a/docs/source/howto/usage/kwargs.rst +++ b/docs/source/howto/usage/kwargs.rst @@ -108,7 +108,8 @@ 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. @@ -233,6 +234,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 From d2fe9f47bbedde8f0f94ad1f81d74f526d12683b Mon Sep 17 00:00:00 2001 From: Howard Chiu <137316255+chiuhoward@users.noreply.github.com> Date: Fri, 9 Aug 2024 14:43:42 -0700 Subject: [PATCH 2/3] Update bundledict.rst Added VOF and customBD example --- docs/source/reference/bundledict.rst | 34 +++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/docs/source/reference/bundledict.rst b/docs/source/reference/bundledict.rst index 44c0cd45..a8d7460f 100644 --- a/docs/source/reference/bundledict.rst +++ b/docs/source/reference/bundledict.rst @@ -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 @@ -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 From 853adb91ee058c068e7e3c11039cfc85e8033da9 Mon Sep 17 00:00:00 2001 From: Howard Chiu <137316255+chiuhoward@users.noreply.github.com> Date: Fri, 9 Aug 2024 15:04:34 -0700 Subject: [PATCH 3/3] Update docs/source/howto/usage/kwargs.rst Co-authored-by: Ariel Rokem --- docs/source/howto/usage/kwargs.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/source/howto/usage/kwargs.rst b/docs/source/howto/usage/kwargs.rst index bee5141a..aaf679cb 100644 --- a/docs/source/howto/usage/kwargs.rst +++ b/docs/source/howto/usage/kwargs.rst @@ -108,8 +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` - (https://yeatmanlab.github.io/pyAFQ/reference/bundledict.html) + or a BundleDict. See `Defining Custom Bundle Dictionaries `_ in the `usage` section of pyAFQ's documentation for details. If None, will get all appropriate bundles for the chosen segmentation algorithm.