How can I add an precomputed annotation layer?
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 389
- Avg merge
- 3d 21h
- Merged PRs (30d)
- 3
Description
I was able to successfully establish precomputed image layers and segmentation layers and visualize them in the neuroglancer. Now I have an `annotation_points.txt` file records the coordinate positions (x, y, z) of key points (or rather special skeleton nodes) of segments with different IDs in the segmentation. How can I visualize key point information with different IDs based on existing layers. In other words, how should I add an annotation layer that I can select segments with different IDs in the neuroglancer and display the key points in the corresponding segment, rather than all the points being displayed.
```python
def create_image_layer(destination, shape, pos=(0,0,0), resolution=[16,16,40], image_layer=False):
data_type = "uint64"
layer_type = "segmentation"
info = CloudVolume.create_new_info(
num_channels = 1,
layer_type = layer_type,
data_type = data_type,
encoding = 'raw',
resolution = resolution,
voxel_offset = pos,
mesh = 'mesh',
chunk_size = [64, 64, 16],
volume_size = shape
)
vol = CloudVolume(destination, compress=False, info=info, parallel=False) # 默认为True
print(vol.info)
vol.commit_info()
return vol
source_path = r'./demo.h5' # segmentation results
img = readh5(source_path)
target_path = r'precomputed://file:///usr/home/demo'
vol = create_image_layer(target_path, img.shape, pos=(0,0,0), resolution=[4,4,40], image_layer=image_layer)
vol[:,:,:,0] = img[:,:,:]
```
I open a server for neuroglancer and input the precomputed address to visualize it in neuroglancer What should I do if I want to add a precomputed layer. Some of the contents in my key point information file `annotation_points.txt` are as follows, each row represents a key node coordinate.
```
835.000000,710.000000,2.000000
670.000000,570.000000,6.000000
838.000000,690.000000,5.000000
830.000000,650.000000,7.000000
830.000000,669.000000,8.000000
750.000000,582.000000,8.000000
830.000000,630.000000,13.000000
810.000000,600.000000,18.000000
790.000000,590.000000,21.000000
790.000000,590.000000,25.000000
...
```
Or can I convert my txt file into an SWC file and add a skeleton layer? I think my key point information is essentially the nodes of the skeleton, but there is no information such as radius or parent-child node relationships. If I could change my approach and add a skeleton layer, how should I proceed?
Contributor guide
Assessment
This issue has not been assessed yet.