siibra 1.0a14__py3-none-any.whl → 1.0.1a0__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 siibra might be problematic. Click here for more details.

Files changed (80) hide show
  1. siibra/VERSION +1 -1
  2. siibra/__init__.py +15 -5
  3. siibra/commons.py +3 -48
  4. siibra/configuration/__init__.py +1 -1
  5. siibra/configuration/configuration.py +1 -1
  6. siibra/configuration/factory.py +164 -127
  7. siibra/core/__init__.py +1 -1
  8. siibra/core/assignment.py +1 -1
  9. siibra/core/atlas.py +24 -17
  10. siibra/core/concept.py +18 -9
  11. siibra/core/parcellation.py +76 -55
  12. siibra/core/region.py +163 -183
  13. siibra/core/space.py +3 -1
  14. siibra/core/structure.py +1 -2
  15. siibra/exceptions.py +17 -1
  16. siibra/experimental/contour.py +6 -6
  17. siibra/experimental/patch.py +2 -2
  18. siibra/experimental/plane3d.py +8 -8
  19. siibra/explorer/__init__.py +1 -1
  20. siibra/explorer/url.py +15 -0
  21. siibra/explorer/util.py +1 -1
  22. siibra/features/__init__.py +1 -1
  23. siibra/features/anchor.py +13 -14
  24. siibra/features/connectivity/__init__.py +1 -1
  25. siibra/features/connectivity/functional_connectivity.py +1 -1
  26. siibra/features/connectivity/regional_connectivity.py +7 -5
  27. siibra/features/connectivity/streamline_counts.py +1 -1
  28. siibra/features/connectivity/streamline_lengths.py +1 -1
  29. siibra/features/connectivity/tracing_connectivity.py +1 -1
  30. siibra/features/dataset/__init__.py +1 -1
  31. siibra/features/dataset/ebrains.py +1 -1
  32. siibra/features/feature.py +50 -28
  33. siibra/features/image/__init__.py +1 -1
  34. siibra/features/image/image.py +18 -13
  35. siibra/features/image/sections.py +1 -1
  36. siibra/features/image/volume_of_interest.py +1 -1
  37. siibra/features/tabular/__init__.py +1 -1
  38. siibra/features/tabular/bigbrain_intensity_profile.py +2 -2
  39. siibra/features/tabular/cell_density_profile.py +102 -66
  40. siibra/features/tabular/cortical_profile.py +5 -3
  41. siibra/features/tabular/gene_expression.py +1 -1
  42. siibra/features/tabular/layerwise_bigbrain_intensities.py +1 -1
  43. siibra/features/tabular/layerwise_cell_density.py +8 -25
  44. siibra/features/tabular/receptor_density_fingerprint.py +5 -3
  45. siibra/features/tabular/receptor_density_profile.py +5 -3
  46. siibra/features/tabular/regional_timeseries_activity.py +7 -5
  47. siibra/features/tabular/tabular.py +5 -3
  48. siibra/livequeries/__init__.py +1 -1
  49. siibra/livequeries/allen.py +46 -20
  50. siibra/livequeries/bigbrain.py +9 -9
  51. siibra/livequeries/ebrains.py +1 -1
  52. siibra/livequeries/query.py +1 -2
  53. siibra/locations/__init__.py +10 -10
  54. siibra/locations/boundingbox.py +77 -38
  55. siibra/locations/location.py +12 -4
  56. siibra/locations/point.py +14 -9
  57. siibra/locations/{pointset.py → pointcloud.py} +69 -27
  58. siibra/retrieval/__init__.py +1 -1
  59. siibra/retrieval/cache.py +1 -1
  60. siibra/retrieval/datasets.py +1 -1
  61. siibra/retrieval/exceptions/__init__.py +1 -1
  62. siibra/retrieval/repositories.py +10 -27
  63. siibra/retrieval/requests.py +20 -3
  64. siibra/vocabularies/__init__.py +1 -1
  65. siibra/volumes/__init__.py +2 -2
  66. siibra/volumes/parcellationmap.py +121 -94
  67. siibra/volumes/providers/__init__.py +1 -1
  68. siibra/volumes/providers/freesurfer.py +1 -1
  69. siibra/volumes/providers/gifti.py +1 -1
  70. siibra/volumes/providers/neuroglancer.py +68 -42
  71. siibra/volumes/providers/nifti.py +18 -28
  72. siibra/volumes/providers/provider.py +2 -2
  73. siibra/volumes/sparsemap.py +128 -247
  74. siibra/volumes/volume.py +252 -65
  75. {siibra-1.0a14.dist-info → siibra-1.0.1a0.dist-info}/METADATA +17 -4
  76. siibra-1.0.1a0.dist-info/RECORD +84 -0
  77. {siibra-1.0a14.dist-info → siibra-1.0.1a0.dist-info}/WHEEL +1 -1
  78. siibra-1.0a14.dist-info/RECORD +0 -84
  79. {siibra-1.0a14.dist-info → siibra-1.0.1a0.dist-info}/LICENSE +0 -0
  80. {siibra-1.0a14.dist-info → siibra-1.0.1a0.dist-info}/top_level.txt +0 -0
siibra/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0a14
1
+ 1.0.1-alpha.0
siibra/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright 2018-2021
1
+ # Copyright 2018-2024
2
2
  # Institute of Neuroscience and Medicine (INM-1), Forschungszentrum Jülich GmbH
3
3
 
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -39,7 +39,7 @@ from . import configuration
39
39
  from . import experimental
40
40
  from .configuration import factory
41
41
  from . import features, livequeries
42
- from siibra.locations import Point, PointSet
42
+ from siibra.locations import Point, PointCloud
43
43
 
44
44
  import os as _os
45
45
  logger.info(f"Version: {__version__}")
@@ -51,7 +51,7 @@ logger.info(
51
51
  # forward access to some functions
52
52
  set_ebrains_token = _EbrainsRequest.set_token
53
53
  fetch_ebrains_token = _EbrainsRequest.fetch_token
54
- find_regions = _parcellation.Parcellation.find_regions
54
+ find_regions = _parcellation.find_regions
55
55
  from_json = factory.Factory.from_json
56
56
 
57
57
 
@@ -107,6 +107,14 @@ def set_feasible_download_size(maxsize_gbyte):
107
107
 
108
108
 
109
109
  def set_cache_size(maxsize_gbyte: int):
110
+ """
111
+ siibra runs maintainance on its local cache to keep it under a predetermined
112
+ size of 2 gigabytes. This method changes the cache size.
113
+
114
+ Parameters
115
+ ----------
116
+ maxsize_gbyte : int
117
+ """
110
118
  assert maxsize_gbyte >= 0
111
119
  cache.SIZE_GIB = maxsize_gbyte
112
120
  logger.info(f"Set cache size to {maxsize_gbyte} GiB.")
@@ -142,7 +150,7 @@ def __dir__():
142
150
  "get_template",
143
151
  "MapType",
144
152
  "Point",
145
- "PointSet",
153
+ "PointCloud",
146
154
  "QUIET",
147
155
  "VERBOSE",
148
156
  "fetch_ebrains_token",
@@ -150,5 +158,7 @@ def __dir__():
150
158
  "vocabularies",
151
159
  "__version__",
152
160
  "cache",
153
- "warm_cache"
161
+ "warm_cache",
162
+ "set_cache_size",
163
+ "from_json",
154
164
  ]
siibra/commons.py CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright 2018-2023
1
+ # Copyright 2018-2024
2
2
  # Institute of Neuroscience and Medicine (INM-1), Forschungszentrum Jülich GmbH
3
3
 
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -35,6 +35,7 @@ except ImportError:
35
35
  # support python 3.7
36
36
  from typing_extensions import TypedDict
37
37
 
38
+ logging.addLevelName(21, "INFO_WO_PROGRESS_BARS")
38
39
  logger = logging.getLogger(__name__.split(os.path.extsep)[0])
39
40
  ch = logging.StreamHandler()
40
41
  formatter = logging.Formatter("[{name}:{levelname}] {message}", style="{")
@@ -297,7 +298,7 @@ def siibra_tqdm(iterable: Iterable[T] = None, *args, **kwargs):
297
298
  return tqdm(
298
299
  iterable,
299
300
  *args,
300
- disable=kwargs.pop("disable", False) or (logger.level > 20),
301
+ disable=kwargs.pop("disable", False) or (logger.level > logging.INFO),
301
302
  **kwargs
302
303
  )
303
304
 
@@ -365,9 +366,6 @@ class MapType(Enum):
365
366
  STATISTICAL = 2
366
367
 
367
368
 
368
- SIIBRA_DEFAULT_MAPTYPE = MapType.LABELLED
369
- SIIBRA_DEFAULT_MAP_THRESHOLD = 0.0
370
-
371
369
  REMOVE_FROM_NAME = [
372
370
  "hemisphere",
373
371
  " -",
@@ -585,49 +583,6 @@ def connected_components(
585
583
  )
586
584
 
587
585
 
588
- class PolyLine:
589
- """Simple polyline representation which allows equidistant sampling.."""
590
-
591
- def __init__(self, pts):
592
- self.pts = pts
593
- self.lengths = [
594
- np.sqrt(np.sum((pts[i, :] - pts[i - 1, :]) ** 2))
595
- for i in range(1, pts.shape[0])
596
- ]
597
-
598
- def length(self):
599
- return sum(self.lengths)
600
-
601
- def sample(self, d):
602
-
603
- # if d is interable, we assume a list of sample positions
604
- try:
605
- iter(d)
606
- except TypeError:
607
- positions = [d]
608
- else:
609
- positions = d
610
-
611
- samples = []
612
- for s_ in positions:
613
- s = min(max(s_, 0), 1)
614
- target_distance = s * self.length()
615
- current_distance = 0
616
- for i, length in enumerate(self.lengths):
617
- current_distance += length
618
- if current_distance >= target_distance:
619
- p1 = self.pts[i, :]
620
- p2 = self.pts[i + 1, :]
621
- r = (target_distance - current_distance + length) / length
622
- samples.append(p1 + (p2 - p1) * r)
623
- break
624
-
625
- if len(samples) == 1:
626
- return samples[0]
627
- else:
628
- return np.array(samples)
629
-
630
-
631
586
  def unify_stringlist(L: list):
632
587
  """Adds asterisks to strings that appear multiple times, so the resulting
633
588
  list has only unique strings but still the same length, order, and meaning.
@@ -1,4 +1,4 @@
1
- # Copyright 2018-2021
1
+ # Copyright 2018-2024
2
2
  # Institute of Neuroscience and Medicine (INM-1), Forschungszentrum Jülich GmbH
3
3
 
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,4 +1,4 @@
1
- # Copyright 2018-2021
1
+ # Copyright 2018-2024
2
2
  # Institute of Neuroscience and Medicine (INM-1), Forschungszentrum Jülich GmbH
3
3
 
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");