|
1 | 1 | # bids2table |
| 2 | + |
2 | 3 | [](https://github.com/childmindresearch/bids2table/actions/workflows/ci.yaml?query=branch%3Amain) |
3 | 4 | [](https://childmindresearch.github.io/bids2table/bids2table) |
4 | 5 | [](https://codecov.io/gh/childmindresearch/bids2table) |
@@ -100,7 +101,6 @@ As an example, here we index all datasets on [OpenNeuro](https://openneuro.org/) |
100 | 101 |
|
101 | 102 | Using 8 threads, we can index all ~1400 OpenNeuro datasets (1.2M files) in less than 15 minutes. |
102 | 103 |
|
103 | | - |
104 | 104 | ### Indexing datasets from python |
105 | 105 |
|
106 | 106 | You can also index datasets using the Python API. |
@@ -129,3 +129,20 @@ pq.write_table(tab, "ds000224.parquet") |
129 | 129 | # Convert to a pandas dataframe. |
130 | 130 | df = tab.to_pandas(types_mapper=pd.ArrowDtype) |
131 | 131 | ``` |
| 132 | + |
| 133 | +### Using a custom or multiple BIDS schemas |
| 134 | + |
| 135 | +`bids2table` loads the bidsschematools default schema at import. For most |
| 136 | +users this is the right thing. To index a dataset against a specific schema |
| 137 | +version or path, pass a reference to the schema as the `schema` argument: |
| 138 | + |
| 139 | +```python |
| 140 | +from bids2table import index_dataset |
| 141 | + |
| 142 | +table = index_dataset("/path/to/dataset", schema="/path/to/bids-schema") |
| 143 | +``` |
| 144 | + |
| 145 | +`schema=` accepts a `pa.Schema`, a bidsschematools `Namespace`, |
| 146 | +a path/URL, or `None` (the module-level default). |
| 147 | +Passing different schemas to different `index_dataset` calls in the same |
| 148 | +process is supported and works under multiprocessing. |
0 commit comments