swcgeom 0.17.1__py3-none-any.whl → 0.18.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of swcgeom might be problematic. Click here for more details.

Files changed (69) hide show
  1. swcgeom/__init__.py +14 -0
  2. swcgeom/_version.py +2 -2
  3. swcgeom/analysis/__init__.py +15 -0
  4. swcgeom/analysis/feature_extractor.py +27 -3
  5. swcgeom/analysis/features.py +31 -4
  6. swcgeom/analysis/lmeasure.py +43 -7
  7. swcgeom/analysis/sholl.py +21 -24
  8. swcgeom/analysis/trunk.py +15 -0
  9. swcgeom/analysis/visualization.py +15 -0
  10. swcgeom/analysis/visualization3d.py +15 -0
  11. swcgeom/analysis/volume.py +15 -0
  12. swcgeom/core/__init__.py +15 -0
  13. swcgeom/core/branch.py +15 -0
  14. swcgeom/core/branch_tree.py +15 -0
  15. swcgeom/core/compartment.py +15 -0
  16. swcgeom/core/node.py +30 -1
  17. swcgeom/core/path.py +18 -7
  18. swcgeom/core/population.py +43 -3
  19. swcgeom/core/swc.py +15 -0
  20. swcgeom/core/swc_utils/__init__.py +15 -1
  21. swcgeom/core/swc_utils/assembler.py +15 -0
  22. swcgeom/core/swc_utils/base.py +15 -0
  23. swcgeom/core/swc_utils/checker.py +19 -12
  24. swcgeom/core/swc_utils/io.py +17 -1
  25. swcgeom/core/swc_utils/normalizer.py +16 -1
  26. swcgeom/core/swc_utils/subtree.py +15 -0
  27. swcgeom/core/tree.py +37 -9
  28. swcgeom/core/tree_utils.py +17 -7
  29. swcgeom/core/tree_utils_impl.py +15 -0
  30. swcgeom/images/__init__.py +15 -0
  31. swcgeom/images/augmentation.py +15 -0
  32. swcgeom/images/contrast.py +15 -0
  33. swcgeom/images/folder.py +17 -10
  34. swcgeom/images/io.py +18 -6
  35. swcgeom/transforms/__init__.py +16 -0
  36. swcgeom/transforms/base.py +17 -2
  37. swcgeom/transforms/branch.py +74 -8
  38. swcgeom/transforms/branch_tree.py +82 -0
  39. swcgeom/transforms/geometry.py +22 -7
  40. swcgeom/transforms/image_preprocess.py +15 -0
  41. swcgeom/transforms/image_stack.py +30 -4
  42. swcgeom/transforms/images.py +17 -10
  43. swcgeom/transforms/mst.py +15 -0
  44. swcgeom/transforms/neurolucida_asc.py +16 -1
  45. swcgeom/transforms/path.py +15 -0
  46. swcgeom/transforms/population.py +15 -0
  47. swcgeom/transforms/tree.py +76 -23
  48. swcgeom/transforms/tree_assembler.py +19 -4
  49. swcgeom/utils/__init__.py +15 -0
  50. swcgeom/utils/debug.py +15 -0
  51. swcgeom/utils/download.py +59 -21
  52. swcgeom/utils/dsu.py +15 -0
  53. swcgeom/utils/ellipse.py +15 -0
  54. swcgeom/utils/file.py +15 -0
  55. swcgeom/utils/neuromorpho.py +18 -7
  56. swcgeom/utils/numpy_helper.py +15 -0
  57. swcgeom/utils/plotter_2d.py +15 -0
  58. swcgeom/utils/plotter_3d.py +18 -1
  59. swcgeom/utils/renderer.py +15 -0
  60. swcgeom/utils/sdf.py +17 -5
  61. swcgeom/utils/solid_geometry.py +15 -0
  62. swcgeom/utils/transforms.py +16 -1
  63. swcgeom/utils/volumetric_object.py +15 -0
  64. {swcgeom-0.17.1.dist-info → swcgeom-0.18.1.dist-info}/LICENSE +1 -1
  65. {swcgeom-0.17.1.dist-info → swcgeom-0.18.1.dist-info}/METADATA +26 -22
  66. swcgeom-0.18.1.dist-info/RECORD +68 -0
  67. {swcgeom-0.17.1.dist-info → swcgeom-0.18.1.dist-info}/WHEEL +1 -1
  68. swcgeom-0.17.1.dist-info/RECORD +0 -67
  69. {swcgeom-0.17.1.dist-info → swcgeom-0.18.1.dist-info}/top_level.txt +0 -0
@@ -1,3 +1,18 @@
1
+ # Copyright 2022-2025 Zexin Yuan
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+
1
16
  """Assemble a tree."""
2
17
 
3
18
  from collections.abc import Iterable
@@ -38,7 +53,7 @@ class LinesToTree(Transform[list[pd.DataFrame], Tree]):
38
53
 
39
54
  def __call__(
40
55
  self, lines: Iterable[pd.DataFrame], *, names: Optional[SWCNames] = None
41
- ):
56
+ ): # TODO check this
42
57
  return self.assemble(lines, names=names)
43
58
 
44
59
  def assemble(
@@ -56,8 +71,8 @@ class LinesToTree(Transform[list[pd.DataFrame], Tree]):
56
71
  Parameters
57
72
  ----------
58
73
  lines : List of ~pd.DataFrame
59
- An array of tables containing a line, columns should follwing
60
- the swc.
74
+ An array of tables containing a line, columns should
75
+ following the swc.
61
76
  undirected : bool, default `True`
62
77
  Forwarding to `self.try_assemble`.
63
78
  names : SWCNames, optional
@@ -170,5 +185,5 @@ class LinesToTree(Transform[list[pd.DataFrame], Tree]):
170
185
 
171
186
  return tree, lines
172
187
 
173
- def extra_repr(self):
188
+ def extra_repr(self) -> str:
174
189
  return f"thre={self.thre}, undirected={self.undirected}"
swcgeom/utils/__init__.py CHANGED
@@ -1,3 +1,18 @@
1
+ # Copyright 2022-2025 Zexin Yuan
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+
1
16
  """Utils."""
2
17
 
3
18
  from swcgeom.utils.debug import *
swcgeom/utils/debug.py CHANGED
@@ -1,3 +1,18 @@
1
+ # Copyright 2022-2025 Zexin Yuan
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+
1
16
  """Debug helpers"""
2
17
 
3
18
  import time
swcgeom/utils/download.py CHANGED
@@ -1,3 +1,18 @@
1
+ # Copyright 2022-2025 Zexin Yuan
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+
1
16
  """Download helpers.
2
17
 
3
18
  Notes
@@ -13,6 +28,7 @@ import itertools
13
28
  import logging
14
29
  import multiprocessing
15
30
  import os
31
+ from functools import partial
16
32
  from urllib.parse import urljoin
17
33
 
18
34
  __all__ = ["download", "fetch_page", "clone_index_page"]
@@ -26,7 +42,7 @@ def download(dst: str, url: str) -> None:
26
42
  r = conn.request("GET", url)
27
43
 
28
44
  dirname = os.path.dirname(dst)
29
- if not os.path.exists(dirname):
45
+ if dirname != "" and not os.path.exists(dirname):
30
46
  os.makedirs(dirname)
31
47
 
32
48
  with open(dst, "wb") as file:
@@ -41,7 +57,7 @@ def fetch_page(url: str):
41
57
  conn = connection_from_url(url)
42
58
  r = conn.request("GET", url)
43
59
  data = r.data.decode("utf-8")
44
- return BeautifulSoup(data)
60
+ return BeautifulSoup(data, features="html.parser")
45
61
 
46
62
 
47
63
  def clone_index_page(
@@ -62,31 +78,35 @@ def clone_index_page(
62
78
  multiprocess : int, default `4`
63
79
  How many process are available for download.
64
80
  """
65
- from urllib3.exceptions import HTTPError
66
-
67
81
  files = get_urls_in_index_page(index_url)
68
82
  logging.info("downloader: search `%s`, found %s files.", index_url, len(files))
69
83
 
70
- def task(url: str) -> None:
71
- filepath = url.removeprefix(index_url)
72
- dist = os.path.join(dist_dir, filepath)
73
- if os.path.exists(filepath):
74
- if not override:
75
- logging.info("downloader: file `%s` exits, skiped.", dist)
76
- return
84
+ task = partial(
85
+ _clone_index_page, index_url=index_url, dist_dir=dist_dir, override=override
86
+ )
87
+ with multiprocessing.Pool(multiprocess) as p:
88
+ p.map(task, files)
77
89
 
78
- logging.info("downloader: file `%s` exits, deleted.", dist)
79
- os.remove(filepath)
80
90
 
81
- try:
82
- logging.info("downloader: downloading `%s` to `%s`", url, dist)
83
- download(filepath, url)
84
- logging.info("downloader: download `%s` to `%s`", url, dist)
85
- except HTTPError as ex:
86
- logging.info("downloader: fails to download `%s`, except `%s`", url, ex)
91
+ def _clone_index_page(url: str, index_url: str, dist_dir: str, override: bool) -> None:
92
+ from urllib3.exceptions import HTTPError
87
93
 
88
- with multiprocessing.Pool(multiprocess) as p:
89
- p.map(task, files)
94
+ filepath = url.removeprefix(index_url)
95
+ dist = os.path.join(dist_dir, filepath)
96
+ if os.path.exists(dist):
97
+ if not override:
98
+ logging.info("downloader: file `%s` exits, skiped.", dist)
99
+ return
100
+
101
+ logging.info("downloader: file `%s` exits, deleted.", dist)
102
+ os.remove(dist)
103
+
104
+ try:
105
+ logging.info("downloader: downloading `%s` to `%s`", url, dist)
106
+ download(dist, url)
107
+ logging.info("downloader: download `%s` to `%s`", url, dist)
108
+ except HTTPError as ex:
109
+ logging.info("downloader: fails to download `%s`, except `%s`", url, ex)
90
110
 
91
111
 
92
112
  def get_urls_in_index_page(url: str) -> list[str]:
@@ -97,3 +117,21 @@ def get_urls_in_index_page(url: str) -> list[str]:
97
117
  dirs = [urljoin(url, a) for a in links if a != "../" and a.endswith("/")]
98
118
  files.extend(itertools.chain(*[get_urls_in_index_page(dir) for dir in dirs]))
99
119
  return files
120
+
121
+
122
+ if __name__ == "__main__":
123
+ import argparse
124
+
125
+ parser = argparse.ArgumentParser(description="Download files from index page.")
126
+ parser.add_argument("url", type=str, help="URL of index page.")
127
+ parser.add_argument("dist", type=str, help="Directory of dist.")
128
+ parser.add_argument(
129
+ "--override", type=bool, default=False, help="Override existing file."
130
+ )
131
+ parser.add_argument(
132
+ "--multiprocess", type=int, default=4, help="How many process are available."
133
+ )
134
+ args = parser.parse_args()
135
+
136
+ logging.basicConfig(level=logging.INFO)
137
+ clone_index_page(args.url, args.dist, args.override, args.multiprocess)
swcgeom/utils/dsu.py CHANGED
@@ -1,3 +1,18 @@
1
+ # Copyright 2022-2025 Zexin Yuan
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+
1
16
  """Disjoint Set Union Impl."""
2
17
 
3
18
  __all__ = ["DisjointSetUnion"]
swcgeom/utils/ellipse.py CHANGED
@@ -1,3 +1,18 @@
1
+ # Copyright 2022-2025 Zexin Yuan
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+
1
16
  """Finds the Minimum Volume Enclosing Ellipsoid."""
2
17
 
3
18
  # pylint: disable=invalid-name
swcgeom/utils/file.py CHANGED
@@ -1,3 +1,18 @@
1
+ # Copyright 2022-2025 Zexin Yuan
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+
1
16
  """File related utils.
2
17
 
3
18
  Notes
@@ -1,9 +1,24 @@
1
+ # Copyright 2022-2025 Zexin Yuan
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+
1
16
  """NeuroMorpho.org.
2
17
 
3
18
  Examples
4
19
  --------
5
20
 
6
- Metadata:
21
+ Metadata:
7
22
 
8
23
  ```json
9
24
  {
@@ -287,13 +302,9 @@ class NeuroMorpho:
287
302
  where = where or (lambda _: True)
288
303
  if isinstance(group_by, str):
289
304
  key = group_by
290
- group_by = lambda v: v[
291
- key
292
- ] # pylint: disable=unnecessary-lambda-assignment
305
+ group_by = lambda v: v[key] # pylint: disable=unnecessary-lambda-assignment
293
306
  elif group_by is None:
294
- group_by = (
295
- lambda _: None
296
- ) # pylint: disable=unnecessary-lambda-assignment
307
+ group_by = lambda _: None # pylint: disable=unnecessary-lambda-assignment
297
308
  items = []
298
309
  for k, v in tx_m.cursor():
299
310
  metadata = json.loads(v)
@@ -1,3 +1,18 @@
1
+ # Copyright 2022-2025 Zexin Yuan
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+
1
16
  """Numpy related utils."""
2
17
 
3
18
  from contextlib import contextmanager
@@ -1,3 +1,18 @@
1
+ # Copyright 2022-2025 Zexin Yuan
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+
1
16
  """2D Plotting utils."""
2
17
 
3
18
  from typing import Optional
@@ -1,3 +1,18 @@
1
+ # Copyright 2022-2025 Zexin Yuan
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+
1
16
  """3D Plotting utils."""
2
17
 
3
18
  import numpy as np
@@ -27,5 +42,7 @@ def draw_lines_3d(
27
42
  Forwarded to `~mpl_toolkits.mplot3d.art3d.Line3DCollection`.
28
43
  """
29
44
 
30
- line_collection = Line3DCollection(lines, joinstyle=joinstyle, capstyle=capstyle, **kwargs) # type: ignore
45
+ line_collection = Line3DCollection(
46
+ lines, joinstyle=joinstyle, capstyle=capstyle, **kwargs
47
+ ) # type: ignore
31
48
  return ax.add_collection3d(line_collection)
swcgeom/utils/renderer.py CHANGED
@@ -1,3 +1,18 @@
1
+ # Copyright 2022-2025 Zexin Yuan
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+
1
16
  """Rendering related utils."""
2
17
 
3
18
  from functools import cached_property
swcgeom/utils/sdf.py CHANGED
@@ -1,3 +1,18 @@
1
+ # Copyright 2022-2025 Zexin Yuan
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+
1
16
  """Signed distance functions.
2
17
 
3
18
  Refs: https://iquilezles.org/articles/distfunctions/
@@ -14,6 +29,7 @@ from collections.abc import Iterable
14
29
 
15
30
  import numpy as np
16
31
  import numpy.typing as npt
32
+ from typing_extensions import deprecated
17
33
 
18
34
  from swcgeom.utils.solid_geometry import project_vector_on_plane
19
35
 
@@ -173,6 +189,7 @@ class SDFDifference(SDF):
173
189
  return flags
174
190
 
175
191
 
192
+ @deprecated("Use `SDFUnion` instead")
176
193
  class SDFCompose(SDFUnion):
177
194
  """Compose multiple SDFs.
178
195
 
@@ -181,11 +198,6 @@ class SDFCompose(SDFUnion):
181
198
  """
182
199
 
183
200
  def __init__(self, sdfs: Iterable[SDF]) -> None:
184
- warnings.warn(
185
- "`SDFCompose` has been replace by `SDFUnion` since v0.14.0, "
186
- "and will be removed in next version",
187
- DeprecationWarning,
188
- )
189
201
  sdfs = list(sdfs)
190
202
  if len(sdfs) == 1:
191
203
  warnings.warn("compose only one SDF, use SDFCompose.compose instead")
@@ -1,3 +1,18 @@
1
+ # Copyright 2022-2025 Zexin Yuan
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+
1
16
  """Solid Geometry."""
2
17
 
3
18
  import numpy as np
@@ -1,3 +1,18 @@
1
+ # Copyright 2022-2025 Zexin Yuan
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+
1
16
  """3D geometry transformations."""
2
17
 
3
18
  import numpy as np
@@ -21,7 +36,7 @@ Vec3f = tuple[float, float, float]
21
36
 
22
37
 
23
38
  def angle(a: npt.ArrayLike, b: npt.ArrayLike) -> float:
24
- """Get the agnle of vectors.
39
+ """Get the angle of vectors.
25
40
 
26
41
  Returns
27
42
  -------
@@ -1,3 +1,18 @@
1
+ # Copyright 2022-2025 Zexin Yuan
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+
1
16
  """Volumetric object.
2
17
 
3
18
  This library implements the calculation of volumes for any shape
@@ -186,7 +186,7 @@
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright [2024] [Zexin Yuan]
189
+ Copyright [yyyy] [name of copyright owner]
190
190
 
191
191
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: swcgeom
3
- Version: 0.17.1
3
+ Version: 0.18.1
4
4
  Summary: Neuron geometry library for swc format
5
5
  Author-email: yzx9 <yuan.zx@outlook.com>
6
6
  License: Apache-2.0
@@ -9,25 +9,25 @@ Keywords: neuronscience,neuron,neuroanatomy,neuron-morphology
9
9
  Requires-Python: >=3.10
10
10
  Description-Content-Type: text/markdown
11
11
  License-File: LICENSE
12
- Requires-Dist: imagecodecs >=2023.3.16
13
- Requires-Dist: matplotlib >=3.5.2
14
- Requires-Dist: numpy >=1.22.3
15
- Requires-Dist: pandas >=1.4.2
16
- Requires-Dist: pynrrd >=1.0.0
17
- Requires-Dist: scipy >=1.9.1
18
- Requires-Dist: sdflit >=0.2.1
19
- Requires-Dist: seaborn >=0.12.0
20
- Requires-Dist: tifffile >=2022.8.12
21
- Requires-Dist: typing-extensions >=4.4.0
22
- Requires-Dist: tqdm >=4.46.1
23
- Requires-Dist: v3d-py-helper >=0.1.0
12
+ Requires-Dist: imagecodecs>=2023.3.16
13
+ Requires-Dist: matplotlib>=3.5.2
14
+ Requires-Dist: numpy>=1.22.3
15
+ Requires-Dist: pandas>=1.4.2
16
+ Requires-Dist: pynrrd>=1.1.0
17
+ Requires-Dist: scipy>=1.9.1
18
+ Requires-Dist: sdflit>=0.2.1
19
+ Requires-Dist: seaborn>=0.12.0
20
+ Requires-Dist: tifffile>=2022.8.12
21
+ Requires-Dist: typing_extensions>=4.4.0
22
+ Requires-Dist: tqdm>=4.46.1
23
+ Requires-Dist: v3d-py-helper==0.1.0
24
24
  Provides-Extra: all
25
- Requires-Dist: beautifulsoup4 >=4.11.1 ; extra == 'all'
26
- Requires-Dist: certifi >=2023.5.7 ; extra == 'all'
27
- Requires-Dist: chardet >=5.2.0 ; extra == 'all'
28
- Requires-Dist: lmdb >=1.4.1 ; extra == 'all'
29
- Requires-Dist: requests >=2.0.0 ; extra == 'all'
30
- Requires-Dist: urllib3 >=1.26.0 ; extra == 'all'
25
+ Requires-Dist: beautifulsoup4>=4.11.1; extra == "all"
26
+ Requires-Dist: certifi>=2023.5.7; extra == "all"
27
+ Requires-Dist: chardet>=5.2.0; extra == "all"
28
+ Requires-Dist: lmdb>=1.4.1; extra == "all"
29
+ Requires-Dist: requests>=2.0.0; extra == "all"
30
+ Requires-Dist: urllib3>=1.26.0; extra == "all"
31
31
 
32
32
  # SWCGEOM
33
33
 
@@ -56,16 +56,20 @@ pip install build
56
56
  pip install --editable .
57
57
  ```
58
58
 
59
- Static analysis don't support import hook used in editable install for [PEP660](https://peps.python.org/pep-0660/) since upgrade to setuptools v64+, detail infomation at [setuptools#3518](https://github.com/pypa/setuptools/issues/3518), a workaround for vscode with pylance:
59
+ Static analysis don't support import hook used in editable install for
60
+ [PEP660](https://peps.python.org/pep-0660/) since upgrade to setuptools v64+,
61
+ detail information at [setuptools#3518](https://github.com/pypa/setuptools/issues/3518),
62
+ a workaround for vscode with pylance:
60
63
 
61
64
  ```json
62
65
  {
63
- "python.analysis.extraPaths": ["/path/to/this/project"]
66
+ "python.analysis.extraPaths": ["/path/to/this/project"]
64
67
  }
65
68
  ```
66
69
 
67
70
  ## LICENSE
68
71
 
69
- This work is licensed under a <a rel="license" href="https://www.apache.org/licenses/">Apache-2.0</a>.
72
+ This work is licensed under a
73
+ <a rel="license" href="https://www.apache.org/licenses/">Apache-2.0</a>.
70
74
 
71
75
  Copyright (c) 2022-present, Zexin Yuan
@@ -0,0 +1,68 @@
1
+ swcgeom/__init__.py,sha256=i9vi8J65kOj8z_gkGkDTufHn28zNbv6panIr9AuNNoc,845
2
+ swcgeom/_version.py,sha256=WKuH__LVaZHj35m7SuPDdqOuUScbj9XEwpPI5Tns-Xw,413
3
+ swcgeom/analysis/__init__.py,sha256=ZCxLqk5aA_96C5281RristqpEp3mnKyDcPOFom2d8iU,861
4
+ swcgeom/analysis/feature_extractor.py,sha256=8hmwwWCZ8c_XcnmyY--vRygo-OAovIoMuVTHnixX8KA,14855
5
+ swcgeom/analysis/features.py,sha256=NnFRUsMO7mPoBNLQ_kwSWHSfaV1BCOYTZz6VuG2Cfi8,6905
6
+ swcgeom/analysis/lmeasure.py,sha256=RLhRIo3VOQFqisBDetP120SntWSTE2rJ-vL5l-QGT40,28688
7
+ swcgeom/analysis/sholl.py,sha256=uGElY5hXILON8uHX9phGwFeKMjWCtA1GTeoyKStkSPE,7203
8
+ swcgeom/analysis/trunk.py,sha256=f6oH2Xlpn76JjKNsC0DKFsnYGn4FP4YRucCeyUaGgjg,6147
9
+ swcgeom/analysis/visualization.py,sha256=dioNW7Y596xhUPySkr-gbcCzLFm4PPsizKAjEXgAdyI,6216
10
+ swcgeom/analysis/visualization3d.py,sha256=OIUEtxPZpwK8eDEuy8_ezh5x2oQishQ3-aj-dGselAY,3094
11
+ swcgeom/analysis/volume.py,sha256=KLEqE5OWKckdw2qsI8Ugmxi-_jePnE9N9ZN6QFC07y8,5197
12
+ swcgeom/core/__init__.py,sha256=RPx9camQEOnI1WZSxfT8Kwb3fxMtg7yPJERvyr_nDqo,1026
13
+ swcgeom/core/branch.py,sha256=xu5J12FjxXSNL3Q_Uiy5qLlMozfcdnkIDO-XyDB_CYg,4764
14
+ swcgeom/core/branch_tree.py,sha256=jFDKkBgaTCT6C4ZsGdihxBp3xC2k9v6wxE43UGW2AuY,2424
15
+ swcgeom/core/compartment.py,sha256=neoM4nyZxPnaHDnxr-T5xItrf6gqctbo8dOawlFQRlM,3850
16
+ swcgeom/core/node.py,sha256=ZVhAQeadPNVpVd8LAVF5i7DWkGsjsigrUdMIUDUp8BY,4376
17
+ swcgeom/core/path.py,sha256=_j9GP7fSaDUeUeFGXPaWDyq5BcQURzTCCh9iuQKiYWM,5065
18
+ swcgeom/core/population.py,sha256=k-sIaYC-m2S82h-rJM0iocdFpQDKuEBuaw6_WNgI_0s,11039
19
+ swcgeom/core/swc.py,sha256=SqJdj-auOBuxOoRxg33DFcigIx8_BuWfeHyWYBQY7xk,7384
20
+ swcgeom/core/tree.py,sha256=Hq4KOFvEWcFqFvGC3D-1f_WKRu6p6P_hfJT5vOVGKXY,13150
21
+ swcgeom/core/tree_utils.py,sha256=2cg3HBn7-6S_J64z9F12CLGVDarpn5epCk3icVWtgEY,8192
22
+ swcgeom/core/tree_utils_impl.py,sha256=1G1qZA7kwWifol8h5cBsFuwh6YA0ZTfpzG5brGwBFs0,2178
23
+ swcgeom/core/swc_utils/__init__.py,sha256=KFxqtbIzpAum9GMPUFTXD8i7IlypckbnUSx3rKPNcb0,1155
24
+ swcgeom/core/swc_utils/assembler.py,sha256=lrW0vWFSpvL3PGjA80mCSR9XH3RHX2wLyZ1v4Tux4Gw,1470
25
+ swcgeom/core/swc_utils/base.py,sha256=bjH8AOclIAXGecUVxDOrk9jD7NAq1OdkvXgIQLj6UP0,5312
26
+ swcgeom/core/swc_utils/checker.py,sha256=xbzUjHPR5sMHRCA1f9MAd_4xUvyb5NRsJWSB7cPXSdw,3182
27
+ swcgeom/core/swc_utils/io.py,sha256=Btyg0w5VsYL3LFBF59ADsWNbD3EthR4pKEBpThaJDDM,7047
28
+ swcgeom/core/swc_utils/normalizer.py,sha256=egYdZAex8h1SninrWkkKpU9Tu9rmB9uaHwa3u4kasO0,5673
29
+ swcgeom/core/swc_utils/subtree.py,sha256=Jgk39eguBIxhrz3AL1X6pzLfo0tXovNes51D7U4Qw9k,2569
30
+ swcgeom/images/__init__.py,sha256=NAt1vRlCvNWODR_cwedfWxRgnpLdb85tBwFJY3a457k,677
31
+ swcgeom/images/augmentation.py,sha256=6YuQpuWaarc_bD0Pjz42eFreVjhA2qmeUEK84RBcc_g,4748
32
+ swcgeom/images/contrast.py,sha256=f5EqJJ4tGcG46dm9pMeQm_cM1fYcIXC6qYjcOFxThTc,2741
33
+ swcgeom/images/folder.py,sha256=-WpAvCBZ5qYfFZTWI1e-O7jAGLjm_PyZWV91fegP45E,7025
34
+ swcgeom/images/io.py,sha256=dgu69iqb_Bkk8guLt5TYSOz-lG_WemEOFrRmoZsQTg8,21137
35
+ swcgeom/transforms/__init__.py,sha256=z8e2YmMJpQaYk6KIg3sI989exl_eHeeiNT-1gMTwgVY,1188
36
+ swcgeom/transforms/base.py,sha256=l5DEZjZhjH23Axg8ozJTFzSmNNwIlTfm0XxAOIAQtlE,4696
37
+ swcgeom/transforms/branch.py,sha256=L8O7CwLdY-q_b53vrKfA_nlePh5lKx2kA-foVtQd6sQ,7861
38
+ swcgeom/transforms/branch_tree.py,sha256=i2w16ny70oWbJhq5mHX7wgEVGol1AYKB3P-N5Kh3z2I,2820
39
+ swcgeom/transforms/geometry.py,sha256=xA9RN1oWRV0S1OVC_vxGZOq8CjGLERnlR5vM4_wvUG8,8008
40
+ swcgeom/transforms/image_preprocess.py,sha256=lT5ceaE9IzJjq6vIFh0p1YzsyBYAtqz_ElqErvZvDdE,4243
41
+ swcgeom/transforms/image_stack.py,sha256=Zc9p5MGt8zdkla-RnKdsF64NLgS7cfK9j2qG4ggiSgI,6720
42
+ swcgeom/transforms/images.py,sha256=bPJwtwIcHVECHV0qQBVWRFzTWLKEf31V4TiRgjFrGn8,6139
43
+ swcgeom/transforms/mst.py,sha256=spUuXjglCBnZmR6mIyCBJJGmQbfpx7hb1nndT3_iUG4,6832
44
+ swcgeom/transforms/neurolucida_asc.py,sha256=0WyM9B5qpJ5hjVGKpO8atWpaUhJdLQ0lKMhcJkuOsfM,14699
45
+ swcgeom/transforms/path.py,sha256=SqBPYvCnDc1yd8UCBwyelAXnduNAvJ16pWo9lMoZVI0,1670
46
+ swcgeom/transforms/population.py,sha256=kayuwNs8jWTrHZ4sqoH9HUcLqR0OybJbGtb7HvpFIdw,1389
47
+ swcgeom/transforms/tree.py,sha256=qlYISDuT7DlEQ2uaa1Y-vqb2rbs9JHr9Bays546XuCI,8152
48
+ swcgeom/transforms/tree_assembler.py,sha256=rWm7D7tAhk9UkX1PL_QfXw2-98xlI7cF3IsIyW7eOzQ,5743
49
+ swcgeom/utils/__init__.py,sha256=PxT8okoPYJ-kjKqXZDFaDB2bmGjRdS73Y6GJcZ_0-tc,1047
50
+ swcgeom/utils/debug.py,sha256=ZOYLfj32YDjSU1tJrtThWF2SROwYhG2z7j4Fq0q4Dsw,1046
51
+ swcgeom/utils/download.py,sha256=VNJCsXty3NrwPv9CzyA_OkHsEQj4LArkoAuPmW-NX6c,4237
52
+ swcgeom/utils/dsu.py,sha256=tU_hBjSFBXiraJphB_qQ7Rt1pKNFUIbh0kvU_zJ1UaI,2016
53
+ swcgeom/utils/ellipse.py,sha256=o8CZmEhJIy2bejDX2nr92H5vootuLoIkk-sSTG19cAo,3815
54
+ swcgeom/utils/file.py,sha256=6P_jSfpUPulJ2PSHGr-maEZotLvM35egEmH4RRO022Y,3096
55
+ swcgeom/utils/neuromorpho.py,sha256=AE3wlDckLFYI9MuQv4XlA0LYMLpGUm8OQLNnym-DQB4,19617
56
+ swcgeom/utils/numpy_helper.py,sha256=wsY8-4naAOMfKQ2O-dVRcblM2NrezhjsUEfUzT2holk,2006
57
+ swcgeom/utils/plotter_2d.py,sha256=ojhEUpMbP9-7XE64CNb4kVoUS6WoFrYlmqumbGr79go,4450
58
+ swcgeom/utils/plotter_3d.py,sha256=6IU_Oyls5chq6ol30R4zp85oK_31yHB6vVp09D6pYGA,1458
59
+ swcgeom/utils/renderer.py,sha256=aDp2HZRUe9GDNdslewLKh6OCTKfz8G_6c4AmK14EajQ,4801
60
+ swcgeom/utils/sdf.py,sha256=C8uH9R2qMYeXgy1icHcaGQnjqQbU-0d6gWNw7tfge10,11156
61
+ swcgeom/utils/solid_geometry.py,sha256=2c8MNCfvkF7HAhmLPQXvHF8uexoNJBeFh6Qa9n6M8CQ,2980
62
+ swcgeom/utils/transforms.py,sha256=UKGeCv8O109mcBk1_opnwABLYVpmfF8sT_f5Mx5APSM,7538
63
+ swcgeom/utils/volumetric_object.py,sha256=Y_rEAzeCozJWwXicerwRElwotTgQwHlz9TChzsG9J1I,15683
64
+ swcgeom-0.18.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
65
+ swcgeom-0.18.1.dist-info/METADATA,sha256=6Kzd9SDFrv7wAn79afVHQfq2vu91715PzmFIwfO5IKk,2307
66
+ swcgeom-0.18.1.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
67
+ swcgeom-0.18.1.dist-info/top_level.txt,sha256=hmLyUXWS61Gxl07haswFEKKefYPBVJYlUlol8ghNkjY,8
68
+ swcgeom-0.18.1.dist-info/RECORD,,