Skip to content

Commit 8522e47

Browse files
authored
Merge pull request #86 from CAVEconnectome/polyline
Adding polyline annotations
2 parents 6be4ee8 + 80ff963 commit 8522e47

File tree

15 files changed

+883
-196
lines changed

15 files changed

+883
-196
lines changed

docs/usage/parser.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,5 @@ state_parser.annotation_dataframe()
4949

5050
will give you a dataframe where each row is an annotation, and columns show layer name, points locations, annotation type, annotation id, linked segmentations, tags, etc. If you are using tags, the `expand_tags=True` argument will create a column for every tag and assign a boolean value to the row based on whether the tag is present in the annotation.
5151
Another option that is sometimes useful is `split_points=True`, which will create a separate column for each x, y, or z coordinate in the annotation.
52+
Note that polyline annotations will come back with all points in the "point" field.
5253

docs/usage/statebuilder.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ Once you have a shader you want to use, you can set it with the `add_shader` met
374374

375375
### Annotation Layers
376376

377-
Annotation layers let a user define various types of annotations like points, lines, bounding boxes, and ellipses.
377+
Annotation layers let a user define various types of annotations like points, lines, bounding boxes, ellipses, and polylines (a series of points, each connected to the next by lines).
378378
Annotations can also be associated with segmentations, allowing you to filter annotations by the data that's being selected.
379379

380380
Annotation layers come in two types, **local** annotation layers that store their annotations directly in the Neuroglancer state and **cloud** annotation layers that get their annotations from a cloud-hosted source.
@@ -391,7 +391,7 @@ annotation_layer = AnnotationLayer(name='my_annotations')
391391
viewer_state.add_layer(annotation_layer)
392392
```
393393

394-
The simplest way to add annotations is through the `add_points`, `add_lines`, `add_boxes`, and `add_ellipses` methods.
394+
The simplest way to add annotations is through the `add_points`, `add_lines`, `add_boxes`, `add_ellipses`, and `add_polylines` methods.
395395
These methods work similarly, taking a dataframe where each row represents an annotation and the columns are specified by parameters.
396396

397397
For example, to add points to the annotation layer, you can do:
@@ -559,7 +559,7 @@ viewer_state.map(
559559
This will replace the DataMap keys with the actual data and produce a Neuroglancer link with the specified sources.
560560
Applying this across a list of data sources can easily generate a large collection of neuroglancer states.
561561

562-
The other principle use of DataMaps is to support annotation creation by replacing the `data` argument in the `add_points`, `add_lines`, `add_boxes`, and `add_ellipses` methods.
562+
The other principle use of DataMaps is to support annotation creation by replacing the `data` argument in the `add_points`, `add_lines`, `add_boxes`, `add_ellipses`, and `add_polylines` methods.
563563
For example, you can create a DataMap for the annotation data and then use it to add points to the annotation layer with the following pattern:
564564

565565
``` pycon

pyproject.toml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "nglui"
7-
version = "4.6.0"
7+
version = "4.6.1"
88
description = "Framework for data-driven generation of neuroglancer states."
99
readme = "README.md"
1010
requires-python = ">=3.10"
1111
dependencies = [
12-
"attrs>=24.6.0",
12+
"attrs>=24.6.1",
1313
"caveclient>=7.0.0",
1414
"ipython>=8.18.1",
1515
"numpy>=1.26.4",
@@ -18,11 +18,11 @@ dependencies = [
1818
"requests>=2.32.3",
1919
"six>=1.16.0",
2020
"webcolors>=24.11.1",
21-
"neuroglancer==2.40.1",
2221
"cachetools>=5.5.2",
23-
"palettable>=3.3.3,<4.6.0",
22+
"palettable>=3.3.3,<4.6.1",
2423
"typing-extensions>=4.13.2,<5.0.0 ; python_full_version < '3.11'",
2524
"pyperclip>=1.9.0",
25+
"neuroglancer>=2.41.2",
2626
]
2727
authors = [
2828
{ name = "Casey Schneider-Mizell", email = "caseysm@gmail.com" },
@@ -47,6 +47,7 @@ Issues = "https://github.com/CAVEconnectome/nglui/issues"
4747
[project.optional-dependencies]
4848
full = [
4949
"cloud-volume>=12.3.1",
50+
"pysimdjson>=7.0.0 ; python_version >= '3.13'",
5051
]
5152

5253
[dependency-groups]
@@ -57,6 +58,7 @@ dev = [
5758
"responses",
5859
"ipykernel",
5960
"bump-my-version",
61+
"cloud-volume",
6062
]
6163
docs = [
6264
"mkdocs",
@@ -70,7 +72,7 @@ lint = [
7072
default-groups = ["dev", "docs", "lint"]
7173

7274
[tool.bumpversion]
73-
current_version = "4.6.0"
75+
current_version = "4.6.1"
7476
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
7577
serialize = ["{major}.{minor}.{patch}"]
7678
search = "{current_version}"

src/nglui/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# from . import parser, segmentprops, site_utils, statebuilder
22

3-
__version__ = "4.6.0"
3+
__version__ = "4.6.1"

0 commit comments

Comments
 (0)