How to use the neuroglancer.PointAnnotationLayer function in neuroglancer

To help you get started, we’ve selected a few neuroglancer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github google / neuroglancer / python / examples / extend_segments_tool.py View on Github external
def make_initial_state(self, segment_id, base_state):
        state = copy.deepcopy(base_state)

        segments = self.get_state_segment_ids(state)
        segments.clear()
        segments.add(segment_id)
        state.layers[self.point_annotation_layer_name] = neuroglancer.PointAnnotationLayer()

        return state
github google / neuroglancer / python / neuroglancer / tool / agglomeration_split_tool.py View on Github external
source=segmentation_url,
            segments=set(x for x, seeds in six.viewitems(supervoxel_map) if len(seeds) > 1),
        ),
        visible=False,
    )
    state.layers.append(
        name='split',
        layer=neuroglancer.SegmentationLayer(
            source=segmentation_url,
            equivalences=cur_eqs,
            segments=set(cur_eqs[x] for x in agglo_members),
        ))
    for label, component in six.viewitems(split_seeds):
        state.layers.append(
            name='seed%d' % label,
            layer=neuroglancer.PointAnnotationLayer(
                points=[seed['position'] for seed in component],
            ),
        )

    state.show_slices = False
    state.layout = '3d'
    all_seed_points = [
        seed['position'] for component in six.viewvalues(split_seeds) for seed in component
    ]
    state.voxel_coordinates = np.mean(all_seed_points, axis=0)
    return state