Load a saved BIDS database

I found documentation on how to save a BIDS layout to a sql database, but not clear how should I load one through pyBIDS.
Does anyone know how? Or am I missing some important page in the doc.

Hi Hao Ting,

You can do two things:

Either use the load function:

from bids.layout import BIDSLayout

layout = BIDSLayout.load(path_to_folder)

or pass a database_path to the BIDSLayout class when you instantiate it:

Let me know if that makes sense, and if you think the docs need some amendment, I would highly appreciate some suggestions or a PR :slight_smile:

Thanks! I will have a look. The doc was a bit difficult to navigate. I will have a think and perhaps open a discussion on pybids repo.

1 Like