Skip to content

Commit

Permalink
docs: update tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
schlegelp committed Sep 7, 2024
1 parent b89c629 commit a3fea78
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 12 deletions.
Binary file added docs/_static/dotprops.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/mesh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/skeleton.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docs/examples/4_remote/plot_01_remote_cloudvolume.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,8 @@

sk = vol.skeleton.get([4335355146, 2913913713, 2137190164, 2268989790], as_navis=True)
sk

# %%
# !!! experiment "Try it out!"
# If you are working a lot with NeuroGlancer and need to e.g. generated or parse URLs, you might want to check out the
# [`nglscenes`](https://github.com/schlegelp/nglscenes) package.
33 changes: 21 additions & 12 deletions docs/examples/plot_01_neurons_intro.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
This tutorial will show you the different neuron types and how to work with them.
Depending your data/workflows you will use different ways to represent neurons.
If, for example, you work with light-level data you might end up with point clouds
or skeletons whereas modern connectomes typically provide meshes.
Depending your data/workflows, you will use different representations of neurons.
If, for example, you work with light-level data you might end up extracting point
clouds or neuron skeletons from image stacks. If, on the other hand, you work with
segmented EM data, you will typically work with meshes.
To cater for these different data types neurons in {{ navis }} come in four flavours:
To cater for these different representations, neurons in {{ navis }} come in four flavours:
| Neuron type | Description | Core data |
|-------------------------|-----------------------------------------------------------------------|-------------------------------------|
Expand All @@ -17,13 +18,13 @@
| [`navis.VoxelNeuron`][] | An image represented by either a<br> 2d array of voxels or a 3d voxel grid. | - `.voxels`: `(N, 3)` array of voxels<br>- `.values`: `(N, )` array of values (i.e. intensity)<br>- `.grid`: `(N, M, K)` 3D voxelgrid |
| [`navis.Dotprops`][] | A cloud of points, each with an<br> associated local vector. | - `.points`: `(N, 3)` array of point coordinates<br>- `.vect`: `(N, 3)` array of normalized vectors |
Note that some functions in {{ navis }} will work on some but not all neuron types:
checkout this [table](../../api.md#neuron-types-and-functions) in the [API](../../api.md)
reference for details. If need be, {{ navis }} also offers ways to convert between the
Note that functions in {{ navis }} may only work on a subset of neuron types:
check out this [table](../../api.md#neuron-types-and-functions) in the [API](../../api.md)
reference for details. If necessary, {{ navis }} can help you convert between the
different neuron types (see further [below](#converting-neuron-types))!
!!! important
In this guide we introduce the different neuron types using canned data bundled with {{ navis }}.
In this guide we introduce the different neuron types using data bundled with {{ navis }}.
To learn how to load your own neurons into {{ navis }} please see the tutorials on
[Import/Export](../../gallery#import-export).
Expand All @@ -34,8 +35,10 @@
This format is commonly used to describe a neuron's topology and often shared using
[SWC](http://www.neuronland.org/NLMorphologyConverter/MorphologyFormats/SWC/Spec.html) files.
A [`navis.TreeNeuron`][] is typically constructed from an SWC file (see [`navis.read_swc`][])
but you can also use a `pandas.DataFrame` or a `networkx.DiGraph`.
![skeleton](../../../_static/skeleton.png)
A [`navis.TreeNeuron`][] is typically loaded from an SWC file via [`navis.read_swc`][]
but you can also constructed one yourself from e.g. `pandas.DataFrame` or a `networkx.DiGraph`.
See the [skeleton I/O](../local_data_skels_tut.md) tutorial for details.
{{ navis }} ships with a couple example *Drosophila* neurons from the Janelia hemibrain project published
Expand Down Expand Up @@ -63,6 +66,8 @@
#
# [`MeshNeurons`][navis.MeshNeuron] consist of vertices and faces, and are a typical output of e.g. image segmentation.
#
# ![mesh](../../../_static/mesh.png)
#
# A [`navis.MeshNeuron`][] can be constructed from any object that has `.vertices` and `.faces` properties, a
# dictionary of `vertices` and `faces` or a file that can be parsed by `trimesh.load`.
# See the [mesh I/O](../local_data_meshes_tut.md) tutorial for details.
Expand All @@ -84,8 +89,12 @@
#
# [`Dotprops`][navis.Dotprops] represent neurons as point clouds where each point is associated with a vector
# describing the local orientation. This simple representation often comes from e.g. light-level data
# or as direvative of skeletons/meshes (see [`navis.make_dotprops`][]). Dotprops are used e.g. for
# [NBLAST](../nblast_intro.md). See the [dotprops I/O](../local_data_dotprops_tut) tutorial for details.
# or as direvative of skeletons/meshes (see [`navis.make_dotprops`][]).
#
# ![dotprops](../../../_static/dotprops.png)
#
# Dotprops are used e.g. for [NBLAST](../nblast_intro.md). See the [dotprops I/O](../local_data_dotprops_tut)
# tutorial for details.
#
# [`navis.Dotprops`][] consist of `.points` and associated `.vect` (vectors). They are typically
# created from other types of neurons using [`navis.make_dotprops`][]:
Expand Down

0 comments on commit a3fea78

Please sign in to comment.