From 82a7addb50961a594a08caa5e83e9e89515c4f87 Mon Sep 17 00:00:00 2001 From: Philipp Schlegel Date: Sun, 5 Jun 2022 15:34:31 +0100 Subject: [PATCH] docs: update NBLAST tutorial --- docs/source/tutorials/nblast.ipynb | 167 +---------------------------- 1 file changed, 5 insertions(+), 162 deletions(-) diff --git a/docs/source/tutorials/nblast.ipynb b/docs/source/tutorials/nblast.ipynb index cc336e29..c4b62325 100644 --- a/docs/source/tutorials/nblast.ipynb +++ b/docs/source/tutorials/nblast.ipynb @@ -26,13 +26,13 @@ ".. image:: ../../_static/NBLAST_neuron_comparison.png\n", " :width: 500\n", " :align: center\n", - " \n", + " \n", "2. Produce a raw score \n", "======================\n", "\n", "The raw score is a `weighted` product from the distance :math:`d_{i}` between the points in each pair and the absolute dot product of the two tangent vectors :math:`| \\vec{u_i} \\cdot \\vec{v_i} |`.\n", "\n", - "The absolute dot product is used because the orientation of the tangent vectors has no meaning in our data representation).\n", + "The absolute dot product is used because the orientation of the tangent vectors has no meaning in our data representation.\n", "\n", "A suitable scoring function :math:`f` was determined empirically (see the NBLAST `paper `_) and is shipped with ``navis`` as scoring matrices:\n", "\n", @@ -66,6 +66,8 @@ ".. math::\n", "\n", " S(query,target)=\\sum_{i=1}^{n}f(d_{i}, |\\vec{u_i} \\cdot \\vec{v_i}|) \n", + " \n", + "One important thing to keep in mind is this: the direction of the comparison matters! Consider two very different neurons - one large, one small - that overlap in space. If the small neuron is the query, you will always find a close-by nearest-neighbour among the many points of the large target neuron. Consequently, this small -> large comparison will produce decent NBLAST score. Conversely, the other way around (large -> small) will likely produce a bad NBLAST score because many points in the large neuron are far away from the closests point in the small neuron. In practice, we typically use the mean between those two scores. This is done either by running two nblasts (query -> target and target -> query), or by using the ``scores`` parameter of the respective NBLAST function. \n", "\n", "\n", "Running NBLAST\n", @@ -1112,166 +1114,7 @@ }, "widgets": { "application/vnd.jupyter.widget-state+json": { - "state": { - "0b7795116efa43c08495c21e53515a51": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "HTMLModel", - "state": { - "layout": "IPY_MODEL_b5c7d7fa41d2413284405a27764befd0", - "style": "IPY_MODEL_ce65b7f058fd42ce8d3c3165d45c5051", - "value": "Dotprops: 100%" - } - }, - "164bb451fda146348ac4163ea6374f84": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "HTMLModel", - "state": { - "layout": "IPY_MODEL_17e330acd6654e37b46d0e933415b525", - "style": "IPY_MODEL_53b2b42866e441e3a9caf8444283b819", - "value": " 5/5 [00:00<00:00, 25.53it/s]" - } - }, - "17e330acd6654e37b46d0e933415b525": { - "model_module": "@jupyter-widgets/base", - "model_module_version": "1.2.0", - "model_name": "LayoutModel", - "state": {} - }, - "29aed05198a44a2080beb9db3056e387": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "ProgressStyleModel", - "state": { - "description_width": "" - } - }, - "4272838328c347b6815a6694f5e98bbc": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "DescriptionStyleModel", - "state": { - "description_width": "" - } - }, - "515835f0ff5d4d93a843ad02676ecc3c": { - "model_module": "@jupyter-widgets/base", - "model_module_version": "1.2.0", - "model_name": "LayoutModel", - "state": {} - }, - "51719207cfea4ff08983868bce1e8b2c": { - "model_module": "@jupyter-widgets/base", - "model_module_version": "1.2.0", - "model_name": "LayoutModel", - "state": {} - }, - "53b2b42866e441e3a9caf8444283b819": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "DescriptionStyleModel", - "state": { - "description_width": "" - } - }, - "80236c41239946cf9c5692b02be0e279": { - "model_module": "@jupyter-widgets/base", - "model_module_version": "1.2.0", - "model_name": "LayoutModel", - "state": {} - }, - "84ec4245daf14f4cb3b98fb573d9952e": { - "model_module": "@jupyter-widgets/base", - "model_module_version": "1.2.0", - "model_name": "LayoutModel", - "state": {} - }, - "9d1751b4a1f84d609fb8d6c6212641a7": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "HTMLModel", - "state": { - "layout": "IPY_MODEL_84ec4245daf14f4cb3b98fb573d9952e", - "style": "IPY_MODEL_4272838328c347b6815a6694f5e98bbc", - "value": " 0/5 [00:00<?, ?it/s]" - } - }, - "ad54b908627043799dfc6d91d2fdfc02": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "HTMLModel", - "state": { - "layout": "IPY_MODEL_51719207cfea4ff08983868bce1e8b2c", - "style": "IPY_MODEL_efa3a7f239f149dcbdcfbc690201cb4e", - "value": "Dividing: 0%" - } - }, - "b5c7d7fa41d2413284405a27764befd0": { - "model_module": "@jupyter-widgets/base", - "model_module_version": "1.2.0", - "model_name": "LayoutModel", - "state": {} - }, - "c904201d3b454fbe9a443b8a7a85b58e": { - "model_module": "@jupyter-widgets/base", - "model_module_version": "1.2.0", - "model_name": "LayoutModel", - "state": {} - }, - "c9dc8bfa8437427f95b5f023fdd3b318": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "FloatProgressModel", - "state": { - "layout": "IPY_MODEL_c904201d3b454fbe9a443b8a7a85b58e", - "max": 5, - "style": "IPY_MODEL_feb484342b2e4764bc5f1c1343589e05", - "value": 5 - } - }, - "ce65b7f058fd42ce8d3c3165d45c5051": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "DescriptionStyleModel", - "state": { - "description_width": "" - } - }, - "efa3a7f239f149dcbdcfbc690201cb4e": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "DescriptionStyleModel", - "state": { - "description_width": "" - } - }, - "f81240c1a862447887096b1539727125": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "FloatProgressModel", - "state": { - "layout": "IPY_MODEL_f854abbc9cdd40d8b6b85918f5966c97", - "max": 5, - "style": "IPY_MODEL_29aed05198a44a2080beb9db3056e387", - "value": 5 - } - }, - "f854abbc9cdd40d8b6b85918f5966c97": { - "model_module": "@jupyter-widgets/base", - "model_module_version": "1.2.0", - "model_name": "LayoutModel", - "state": {} - }, - "feb484342b2e4764bc5f1c1343589e05": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "ProgressStyleModel", - "state": { - "description_width": "" - } - } - }, + "state": {}, "version_major": 2, "version_minor": 0 }