radiobject 0.1.0__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.
- radiobject/__init__.py +24 -0
- radiobject/_types.py +19 -0
- radiobject/ctx.py +359 -0
- radiobject/dataframe.py +186 -0
- radiobject/imaging_metadata.py +387 -0
- radiobject/indexing.py +45 -0
- radiobject/ingest.py +132 -0
- radiobject/ml/__init__.py +26 -0
- radiobject/ml/cache.py +53 -0
- radiobject/ml/compat/__init__.py +33 -0
- radiobject/ml/compat/torchio.py +99 -0
- radiobject/ml/config.py +42 -0
- radiobject/ml/datasets/__init__.py +12 -0
- radiobject/ml/datasets/collection_dataset.py +198 -0
- radiobject/ml/datasets/multimodal.py +129 -0
- radiobject/ml/datasets/patch_dataset.py +158 -0
- radiobject/ml/datasets/segmentation_dataset.py +219 -0
- radiobject/ml/datasets/volume_dataset.py +233 -0
- radiobject/ml/distributed.py +82 -0
- radiobject/ml/factory.py +249 -0
- radiobject/ml/utils/__init__.py +13 -0
- radiobject/ml/utils/labels.py +106 -0
- radiobject/ml/utils/validation.py +85 -0
- radiobject/ml/utils/worker_init.py +10 -0
- radiobject/orientation.py +270 -0
- radiobject/parallel.py +65 -0
- radiobject/py.typed +0 -0
- radiobject/query.py +788 -0
- radiobject/radi_object.py +1665 -0
- radiobject/streaming.py +389 -0
- radiobject/utils.py +17 -0
- radiobject/volume.py +438 -0
- radiobject/volume_collection.py +1182 -0
- radiobject-0.1.0.dist-info/METADATA +139 -0
- radiobject-0.1.0.dist-info/RECORD +37 -0
- radiobject-0.1.0.dist-info/WHEEL +4 -0
- radiobject-0.1.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: radiobject
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: TileDB-backed data structure for radiology data at scale
|
|
5
|
+
Project-URL: Repository, https://github.com/samueldsouza/radiobject
|
|
6
|
+
Author: Samuel D'Souza
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Keywords: dicom,machine-learning,medical-imaging,nifti,radiology,tiledb
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Science/Research
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
|
|
18
|
+
Requires-Python: >=3.11
|
|
19
|
+
Requires-Dist: boto3>=1.34.0
|
|
20
|
+
Requires-Dist: botocore[crt]>=1.42.36
|
|
21
|
+
Requires-Dist: matplotlib>=3.8.0
|
|
22
|
+
Requires-Dist: nibabel>=5.2.0
|
|
23
|
+
Requires-Dist: numpy>=1.26.0
|
|
24
|
+
Requires-Dist: psutil>=5.9.0
|
|
25
|
+
Requires-Dist: pydantic>=2.0.0
|
|
26
|
+
Requires-Dist: pydicom>=2.4.0
|
|
27
|
+
Requires-Dist: tiledb>=0.36.0
|
|
28
|
+
Requires-Dist: tqdm>=4.66.0
|
|
29
|
+
Provides-Extra: dev
|
|
30
|
+
Requires-Dist: jupyter>=1.1.1; extra == 'dev'
|
|
31
|
+
Requires-Dist: nbconvert>=7.16.6; extra == 'dev'
|
|
32
|
+
Requires-Dist: pandas>=2.0.0; extra == 'dev'
|
|
33
|
+
Requires-Dist: pre-commit>=3.0.0; extra == 'dev'
|
|
34
|
+
Requires-Dist: pytest>=8.0.0; extra == 'dev'
|
|
35
|
+
Requires-Dist: ruff>=0.1.0; extra == 'dev'
|
|
36
|
+
Provides-Extra: docs
|
|
37
|
+
Requires-Dist: mkdocs-material>=9.5.0; extra == 'docs'
|
|
38
|
+
Requires-Dist: mkdocs>=1.5.0; extra == 'docs'
|
|
39
|
+
Requires-Dist: mkdocstrings[python]>=0.24.0; extra == 'docs'
|
|
40
|
+
Requires-Dist: pandas>=2.0.0; extra == 'docs'
|
|
41
|
+
Provides-Extra: download
|
|
42
|
+
Requires-Dist: requests>=2.31.0; extra == 'download'
|
|
43
|
+
Requires-Dist: tcia-utils>=0.5.0; extra == 'download'
|
|
44
|
+
Provides-Extra: ml
|
|
45
|
+
Requires-Dist: monai>=1.3.0; extra == 'ml'
|
|
46
|
+
Requires-Dist: pandas>=2.0.0; extra == 'ml'
|
|
47
|
+
Requires-Dist: scikit-learn>=1.3.0; extra == 'ml'
|
|
48
|
+
Requires-Dist: simpleitk>=2.3.0; extra == 'ml'
|
|
49
|
+
Requires-Dist: tcia-utils>=0.5.0; extra == 'ml'
|
|
50
|
+
Requires-Dist: torch>=2.0.0; extra == 'ml'
|
|
51
|
+
Requires-Dist: torchio>=0.19.0; extra == 'ml'
|
|
52
|
+
Provides-Extra: monai
|
|
53
|
+
Requires-Dist: monai>=1.3.0; extra == 'monai'
|
|
54
|
+
Requires-Dist: torch>=2.0.0; extra == 'monai'
|
|
55
|
+
Provides-Extra: torchio
|
|
56
|
+
Requires-Dist: torch>=2.0.0; extra == 'torchio'
|
|
57
|
+
Requires-Dist: torchio>=0.19.0; extra == 'torchio'
|
|
58
|
+
Provides-Extra: tutorials
|
|
59
|
+
Requires-Dist: jupyter>=1.1.1; extra == 'tutorials'
|
|
60
|
+
Requires-Dist: requests>=2.31.0; extra == 'tutorials'
|
|
61
|
+
Requires-Dist: tcia-utils>=0.5.0; extra == 'tutorials'
|
|
62
|
+
Description-Content-Type: text/markdown
|
|
63
|
+
|
|
64
|
+
# RadiObject
|
|
65
|
+
|
|
66
|
+
**What?** A TileDB-backed data structure for radiology data at scale.
|
|
67
|
+
|
|
68
|
+
**Why?** NIfTI/DICOM must be read from local disk and don't support partial reads.
|
|
69
|
+
TileDB enables cloud-native storage (S3), efficient partial reads, and
|
|
70
|
+
hierarchical organization of multi-volume datasets.
|
|
71
|
+
|
|
72
|
+
*[Thoughts](https://souzy.up.railway.app/thoughts/radiology-object)*
|
|
73
|
+
|
|
74
|
+
## Installation
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
pip install radiobject
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Quick Start
|
|
81
|
+
|
|
82
|
+
```python
|
|
83
|
+
from radiobject import RadiObject
|
|
84
|
+
|
|
85
|
+
# Create from NIfTI files using images dict (recommended)
|
|
86
|
+
radi = RadiObject.from_niftis(
|
|
87
|
+
uri="./my-dataset",
|
|
88
|
+
images={
|
|
89
|
+
"CT": "./imagesTr/*.nii.gz", # Glob pattern
|
|
90
|
+
"seg": "./labelsTr", # Directory path
|
|
91
|
+
},
|
|
92
|
+
validate_alignment=True, # Ensure matching subjects across collections
|
|
93
|
+
obs_meta=metadata_df, # Optional subject-level metadata
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
# Access data (pandas-like)
|
|
97
|
+
vol = radi.CT.iloc[0] # First CT volume
|
|
98
|
+
data = vol[100:200, :, :] # Partial read (only loads needed tiles)
|
|
99
|
+
|
|
100
|
+
# Filtering (returns views)
|
|
101
|
+
subset = radi.filter("age > 40") # Query expression
|
|
102
|
+
subset = radi.head(10) # First 10 subjects
|
|
103
|
+
subset.materialize("./subset") # Write to storage
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Works with local paths or S3 URIs (`s3://bucket/dataset`).
|
|
107
|
+
|
|
108
|
+
## How It Works
|
|
109
|
+
|
|
110
|
+
NIfTI requires decompressing entire volumes; TileDB reads only the tiles needed.
|
|
111
|
+
This enables **200-660x faster** partial reads. [See benchmarks →](docs/BENCHMARKS.md)
|
|
112
|
+
|
|
113
|
+
## Sample Data
|
|
114
|
+
|
|
115
|
+
Download sample datasets for tutorials and testing:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
# Install download dependencies
|
|
119
|
+
pip install radiobject[download]
|
|
120
|
+
|
|
121
|
+
# Download BraTS brain tumor data (for tutorials 00-04)
|
|
122
|
+
python scripts/download_dataset.py msd-brain-tumour
|
|
123
|
+
|
|
124
|
+
# List all available datasets
|
|
125
|
+
python scripts/download_dataset.py --list
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Documentation
|
|
129
|
+
|
|
130
|
+
- **[Tutorials](notebooks/README.md)** - Interactive notebooks
|
|
131
|
+
- **[Data Access](docs/DATA_ACCESS.md)** - Ingestion, queries, filtering
|
|
132
|
+
- **[ML Integration](docs/ML_INTEGRATION.md)** - MONAI/TorchIO setup
|
|
133
|
+
- **[Design](docs/DESIGN.md)** - Architecture decisions
|
|
134
|
+
- **[Benchmarks](docs/BENCHMARKS.md)** - Performance analysis
|
|
135
|
+
- **[Datasets](docs/DATASETS.md)** - Available datasets and download instructions
|
|
136
|
+
|
|
137
|
+
## License
|
|
138
|
+
|
|
139
|
+
MIT
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
radiobject/__init__.py,sha256=lT5WwY92jM6Z3CCSrH92Eb6utAto1hS2sS4gtlfhcvg,655
|
|
2
|
+
radiobject/_types.py,sha256=EZVH-dHZOe98biqdyWcJYkIN7TxpeoI3VEa_vnGgrPU,567
|
|
3
|
+
radiobject/ctx.py,sha256=3vPNCQsWPyKZbJSQ3UqNlpsYq1o_1W9y1GNj3-Uft1M,12198
|
|
4
|
+
radiobject/dataframe.py,sha256=QnScrKApnXvJClZzHN7iZTyAn0jKxaqDE0tw-Tf8eq0,6897
|
|
5
|
+
radiobject/imaging_metadata.py,sha256=t4FdD3p8oJrvcCALz-BQvN7ZJNZ2BmdeRmvvbbjr0Nk,11909
|
|
6
|
+
radiobject/indexing.py,sha256=5RF0b5j_zQE6NdQczfx9wVGNZdpUMG7XdiCLmk43aIQ,1451
|
|
7
|
+
radiobject/ingest.py,sha256=JgeGU-by5_qAiGgeP_JilWzgwLMn0eyHtISkdqOpRJM,4126
|
|
8
|
+
radiobject/orientation.py,sha256=SFLoindOBBU65hIG2hel7Dba0X3Foq6OaMg_OoA-GkM,9308
|
|
9
|
+
radiobject/parallel.py,sha256=q8RsU_LEr28djSMY4QD-ZXComCoO62nO0hlExgbyc1Y,1797
|
|
10
|
+
radiobject/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
+
radiobject/query.py,sha256=s1tYYvu-geRlgcOL3VnTKLPnsjq3DUnMoxztTVHKx4M,31312
|
|
12
|
+
radiobject/radi_object.py,sha256=ilgeAbv8gPkYBmaJi5YXoDiOz6Q78TTOg-_TN4alN4A,65017
|
|
13
|
+
radiobject/streaming.py,sha256=0lZgm3r_h8xj8s9w7myHUnO0CFSUrGQ1YQgRT0o6HvI,13623
|
|
14
|
+
radiobject/utils.py,sha256=0KgPOYLQgnUqM8Ac8j8Qw8n68E5jQY1LQma5OHXmUjE,452
|
|
15
|
+
radiobject/volume.py,sha256=xVE0arLPi3UQTdpbYxTo9ofvIvkBSacX-mHBcRAfYwY,15970
|
|
16
|
+
radiobject/volume_collection.py,sha256=apZ39z3UWqiL8EwUPJziZM3U9rLQuaJfhP1GWMXi_wo,46321
|
|
17
|
+
radiobject/ml/__init__.py,sha256=fB_yobxqBslIbtxSrKNosY_MQx8Np-6AW-cLESatwzM,807
|
|
18
|
+
radiobject/ml/cache.py,sha256=G6SFlCuYp3fEWtwxgg4lwo7QYLktK6o92mi6qhvtrwo,1135
|
|
19
|
+
radiobject/ml/config.py,sha256=2JPLTR4COzwnDpiKf99ywCh2FA1Vg6aLRY4V51ohyWQ,1267
|
|
20
|
+
radiobject/ml/distributed.py,sha256=9q9hNMP1k0oy6_XaQa2HJ8mdIfFrruvwebygHdHbswI,2699
|
|
21
|
+
radiobject/ml/factory.py,sha256=yr9-2KRi3K-4bErda9yWL8-xQ5ALus3VsUUT9wae_RI,9249
|
|
22
|
+
radiobject/ml/compat/__init__.py,sha256=3INe8wl2dTUWyFryjbeOeehREF_dyVhdcwVe5tTsDPo,956
|
|
23
|
+
radiobject/ml/compat/torchio.py,sha256=YVjJJoK-UVfdzdKNIo_UCQmOGieU3gUTcuwXH-E1ygg,3343
|
|
24
|
+
radiobject/ml/datasets/__init__.py,sha256=MkcGSVYdXiPy5P5zDvP1b4E6Hh3kXQIVBkh9eGhVbwA,418
|
|
25
|
+
radiobject/ml/datasets/collection_dataset.py,sha256=Xn69zCvpQVW2wElEshG6kJy3jRso7DGn9ualOxhCPZw,7302
|
|
26
|
+
radiobject/ml/datasets/multimodal.py,sha256=upKZZn3lphTCffaCuzoNcrRPXoMWOih4dGPwLzrNJZA,4293
|
|
27
|
+
radiobject/ml/datasets/patch_dataset.py,sha256=3L4zH9VSS4HLkD0Sbv_uIdHGa_e3amovFKGrPr415f0,5404
|
|
28
|
+
radiobject/ml/datasets/segmentation_dataset.py,sha256=mXIukHNaHCoQg-Scvy65gqbq8Ams6GPXnaVQJuq1Vyk,8546
|
|
29
|
+
radiobject/ml/datasets/volume_dataset.py,sha256=FriJbcPlYSYK1exH60D-U8gBhk98MIbHuScXtV-Z_Ds,8503
|
|
30
|
+
radiobject/ml/utils/__init__.py,sha256=eh8NXj00jBVrCIXjCSvM7TeaWpcStAXk-AspcB_HoOQ,385
|
|
31
|
+
radiobject/ml/utils/labels.py,sha256=NOprMYexICdLu5yiOiYMfUawq53s8wpBPOx93WaKcuY,3591
|
|
32
|
+
radiobject/ml/utils/validation.py,sha256=KtwHY8hsYaLWkS-_84mXA0eS4x9b01ykpKCspLuh5pk,2760
|
|
33
|
+
radiobject/ml/utils/worker_init.py,sha256=ZZNd68m_Z3yIUxkNWsJYPEbNPNTaoFgH6xxdHuqelfA,285
|
|
34
|
+
radiobject-0.1.0.dist-info/METADATA,sha256=D6mmYYORr7_nin3bHI1IgDsHh4Gkmy6HGAKBvSmjdAI,4808
|
|
35
|
+
radiobject-0.1.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
36
|
+
radiobject-0.1.0.dist-info/licenses/LICENSE,sha256=4M92OGqVJ7ben6C2MQ2NEhy7TRsPrN0hGbE75-g8YwQ,1071
|
|
37
|
+
radiobject-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Samuel D'Souza
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|