Efficiently index large-scale BIDS datasets and derivatives
Project description
bids2table
bids2table is a library for efficiently indexing and querying large-scale BIDS neuroimaging datasets and derivatives. It aims to improve upon the efficiency of PyBIDS by leveraging modern data science tools.
bids2table represents a BIDS dataset index as a single table with columns for BIDS entities and file metadata. The index is constructed using Arrow and stored in Parquet format, a binary tabular file format optimized for efficient storage and retrieval.
Installation
A pre-release version of bids2table can be installed with
pip install bids2table
The latest development version can be installed with
pip install git+https://github.com/childmindresearch/bids2table.git
Documentation
Our documentation is here.
Example
import pandas as pd
from bids2table import bids2table
# Load in memory as pandas dataframe
df = bids2table("/path/to/dataset")
# Load in parallel and stream to disk as a Parquet dataset
df = bids2table("/path/to/dataset", persistent=True, workers=8)
See here for a more complete example.
Performance
bids2table significantly outperforms both PyBIDS and ancpBIDS in terms of indexing run time, index size on disk, and query run time.
Indexing performance
Indexing run time and index size on disk for the NKI Rockland Sample dataset. See the indexing benchmark for more details.
Index | Num workers | Run time (s) | Index size (MB) |
---|---|---|---|
PyBIDS | 1 | 1618 | 448 |
ancpBIDS | 1 | 465 | -- |
bids2table | 1 | 402 | 4.02 |
bids2table | 8 | 53.2 | 3.84 |
bids2table | 64 | 10.7 | 4.82 |
Query performance
Query run times for the Chinese Color Nest Project dataset. See the query benchmark for more details.
Index | Get subjects (ms) | Get BOLD (ms) | Query metadata (ms) | Get morning scans (ms) |
---|---|---|---|---|
PyBIDS | 1350 | 12.3 | 6.53 | 34.3 |
ancpBIDS | 30.6 | 19.2 | -- | -- |
bids2table | 0.046 | 0.346 | 0.312 | 0.352 |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file bids2table-0.1.0.tar.gz
.
File metadata
- Download URL: bids2table-0.1.0.tar.gz
- Upload date:
- Size: 180.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | acd5f0d8b8fbf9adbdaeccce778ec4cbbf35f074239da9ebc18300548ee4b451 |
|
MD5 | be078b7ee01085f424e2069adab6df9f |
|
BLAKE2b-256 | 102c47170d41d799a8617fa2f5b5ad89e9dfc65cb28d6407cba043322847ecff |
File details
Details for the file bids2table-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: bids2table-0.1.0-py3-none-any.whl
- Upload date:
- Size: 23.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e31ac99735773642016c1576cfe24158a74d284af9495af275db8b837e7322fe |
|
MD5 | 399208fa376bb7e1de7f0b0795743f1a |
|
BLAKE2b-256 | 87d3ee9487bb6d3d829585f86e8908032f12e74921306c27688a462d9da4dc75 |