siibra 1.0.1a1__tar.gz → 1.0.1a5__tar.gz

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 (95) hide show
  1. {siibra-1.0.1a1/siibra.egg-info → siibra-1.0.1a5}/PKG-INFO +37 -17
  2. {siibra-1.0.1a1 → siibra-1.0.1a5}/README.rst +34 -15
  3. siibra-1.0.1a5/siibra/VERSION +1 -0
  4. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/__init__.py +7 -16
  5. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/commons.py +19 -8
  6. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/configuration/configuration.py +5 -6
  7. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/configuration/factory.py +13 -8
  8. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/core/__init__.py +1 -1
  9. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/core/assignment.py +19 -7
  10. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/core/concept.py +4 -2
  11. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/core/region.py +24 -25
  12. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/core/space.py +4 -6
  13. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/explorer/url.py +2 -2
  14. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/features/anchor.py +3 -7
  15. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/features/connectivity/regional_connectivity.py +51 -40
  16. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/features/feature.py +29 -20
  17. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/features/image/__init__.py +6 -3
  18. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/features/image/image.py +2 -4
  19. siibra-1.0.1a5/siibra/features/image/sections.py +105 -0
  20. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/features/image/volume_of_interest.py +8 -7
  21. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/features/tabular/__init__.py +1 -1
  22. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/features/tabular/bigbrain_intensity_profile.py +2 -1
  23. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/features/tabular/cell_density_profile.py +8 -9
  24. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/features/tabular/gene_expression.py +34 -16
  25. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/features/tabular/layerwise_bigbrain_intensities.py +4 -3
  26. siibra-1.0.1a5/siibra/features/tabular/layerwise_cell_density.py +154 -0
  27. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/features/tabular/receptor_density_fingerprint.py +34 -9
  28. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/features/tabular/receptor_density_profile.py +1 -2
  29. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/features/tabular/tabular.py +14 -7
  30. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/livequeries/allen.py +23 -22
  31. siibra-1.0.1a5/siibra/livequeries/bigbrain.py +394 -0
  32. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/livequeries/ebrains.py +13 -10
  33. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/locations/__init__.py +17 -8
  34. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/locations/boundingbox.py +10 -8
  35. siibra-1.0.1a1/siibra/experimental/plane3d.py → siibra-1.0.1a5/siibra/locations/experimental.py +113 -13
  36. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/locations/location.py +17 -13
  37. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/locations/point.py +14 -19
  38. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/locations/pointcloud.py +57 -12
  39. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/retrieval/cache.py +1 -0
  40. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/retrieval/datasets.py +19 -13
  41. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/retrieval/repositories.py +10 -11
  42. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/retrieval/requests.py +26 -24
  43. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/vocabularies/__init__.py +1 -2
  44. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/volumes/__init__.py +4 -3
  45. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/volumes/parcellationmap.py +33 -17
  46. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/volumes/providers/neuroglancer.py +19 -22
  47. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/volumes/providers/provider.py +3 -2
  48. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/volumes/sparsemap.py +19 -26
  49. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/volumes/volume.py +21 -28
  50. {siibra-1.0.1a1 → siibra-1.0.1a5/siibra.egg-info}/PKG-INFO +37 -17
  51. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra.egg-info/SOURCES.txt +1 -5
  52. siibra-1.0.1a1/siibra/VERSION +0 -1
  53. siibra-1.0.1a1/siibra/experimental/__init__.py +0 -19
  54. siibra-1.0.1a1/siibra/experimental/contour.py +0 -61
  55. siibra-1.0.1a1/siibra/experimental/cortical_profile_sampler.py +0 -57
  56. siibra-1.0.1a1/siibra/experimental/patch.py +0 -98
  57. siibra-1.0.1a1/siibra/features/image/sections.py +0 -26
  58. siibra-1.0.1a1/siibra/features/tabular/layerwise_cell_density.py +0 -95
  59. siibra-1.0.1a1/siibra/livequeries/bigbrain.py +0 -206
  60. {siibra-1.0.1a1 → siibra-1.0.1a5}/LICENSE +0 -0
  61. {siibra-1.0.1a1 → siibra-1.0.1a5}/MANIFEST.in +0 -0
  62. {siibra-1.0.1a1 → siibra-1.0.1a5}/setup.cfg +0 -0
  63. {siibra-1.0.1a1 → siibra-1.0.1a5}/setup.py +0 -0
  64. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/configuration/__init__.py +0 -0
  65. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/core/atlas.py +3 -3
  66. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/core/parcellation.py +5 -5
  67. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/core/structure.py +2 -2
  68. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/exceptions.py +0 -0
  69. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/explorer/__init__.py +0 -0
  70. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/explorer/util.py +0 -0
  71. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/features/__init__.py +0 -0
  72. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/features/connectivity/__init__.py +0 -0
  73. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/features/connectivity/functional_connectivity.py +0 -0
  74. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/features/connectivity/streamline_counts.py +0 -0
  75. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/features/connectivity/streamline_lengths.py +0 -0
  76. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/features/connectivity/tracing_connectivity.py +0 -0
  77. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/features/dataset/__init__.py +0 -0
  78. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/features/dataset/ebrains.py +1 -1
  79. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/features/tabular/cortical_profile.py +6 -6
  80. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/features/tabular/regional_timeseries_activity.py +7 -7
  81. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/livequeries/__init__.py +0 -0
  82. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/livequeries/query.py +3 -3
  83. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/retrieval/__init__.py +0 -0
  84. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/retrieval/exceptions/__init__.py +0 -0
  85. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/vocabularies/gene_names.json +0 -0
  86. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/vocabularies/receptor_symbols.json +0 -0
  87. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/vocabularies/region_aliases.json +0 -0
  88. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/volumes/providers/__init__.py +0 -0
  89. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/volumes/providers/freesurfer.py +4 -4
  90. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/volumes/providers/gifti.py +4 -4
  91. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra/volumes/providers/nifti.py +6 -6
  92. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra.egg-info/dependency_links.txt +0 -0
  93. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra.egg-info/requires.txt +0 -0
  94. {siibra-1.0.1a1 → siibra-1.0.1a5}/siibra.egg-info/top_level.txt +0 -0
  95. {siibra-1.0.1a1 → siibra-1.0.1a5}/test/test_siibra.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: siibra
3
- Version: 1.0.1a1
3
+ Version: 1.0.1a5
4
4
  Summary: siibra - Software interfaces for interacting with brain atlases
5
5
  Home-page: https://github.com/FZJ-INM1-BDA/siibra-python
6
6
  Author: Big Data Analytics Group, Forschungszentrum Juelich, Institute of Neuroscience and Medicine (INM-1)
@@ -33,6 +33,7 @@ Dynamic: classifier
33
33
  Dynamic: description
34
34
  Dynamic: description-content-type
35
35
  Dynamic: home-page
36
+ Dynamic: license-file
36
37
  Dynamic: requires-dist
37
38
  Dynamic: requires-python
38
39
  Dynamic: summary
@@ -43,22 +44,28 @@ Dynamic: summary
43
44
  siibra - Software interface for interacting with brain atlases
44
45
  ==============================================================
45
46
 
46
- Copyright 2018-2024, Forschungszentrum Jülich GmbH
47
+ Copyright 2018-2025, Forschungszentrum Jülich GmbH
47
48
 
48
49
  *Authors: Big Data Analytics Group, Institute of Neuroscience and
49
50
  Medicine (INM-1), Forschungszentrum Jülich GmbH*
50
51
 
51
52
  .. intro-start
52
53
 
53
- ``siibra`` is a Python client to a brain atlas framework that integrates brain parcellations and reference spaces at different spatial scales, and connects them with a broad range of multimodal regional data features.
54
+ ``siibra-python`` is a Python client to a brain atlas framework that integrates brain parcellations and reference spaces at different spatial scales, and connects them with a broad range of multimodal regional data features.
54
55
  It aims to facilitate programmatic and reproducible incorporation of brain parcellations and brain region features from different sources into neuroscience workflows.
55
56
 
56
- **Note:** ``siibra-python`` *is still in development. While care is taken that it works reliably, its API is not yet stable and you may still encounter bugs when using it.*
57
-
58
57
  ``siibra`` provides structured access to parcellation schemes in different brain reference spaces, including volumetric reference templates at macroscopic and microscopic resolutions as well as surface representations.
59
58
  It supports both discretely labelled and statistical (probabilistic) parcellation maps, which can be used to assign brain regions to spatial locations and image signals, to retrieve region-specific neuroscience datasets from multiple online repositories, and to sample information from high-resolution image data.
60
59
  The datasets anchored to brain regions address features of molecular, cellular and architecture as well as connectivity, and are complemented with live queries to external repositories as well as dynamic extraction from "big" image volumes such as the 20 micrometer BigBrain model.
61
60
 
61
+ ``siibra`` hides much of the complexity that would be required to collect and interact with the individual parcellations, templates and data repositories.
62
+ By encapsulating many aspects of interacting with different maps and reference templates spaces, it also minimizes common errors like misinterpretation of coordinates from different reference spaces, confusing label indices of brain regions, or using inconsistent versions of parcellation maps.
63
+ It aims to provide a safe way of using maps defined across multiple spatial scales for reproducible analysis.
64
+
65
+ .. intro-end
66
+
67
+ .. about-start
68
+
62
69
  ``siibra`` was developed in the frame of the `Human Brain Project <https://humanbrainproject.eu>`__ for accessing the `EBRAINS
63
70
  human brain atlas <https://ebrains.eu/service/human-brain-atlas>`__.
64
71
  It stores most of its contents as sustainable and open datasets in the `EBRAINS Knowledge Graph <https://kg.ebrains.eu>`__, and is designed to support the `OpenMINDS metadata standards <https://github.com/HumanBrainProject/openMINDS_SANDS>`__.
@@ -67,11 +74,7 @@ In fact, the viewer is a good resource for exploring ``siibra``\ ’s core funct
67
74
  Feature queries in ``siibra`` are parameterized by data modality and anatomical location, while the latter could be a brain region, brain parcellation, or location in reference space.
68
75
  Beyond the explorative focus of ``siibra-explorer``, the Python library supports a range of data analysis functions suitable for typical neuroscience workflows.
69
76
 
70
- ``siibra`` hides much of the complexity that would be required to collect and interact with the individual parcellations, templates and data repositories.
71
- By encapsulating many aspects of interacting with different maps and reference templates spaces, it also minimizes common errors like misinterpretation of coordinates from different reference spaces, confusing label indices of brain regions, or using inconsistent versions of parcellation maps.
72
- It aims to provide a safe way of using maps defined across multiple spatial scales for reproducible analysis.
73
-
74
- .. intro-end
77
+ .. about-end
75
78
 
76
79
  .. getting-started-start
77
80
 
@@ -80,10 +83,26 @@ Installation
80
83
 
81
84
  ``siibra`` is available on pypi.
82
85
  To install the latest released version, simply run ``pip install siibra``.
86
+ The installation typically takes about 2 minutes on a standard computer where Python is already installed.
83
87
  In order to work with the latest version from github, use ``pip install git+https://github.com/FZJ-INM1-BDA/siibra-python.git@main``.
84
88
 
85
- There is also an image based on jupyter:scipy-notebook, which already includes ``siibra``.
86
-
89
+ ``siibra-python`` should be installable on recent versions of Windows, Linux and Mac OS in a recent Python 3 environment.
90
+ We run continuous integration tests for versions 3.7 - 3.12 on recent Ubuntu images.
91
+
92
+ The library requires a couple of open source packages, namely:
93
+ ```
94
+ anytree >= 2.12.1
95
+ nibabel >= 5.3.2
96
+ appdirs >= 1.4.4
97
+ scikit-image >= 0.25.0
98
+ requests >= 2.32.3
99
+ neuroglancer-scripts >= 1.2.0
100
+ nilearn >= 0.11.0
101
+ filelock >= 3.16.1
102
+ ebrains-drive >= 0.6.0
103
+ ```
104
+
105
+ You can also install a docker image with all dependencies included:
87
106
  .. code-block:: sh
88
107
 
89
108
  docker run -dit \
@@ -93,19 +112,20 @@ There is also an image based on jupyter:scipy-notebook, which already includes `
93
112
  docker-registry.ebrains.eu/siibra/siibra-python:latest
94
113
 
95
114
 
115
+
96
116
  Documentation & Help
97
117
  ====================
98
118
 
99
119
  ``siibra-python``\ ’s documentation is hosted on https://siibra-python.readthedocs.io.
100
120
  The documentation includes a catalogue of documented code examples that walk you through the different concepts and functionalities.
121
+ These examples use real data and include both the code and the produced expected outputs.
122
+ They can be accessed at https://siibra-python.readthedocs.io/en/latest/examples.html, and are
123
+ automatically tested and updated whenever a new version of ``siibra-python`` is published.
101
124
  As a new user, it is recommended to go through these examples - they are easy and will quickly provide you with the right code snippets that get you started.
102
- Furthermore, a set of jupyter notebooks demonstrating more extensive example use cases are maintained in the `siibra-tutorials <https://github.com/FZJ-INM1-BDA/siibra-tutorials>`__ repository.
103
- We are working on a full API documentation of the library. You find the current status on readthedocs, but be aware that it is not yet complete and as up-to-date as the code examples.
125
+ The documentation on readthedocs further includes introductory explanations and an API reference.
104
126
 
105
127
  If you run into issues, please open a ticket on `EBRAINS support <https://ebrains.eu/support/>`__ or file bugs and
106
128
  feature requests on `github <https://github.com/FZJ-INM1-BDA/siibra-python/issues>`__.
107
- Please keep in mind that ``siibra-python`` is still in development.
108
- While care is taken to make everything work reliably, the API of the library is not yet stable, and the software is not yet fully tested.
109
129
 
110
130
  .. getting-started-end
111
131
 
@@ -4,22 +4,28 @@
4
4
  siibra - Software interface for interacting with brain atlases
5
5
  ==============================================================
6
6
 
7
- Copyright 2018-2024, Forschungszentrum Jülich GmbH
7
+ Copyright 2018-2025, Forschungszentrum Jülich GmbH
8
8
 
9
9
  *Authors: Big Data Analytics Group, Institute of Neuroscience and
10
10
  Medicine (INM-1), Forschungszentrum Jülich GmbH*
11
11
 
12
12
  .. intro-start
13
13
 
14
- ``siibra`` is a Python client to a brain atlas framework that integrates brain parcellations and reference spaces at different spatial scales, and connects them with a broad range of multimodal regional data features.
14
+ ``siibra-python`` is a Python client to a brain atlas framework that integrates brain parcellations and reference spaces at different spatial scales, and connects them with a broad range of multimodal regional data features.
15
15
  It aims to facilitate programmatic and reproducible incorporation of brain parcellations and brain region features from different sources into neuroscience workflows.
16
16
 
17
- **Note:** ``siibra-python`` *is still in development. While care is taken that it works reliably, its API is not yet stable and you may still encounter bugs when using it.*
18
-
19
17
  ``siibra`` provides structured access to parcellation schemes in different brain reference spaces, including volumetric reference templates at macroscopic and microscopic resolutions as well as surface representations.
20
18
  It supports both discretely labelled and statistical (probabilistic) parcellation maps, which can be used to assign brain regions to spatial locations and image signals, to retrieve region-specific neuroscience datasets from multiple online repositories, and to sample information from high-resolution image data.
21
19
  The datasets anchored to brain regions address features of molecular, cellular and architecture as well as connectivity, and are complemented with live queries to external repositories as well as dynamic extraction from "big" image volumes such as the 20 micrometer BigBrain model.
22
20
 
21
+ ``siibra`` hides much of the complexity that would be required to collect and interact with the individual parcellations, templates and data repositories.
22
+ By encapsulating many aspects of interacting with different maps and reference templates spaces, it also minimizes common errors like misinterpretation of coordinates from different reference spaces, confusing label indices of brain regions, or using inconsistent versions of parcellation maps.
23
+ It aims to provide a safe way of using maps defined across multiple spatial scales for reproducible analysis.
24
+
25
+ .. intro-end
26
+
27
+ .. about-start
28
+
23
29
  ``siibra`` was developed in the frame of the `Human Brain Project <https://humanbrainproject.eu>`__ for accessing the `EBRAINS
24
30
  human brain atlas <https://ebrains.eu/service/human-brain-atlas>`__.
25
31
  It stores most of its contents as sustainable and open datasets in the `EBRAINS Knowledge Graph <https://kg.ebrains.eu>`__, and is designed to support the `OpenMINDS metadata standards <https://github.com/HumanBrainProject/openMINDS_SANDS>`__.
@@ -28,11 +34,7 @@ In fact, the viewer is a good resource for exploring ``siibra``\ ’s core funct
28
34
  Feature queries in ``siibra`` are parameterized by data modality and anatomical location, while the latter could be a brain region, brain parcellation, or location in reference space.
29
35
  Beyond the explorative focus of ``siibra-explorer``, the Python library supports a range of data analysis functions suitable for typical neuroscience workflows.
30
36
 
31
- ``siibra`` hides much of the complexity that would be required to collect and interact with the individual parcellations, templates and data repositories.
32
- By encapsulating many aspects of interacting with different maps and reference templates spaces, it also minimizes common errors like misinterpretation of coordinates from different reference spaces, confusing label indices of brain regions, or using inconsistent versions of parcellation maps.
33
- It aims to provide a safe way of using maps defined across multiple spatial scales for reproducible analysis.
34
-
35
- .. intro-end
37
+ .. about-end
36
38
 
37
39
  .. getting-started-start
38
40
 
@@ -41,10 +43,26 @@ Installation
41
43
 
42
44
  ``siibra`` is available on pypi.
43
45
  To install the latest released version, simply run ``pip install siibra``.
46
+ The installation typically takes about 2 minutes on a standard computer where Python is already installed.
44
47
  In order to work with the latest version from github, use ``pip install git+https://github.com/FZJ-INM1-BDA/siibra-python.git@main``.
45
48
 
46
- There is also an image based on jupyter:scipy-notebook, which already includes ``siibra``.
47
-
49
+ ``siibra-python`` should be installable on recent versions of Windows, Linux and Mac OS in a recent Python 3 environment.
50
+ We run continuous integration tests for versions 3.7 - 3.12 on recent Ubuntu images.
51
+
52
+ The library requires a couple of open source packages, namely:
53
+ ```
54
+ anytree >= 2.12.1
55
+ nibabel >= 5.3.2
56
+ appdirs >= 1.4.4
57
+ scikit-image >= 0.25.0
58
+ requests >= 2.32.3
59
+ neuroglancer-scripts >= 1.2.0
60
+ nilearn >= 0.11.0
61
+ filelock >= 3.16.1
62
+ ebrains-drive >= 0.6.0
63
+ ```
64
+
65
+ You can also install a docker image with all dependencies included:
48
66
  .. code-block:: sh
49
67
 
50
68
  docker run -dit \
@@ -54,19 +72,20 @@ There is also an image based on jupyter:scipy-notebook, which already includes `
54
72
  docker-registry.ebrains.eu/siibra/siibra-python:latest
55
73
 
56
74
 
75
+
57
76
  Documentation & Help
58
77
  ====================
59
78
 
60
79
  ``siibra-python``\ ’s documentation is hosted on https://siibra-python.readthedocs.io.
61
80
  The documentation includes a catalogue of documented code examples that walk you through the different concepts and functionalities.
81
+ These examples use real data and include both the code and the produced expected outputs.
82
+ They can be accessed at https://siibra-python.readthedocs.io/en/latest/examples.html, and are
83
+ automatically tested and updated whenever a new version of ``siibra-python`` is published.
62
84
  As a new user, it is recommended to go through these examples - they are easy and will quickly provide you with the right code snippets that get you started.
63
- Furthermore, a set of jupyter notebooks demonstrating more extensive example use cases are maintained in the `siibra-tutorials <https://github.com/FZJ-INM1-BDA/siibra-tutorials>`__ repository.
64
- We are working on a full API documentation of the library. You find the current status on readthedocs, but be aware that it is not yet complete and as up-to-date as the code examples.
85
+ The documentation on readthedocs further includes introductory explanations and an API reference.
65
86
 
66
87
  If you run into issues, please open a ticket on `EBRAINS support <https://ebrains.eu/support/>`__ or file bugs and
67
88
  feature requests on `github <https://github.com/FZJ-INM1-BDA/siibra-python/issues>`__.
68
- Please keep in mind that ``siibra-python`` is still in development.
69
- While care is taken to make everything work reliably, the API of the library is not yet stable, and the software is not yet fully tested.
70
89
 
71
90
  .. getting-started-end
72
91
 
@@ -0,0 +1 @@
1
+ 1.0.1-alpha.5
@@ -13,35 +13,29 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
 
16
+ import os as _os
17
+
16
18
  from .commons import (
17
19
  logger,
18
20
  QUIET,
19
21
  VERBOSE,
20
22
  MapType,
21
- MapIndex,
22
23
  set_log_level,
23
24
  __version__
24
25
  )
25
-
26
+ from . import configuration, features, livequeries
27
+ from .configuration import factory
26
28
  from .core import (
27
29
  atlas as _atlas,
28
30
  parcellation as _parcellation,
29
31
  space as _space
30
32
  )
31
33
  from .volumes import parcellationmap as _parcellationmap
32
- from .retrieval.requests import (
33
- EbrainsRequest as _EbrainsRequest,
34
- CACHE as cache
35
- )
34
+ from .retrieval.requests import CACHE as cache
36
35
  from .retrieval.cache import Warmup, WarmupLevel
36
+ from .locations import Point, PointCloud, Plane, BoundingBox
37
37
 
38
- from . import configuration
39
- from . import experimental
40
- from .configuration import factory
41
- from . import features, livequeries
42
- from siibra.locations import Point, PointCloud
43
38
 
44
- import os as _os
45
39
  logger.info(f"Version: {__version__}")
46
40
  logger.warning("This is a development release. Use at your own risk.")
47
41
  logger.info(
@@ -49,8 +43,6 @@ logger.info(
49
43
  )
50
44
 
51
45
  # forward access to some functions
52
- set_ebrains_token = _EbrainsRequest.set_token
53
- fetch_ebrains_token = _EbrainsRequest.fetch_token
54
46
  find_regions = _parcellation.find_regions
55
47
  from_json = factory.Factory.from_json
56
48
 
@@ -151,10 +143,9 @@ def __dir__():
151
143
  "MapType",
152
144
  "Point",
153
145
  "PointCloud",
146
+ "BoundingBox",
154
147
  "QUIET",
155
148
  "VERBOSE",
156
- "fetch_ebrains_token",
157
- "set_ebrains_token",
158
149
  "vocabularies",
159
150
  "__version__",
160
151
  "cache",
@@ -17,24 +17,26 @@
17
17
  import os
18
18
  import re
19
19
  from enum import Enum
20
- from nibabel import Nifti1Image
21
- from nilearn.image import resample_to_img
22
20
  import logging
23
- from tqdm import tqdm
24
- import numpy as np
25
- import pandas as pd
26
- from typing import Generic, Iterable, Iterator, List, TypeVar, Union, Dict, Generator, Tuple
27
- from skimage.filters import gaussian
28
21
  from dataclasses import dataclass
29
22
  from hashlib import md5
30
23
  from uuid import UUID
31
24
  import math
25
+ from typing import Generic, Iterable, Iterator, List, TypeVar, Union, Dict, Generator, Tuple
32
26
  try:
33
27
  from typing import TypedDict
34
28
  except ImportError:
35
29
  # support python 3.7
36
30
  from typing_extensions import TypedDict
37
31
 
32
+ from tqdm import tqdm
33
+ import numpy as np
34
+ import pandas as pd
35
+ from nibabel import Nifti1Image
36
+ from nilearn.image import resample_to_img
37
+ from skimage.filters import gaussian
38
+
39
+
38
40
  logging.addLevelName(21, "INFO_WO_PROGRESS_BARS")
39
41
  logger = logging.getLogger(__name__.split(os.path.extsep)[0])
40
42
  ch = logging.StreamHandler()
@@ -532,13 +534,21 @@ def resample_img_to_img(
532
534
  -------
533
535
  Nifti1Image
534
536
  """
537
+ from nilearn._version import version as nilearn_version
538
+ from packaging.version import Version
539
+
535
540
  interpolation = "nearest" if np.array_equal(np.unique(source_img.dataobj), [0, 1]) else "linear"
536
- resampled_img = resample_to_img(
541
+ kwargs = dict(
537
542
  source_img=source_img,
538
543
  target_img=target_img,
539
544
  interpolation=interpolation,
540
545
  force_resample=True, # False is intended for testing. see nilearn docs
541
546
  )
547
+ if Version(nilearn_version) >= Version("0.11.0"):
548
+ # because nilearn>=0.11.0 don't support "copy_header" and python <= 3.8
549
+ kwargs["copy_header"] = True # use new default in nilearn >= 0.11.0
550
+
551
+ resampled_img = resample_to_img(**kwargs)
542
552
  return resampled_img
543
553
 
544
554
 
@@ -723,6 +733,7 @@ class Species(Enum):
723
733
  MACACA_MULATTA = 5
724
734
  MACACA_FUSCATA = 6
725
735
  CHLOROCEBUS_AETHIOPS_SABAEUS = 7
736
+ CALLITHRIX_JACCHUS = 8
726
737
 
727
738
  UNSPECIFIED_SPECIES = 999
728
739
 
@@ -13,16 +13,16 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
 
16
- from ..commons import logger, __version__, SIIBRA_USE_CONFIGURATION, siibra_tqdm
17
- from ..retrieval.repositories import GitlabConnector, RepositoryConnector, GithubConnector
18
- from ..retrieval.exceptions import NoSiibraConfigMirrorsAvailableException
19
- from ..retrieval.requests import SiibraHttpRequestError
20
-
21
16
  from typing import Union, List
22
17
  from collections import defaultdict
23
18
  from requests.exceptions import ConnectionError
24
19
  from os import path
25
20
 
21
+ from ..commons import logger, __version__, SIIBRA_USE_CONFIGURATION, siibra_tqdm
22
+ from ..retrieval.repositories import GitlabConnector, RepositoryConnector, GithubConnector
23
+ from ..retrieval.exceptions import NoSiibraConfigMirrorsAvailableException
24
+ from ..retrieval.requests import SiibraHttpRequestError
25
+
26
26
 
27
27
  class Configuration:
28
28
  """
@@ -185,5 +185,4 @@ class Configuration:
185
185
 
186
186
 
187
187
  if SIIBRA_USE_CONFIGURATION:
188
- logger.warning(f"config.SIIBRA_USE_CONFIGURATION defined, use configuration at {SIIBRA_USE_CONFIGURATION}")
189
188
  Configuration.use_configuration(SIIBRA_USE_CONFIGURATION)
@@ -13,6 +13,15 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
 
16
+ from os import path
17
+ import json
18
+ from typing import List, Dict, Callable
19
+ from io import BytesIO
20
+ from functools import wraps
21
+
22
+ import numpy as np
23
+ import pandas as pd
24
+
16
25
  from ..commons import logger, Species
17
26
  from ..features import anchor, connectivity
18
27
  from ..features.tabular import (
@@ -29,14 +38,6 @@ from ..retrieval import datasets, repositories
29
38
  from ..volumes import volume, sparsemap, parcellationmap
30
39
  from ..volumes.providers.provider import VolumeProvider
31
40
 
32
- from os import path
33
- import json
34
- import numpy as np
35
- from typing import List, Dict, Callable
36
- import pandas as pd
37
- from io import BytesIO
38
- from functools import wraps
39
-
40
41
 
41
42
  _registered_build_fns: Dict[str, Callable] = {}
42
43
 
@@ -486,6 +487,10 @@ class Factory:
486
487
  return volume_of_interest.LSFMVolumeOfInterest(
487
488
  modality="Light Sheet Fluorescence Microscopy", **kwargs
488
489
  )
490
+ elif modality == "morphometry":
491
+ return volume_of_interest.MorphometryVolumeOfInterest(
492
+ modality="Morphometry", **kwargs
493
+ )
489
494
  else:
490
495
  raise ValueError(
491
496
  f"No method for building image section feature type {modality}."
@@ -12,5 +12,5 @@
12
12
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
- """:ref:`Main siibra concepts<mainconcepts>`"""
15
+ """Core concepts behind siibra, :ref:`see glossary <glossary>` for details."""
16
16
  from . import atlas, parcellation, space
@@ -17,6 +17,7 @@
17
17
  from enum import Enum
18
18
  from dataclasses import dataclass
19
19
  from typing import Dict, Generic, TypeVar, TYPE_CHECKING
20
+
20
21
  if TYPE_CHECKING:
21
22
  from .structure import BrainStructure
22
23
 
@@ -25,12 +26,12 @@ T = TypeVar("T")
25
26
 
26
27
  class Qualification(Enum):
27
28
  EXACT = 1
28
- OVERLAPS = 2
29
- CONTAINED = 3
30
- CONTAINS = 4
31
- APPROXIMATE = 5
32
- HOMOLOGOUS = 6
33
- OTHER_VERSION = 7
29
+ APPROXIMATE = 2
30
+ OTHER_VERSION = 3
31
+ CONTAINED = 4
32
+ CONTAINS = 5
33
+ OVERLAPS = 6
34
+ HOMOLOGOUS = 7
34
35
 
35
36
  @property
36
37
  def verb(self):
@@ -66,6 +67,17 @@ class Qualification(Enum):
66
67
  assert self in inverses, f"{str(self)} inverses cannot be found."
67
68
  return inverses[self]
68
69
 
70
+ def __lt__(self, other: "Qualification"):
71
+ """
72
+ This is used to sort feature query results. Since it is very difficult
73
+ to determine a well-ordering principle and it is difficult to sort
74
+ without one, the enum values are used for sorting. This means
75
+ not all comparisons have logical basis but they are well-defined,
76
+ making it reproducible but also clearly distinguishes important
77
+ comparisons.
78
+ """
79
+ return self.value < other.value
80
+
69
81
  def __str__(self):
70
82
  return f"{self.__class__.__name__}={self.name.lower()}"
71
83
 
@@ -107,4 +119,4 @@ class AnatomicalAssignment(Generic[T]):
107
119
  def __lt__(self, other: 'AnatomicalAssignment'):
108
120
  if not isinstance(other, AnatomicalAssignment):
109
121
  raise ValueError(f"Cannot compare AnatomicalAssignment with instances of '{type(other)}'")
110
- return self.qualification.value < other.qualification.value
122
+ return self.qualification < other.qualification
@@ -13,6 +13,10 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
  """Parent class to siibra main concepts."""
16
+
17
+ import re
18
+ from typing import TypeVar, Type, Union, List, TYPE_CHECKING, Dict
19
+
16
20
  from ..commons import (
17
21
  create_key,
18
22
  clear_name,
@@ -23,8 +27,6 @@ from ..commons import (
23
27
  )
24
28
  from ..retrieval import cache
25
29
 
26
- import re
27
- from typing import TypeVar, Type, Union, List, TYPE_CHECKING, Dict
28
30
 
29
31
  T = TypeVar("T", bound="AtlasConcept")
30
32
  _REGISTRIES: Dict[Type[T], InstanceTable[T]] = {}
@@ -14,9 +14,18 @@
14
14
  # limitations under the License.
15
15
  """Representation of a brain region."""
16
16
 
17
- from . import concept, structure, space as _space, parcellation as _parcellation
18
- from .assignment import Qualification, AnatomicalAssignment
17
+ import re
18
+ from typing import List, Union, Iterable, Dict, Callable, Tuple, Set
19
+ from difflib import SequenceMatcher
20
+ import json
21
+ from functools import wraps, reduce
22
+ from concurrent.futures import ThreadPoolExecutor
23
+ from functools import lru_cache
24
+
25
+ import anytree
26
+ from ebrains_drive import BucketApiClient
19
27
 
28
+ from . import concept, structure, space as _space, parcellation as _parcellation, assignment
20
29
  from ..retrieval.cache import cache_user_fn
21
30
  from ..locations import location, pointcloud, boundingbox as _boundingbox
22
31
  from ..volumes import parcellationmap, volume
@@ -29,16 +38,6 @@ from ..commons import (
29
38
  )
30
39
  from ..exceptions import NoMapAvailableError, SpaceWarpingFailedError
31
40
 
32
- import re
33
- import anytree
34
- from typing import List, Union, Iterable, Dict, Callable, Tuple, Set
35
- from difflib import SequenceMatcher
36
- from ebrains_drive import BucketApiClient
37
- import json
38
- from functools import wraps, reduce
39
- from concurrent.futures import ThreadPoolExecutor
40
- from functools import lru_cache
41
-
42
41
 
43
42
  REGEX_TYPE = type(re.compile("test"))
44
43
 
@@ -128,7 +127,7 @@ class Region(anytree.NodeMixin, concept.AtlasConcept, structure.BrainStructure):
128
127
 
129
128
  Yields
130
129
  ------
131
- Qualification
130
+ assignment.Qualification
132
131
 
133
132
  Example
134
133
  -------
@@ -595,7 +594,7 @@ class Region(anytree.NodeMixin, concept.AtlasConcept, structure.BrainStructure):
595
594
  except NoMapAvailableError:
596
595
  return False
597
596
 
598
- def assign(self, other: structure.BrainStructure) -> AnatomicalAssignment:
597
+ def assign(self, other: structure.BrainStructure) -> assignment.AnatomicalAssignment:
599
598
  """
600
599
  Compute assignment of a location to this region.
601
600
 
@@ -609,8 +608,8 @@ class Region(anytree.NodeMixin, concept.AtlasConcept, structure.BrainStructure):
609
608
 
610
609
  Returns
611
610
  -------
612
- AnatomicalAssignment or None
613
- None if there is no Qualification found.
611
+ assignment.AnatomicalAssignment or None
612
+ None if there is no assignment.Qualification found.
614
613
  """
615
614
  if (self, other) in self._ASSIGNMENT_CACHE:
616
615
  return self._ASSIGNMENT_CACHE[self, other]
@@ -659,17 +658,17 @@ class Region(anytree.NodeMixin, concept.AtlasConcept, structure.BrainStructure):
659
658
  else: # other is a Region
660
659
  assert isinstance(other, Region)
661
660
  if self == other:
662
- qualification = Qualification.EXACT
661
+ qualification = assignment.Qualification.EXACT
663
662
  elif self.__contains__(other):
664
- qualification = Qualification.CONTAINS
663
+ qualification = assignment.Qualification.CONTAINS
665
664
  elif other.__contains__(self):
666
- qualification = Qualification.CONTAINED
665
+ qualification = assignment.Qualification.CONTAINED
667
666
  else:
668
667
  qualification = None
669
668
  if qualification is None:
670
669
  self._ASSIGNMENT_CACHE[self, other] = None
671
670
  else:
672
- self._ASSIGNMENT_CACHE[self, other] = AnatomicalAssignment(self, other, qualification)
671
+ self._ASSIGNMENT_CACHE[self, other] = assignment.AnatomicalAssignment(self, other, qualification)
673
672
  return self._ASSIGNMENT_CACHE[self, other]
674
673
 
675
674
  def tree2str(self):
@@ -926,7 +925,7 @@ def get_related_regions(region: Region) -> Iterable["RegionRelationAssessments"]
926
925
 
927
926
  Yields
928
927
  ------
929
- Qualification
928
+ assignment.Qualification
930
929
 
931
930
  Example
932
931
  -------
@@ -968,7 +967,7 @@ def _register_region_reference_type(ebrain_type: str):
968
967
  return outer
969
968
 
970
969
 
971
- class RegionRelationAssessments(AnatomicalAssignment[Region]):
970
+ class RegionRelationAssessments(assignment.AnatomicalAssignment[Region]):
972
971
  """
973
972
  A collection of methods on finding related regions and the quantification
974
973
  of the relationship.
@@ -1110,7 +1109,7 @@ class RegionRelationAssessments(AnatomicalAssignment[Region]):
1110
1109
  yield cls(
1111
1110
  query_structure=src,
1112
1111
  assigned_structure=found_target,
1113
- qualification=Qualification.parse_relation_assessment(overlap)
1112
+ qualification=assignment.Qualification.parse_relation_assessment(overlap)
1114
1113
  )
1115
1114
 
1116
1115
  if "https://openminds.ebrains.eu/sands/ParcellationEntity" in target.get("type"):
@@ -1124,7 +1123,7 @@ class RegionRelationAssessments(AnatomicalAssignment[Region]):
1124
1123
  yield cls(
1125
1124
  query_structure=src,
1126
1125
  assigned_structure=reg,
1127
- qualification=Qualification.parse_relation_assessment(overlap)
1126
+ qualification=assignment.Qualification.parse_relation_assessment(overlap)
1128
1127
  )
1129
1128
 
1130
1129
  @classmethod
@@ -1178,7 +1177,7 @@ class RegionRelationAssessments(AnatomicalAssignment[Region]):
1178
1177
  yield cls(
1179
1178
  query_structure=src,
1180
1179
  assigned_structure=region,
1181
- qualification=Qualification.OTHER_VERSION
1180
+ qualification=assignment.Qualification.OTHER_VERSION
1182
1181
  )
1183
1182
 
1184
1183
  # homologuous
@@ -14,18 +14,16 @@
14
14
  # limitations under the License.
15
15
  """A particular brain reference space."""
16
16
 
17
+ from typing import List, TYPE_CHECKING, Union
17
18
 
18
- from .concept import AtlasConcept
19
-
19
+ from . import concept
20
20
  from ..commons import logger, Species
21
21
 
22
- from typing import List, TYPE_CHECKING, Union
23
-
24
22
  if TYPE_CHECKING:
25
23
  from ..volumes import volume
26
24
 
27
25
 
28
- class Space(AtlasConcept, configuration_folder="spaces"):
26
+ class Space(concept.AtlasConcept, configuration_folder="spaces"):
29
27
 
30
28
  def __init__(
31
29
  self,
@@ -66,7 +64,7 @@ class Space(AtlasConcept, configuration_folder="spaces"):
66
64
  Key: EBRAINS KG schema, value: EBRAINS KG @id
67
65
  """
68
66
 
69
- AtlasConcept.__init__(
67
+ concept.AtlasConcept.__init__(
70
68
  self,
71
69
  identifier=identifier,
72
70
  name=name,