Skip to content

h01

Fetch neuron meshes.

Notes

Synapses will be attached to the closest vertex on the mesh.

PARAMETER DESCRIPTION
x
        Segment ID(s). Multiple IDs can be provided as list-like.

TYPE: str | int | list-like

lod
        Level of detail. Higher ``lod`` = coarser. This parameter
        is ignored if the data source does not support multi-level
        meshes.

TYPE: int DEFAULT: 2

with_synapses
        If True will also attach synapses as ``.connectors``.

TYPE: bool DEFAULT: True

datastack
        Datastack to use. Default to "h01_c3_flat".

TYPE: str DEFAULT: DATASTACK

materialization
        Which materialization version to use to look up somas and synapses
        (if applicable). If "auto" (default) will try to find the most
        recent version that contains the given root IDs. If an
        integer is provided will use that version.

TYPE: auto | int DEFAULT: 'auto'

parallel
        If True, will use parallel threads to fetch data.

TYPE: bool DEFAULT: True

max_threads
        Max number of parallel threads to use.

TYPE: int DEFAULT: 4

**kwargs
        Keyword arguments are passed through to the initialization
        of the ``navis.MeshNeurons``.

DEFAULT: {}

RETURNS DESCRIPTION
navis.Neuronlist

Containing :class:navis.MeshNeuron.

Source code in navis/interfaces/h01.py
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
def fetch_neurons(
    x,
    *,
    lod=2,
    with_synapses=True,
    datastack=DATASTACK,
    materialization="auto",
    parallel=True,
    max_threads=4,
    **kwargs,
):
    """Fetch neuron meshes.

    Notes
    -----
    Synapses will be attached to the closest vertex on the mesh.

    Parameters
    ----------
    x :             str | int | list-like
                    Segment ID(s). Multiple IDs can be provided as list-like.
    lod :           int
                    Level of detail. Higher ``lod`` = coarser. This parameter
                    is ignored if the data source does not support multi-level
                    meshes.
    with_synapses : bool, optional
                    If True will also attach synapses as ``.connectors``.
    datastack :     str
                    Datastack to use. Default to "h01_c3_flat".
    materialization : "auto" | int
                    Which materialization version to use to look up somas and synapses
                    (if applicable). If "auto" (default) will try to find the most
                    recent version that contains the given root IDs. If an
                    integer is provided will use that version.
    parallel :      bool
                    If True, will use parallel threads to fetch data.
    max_threads :   int
                    Max number of parallel threads to use.
    **kwargs
                    Keyword arguments are passed through to the initialization
                    of the ``navis.MeshNeurons``.

    Returns
    -------
    navis.Neuronlist
                    Containing :class:`navis.MeshNeuron`.

    """
    client = get_cave_client(datastack)
    return cave_utils.fetch_neurons(
        x,
        lod=lod,
        with_synapses=with_synapses,
        client=client,
        parallel=parallel,
        max_threads=max_threads,
        materialization=materialization,
        **kwargs,
    )

Get caveclient for H01 dataset.

Source code in navis/interfaces/h01.py
21
22
23
24
25
def get_cave_client(datastack=DATASTACK):
    """Get caveclient for H01 dataset."""
    client = cave_utils.get_cave_client(datastack, SERVER_ADDRESS)
    client.materialize.nucleus_table = NUCLEUS_TABLE
    return client

Fetch voxels making a up given root ID.

PARAMETER DESCRIPTION
x
        A single root ID.

TYPE: int

mip
        Scale at which to fetch voxels.

TYPE: int DEFAULT: 0

bounds
        Bounding box [xmin, xmax, ymin, ymax, zmin, zmax] in voxel
        space. For example, the voxel resolution for mip 0
        segmentation is 8 x 8 x 40 nm.

TYPE: list DEFAULT: None

datastack
        DATASTACK.

TYPE: str DEFAULT: DATASTACK

RETURNS DESCRIPTION
voxels

In voxel space according to mip.

TYPE: (N, 3) np.ndarray

Source code in navis/interfaces/h01.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
def get_voxels(x, mip=0, bounds=None, datastack=DATASTACK):
    """Fetch voxels making a up given root ID.

    Parameters
    ----------
    x :             int
                    A single root ID.
    mip :           int
                    Scale at which to fetch voxels.
    bounds :        list, optional
                    Bounding box [xmin, xmax, ymin, ymax, zmin, zmax] in voxel
                    space. For example, the voxel resolution for mip 0
                    segmentation is 8 x 8 x 40 nm.
    datastack :     str
                    DATASTACK.

    Returns
    -------
    voxels :        (N, 3) np.ndarray
                    In voxel space according to `mip`.

    """
    return cave_utils.get_voxels(x, mip=mip, bounds=bounds, client=get_cave_client(datastack))