get_seg_skeletons - jaybgager/tracertools GitHub Wiki

This function gets a list of osteoid-format skeleton objects for a list of segment IDs.

Arguments:

  • datastack (string, mandatory)
    • the name of the CAVE datastack the segment IDs belong to
  • seg_ids (list of integers, mandatory)
    • a list of the segment IDs you want skeletons for

Returns:

  • intersect_list (list of osteoid Skeleton objects)
    • a list of osteoid skeleton objects in the same order as the submitted segment IDs

Example

INPUT:

import tracertools as tt

skeletons = tt.get_seg_skeletons(
    datastack = "brain_and_nerve_cord",
    seg_ids = [
        720575941473274509,
        720575941524660200,
        720575941565377335,
    ],
)

print(skeletons)

OUTPUT:

[
    Skeleton(
        segid=None, 
        vertices=(shape=274, float32), 
        edges=(shape=273, uint32), 
        radius=(274, float64), 
        vertex_types=(274, uint8), 
        space='physical', 
        transform=[
            [4.0, 0.0, 0.0, 0.0], 
            [0.0, 4.0, 0.0, 0.0], 
            [0.0, 0.0, 45.0, 0.0]
        ]
    ),
    Skeleton(
        segid=None, 
        vertices=(shape=99, float32), 
        edges=(shape=98, uint32), 
        radius=(99, float64), 
        vertex_types=(99, uint8), 
        space='physical', 
        transform=[
            [4.0, 0.0, 0.0, 0.0], 
            [0.0, 4.0, 0.0, 0.0], 
            [0.0, 0.0, 45.0, 0.0]
        ]
    ),
    Skeleton(
        segid=None, 
        vertices=(shape=505, float32), 
        edges=(shape=504, uint32), 
        radius=(505, float64), 
        vertex_types=(505, uint8), 
        space='physical', 
        transform=[
            [4.0, 0.0, 0.0, 0.0], 
            [0.0, 4.0, 0.0, 0.0], 
            [0.0, 0.0, 45.0, 0.0]
        ]
    )
]

[!NOTE] The list output above has been formatted for ease of reading using a combination of the pretty-print Python module and manual adjustment. The actual default output would all be on a single line. Pretty-print can be installed with pip install pprint. It's sed by adding from pprint import pprint to your imports and replacing the print() command with pprint().