Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
s.layers['partners'] = neuroglancer.SegmentationLayer(
source='precomputed://gs://neuroglancer-public-data/flyem_fib-25/ground_truth',
)
s.layers['synapses'] = neuroglancer.LocalAnnotationLayer(
dimensions=dimensions,
linked_segmentation_layer='ground_truth')
s.layout = neuroglancer.row_layout([
neuroglancer.LayerGroupViewer(
layout='xy',
layers=['image', 'ground_truth', 'partners', 'synapses'],
),
neuroglancer.LayerGroupViewer(
layout='3d',
layers=['ground_truth', 'synapses'],
),
neuroglancer.LayerGroupViewer(
layout='3d',
layers=['partners', 'synapses'],
),
])
self.selected_segments = frozenset()
self.viewer.shared_state.add_changed_callback(
lambda: self.viewer.defer_callback(self.on_state_changed))
_set_viewer_seeds(s, self.cached_split_result.seeds)
s.layers['unused'].segments = self.state.unused_supervoxels
s.layers['original'].segments = self.cached_split_result.supervoxels
s.layers['split-result'].segments = self.cached_split_result.supervoxels
split_result = self.cached_split_result.split_result
if split_result is not None:
self._show_split_result(
s,
cur_eqs=split_result['cur_eqs'],
)
s.layout = neuroglancer.row_layout([
neuroglancer.LayerGroupViewer(
layout='3d',
layers=['image', 'original', 'unused', 'inclusive-seeds', 'exclusive-seeds']),
neuroglancer.LayerGroupViewer(
layout='3d', layers=['image', 'split-result', 'inclusive-seeds',
'exclusive-seeds']),
])
def _update_state(self, s):
self.cached_split_result.update()
self.state.save()
_set_viewer_seeds(s, self.cached_split_result.seeds)
s.layers['unused'].segments = self.state.unused_supervoxels
s.layers['original'].segments = self.cached_split_result.supervoxels
s.layers['split-result'].segments = self.cached_split_result.supervoxels
split_result = self.cached_split_result.split_result
if split_result is not None:
self._show_split_result(
s,
cur_eqs=split_result['cur_eqs'],
)
s.layout = neuroglancer.row_layout([
neuroglancer.LayerGroupViewer(
layout='3d',
layers=['image', 'original', 'unused', 'inclusive-seeds', 'exclusive-seeds']),
neuroglancer.LayerGroupViewer(
layout='3d', layers=['image', 'split-result', 'inclusive-seeds',
'exclusive-seeds']),
])
s.dimensions = dimensions
s.position = [3000, 3000, 3000]
s.layers['image'] = neuroglancer.ImageLayer(
source='precomputed://gs://neuroglancer-public-data/flyem_fib-25/image',
)
s.layers['ground_truth'] = neuroglancer.SegmentationLayer(
source='precomputed://gs://neuroglancer-public-data/flyem_fib-25/ground_truth',
)
s.layers['partners'] = neuroglancer.SegmentationLayer(
source='precomputed://gs://neuroglancer-public-data/flyem_fib-25/ground_truth',
)
s.layers['synapses'] = neuroglancer.LocalAnnotationLayer(
dimensions=dimensions,
linked_segmentation_layer='ground_truth')
s.layout = neuroglancer.row_layout([
neuroglancer.LayerGroupViewer(
layout='xy',
layers=['image', 'ground_truth', 'partners', 'synapses'],
),
neuroglancer.LayerGroupViewer(
layout='3d',
layers=['ground_truth', 'synapses'],
),
neuroglancer.LayerGroupViewer(
layout='3d',
layers=['partners', 'synapses'],
),
])
self.selected_segments = frozenset()
self.viewer.shared_state.add_changed_callback(
lambda: self.viewer.defer_callback(self.on_state_changed))