Skip to content

Commit

Permalink
Merge pull request #6 from individual-brain-charting/fetch_raw_preproc
Browse files Browse the repository at this point in the history
Fetching raw and preprocessed data is now possible. Also adds databases for all ibc datasets on ebrains with consistent columns/info
  • Loading branch information
man-shu authored Sep 19, 2023
2 parents b2f2669 + 3730af6 commit 6ef640c
Show file tree
Hide file tree
Showing 7 changed files with 893 additions and 614 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ pip install git+https://github.com/individual-brain-charting/api.git#egg=ibc_api
```python
import ibc_api.utils as ibc

# Returns a link that takes you to EBRAINS login page and stores an access token locally
ibc.authenticate()

# Fetch info on all available files
# Load as a pandas dataframe and save as ibc_data/available_{data_type}.csv
db = ibc.get_info(data_type="volume_maps")

# Keep statistic maps for sub-08, for task-Discount
filtered_db = ibc.filter_data(db, subject_list=["sub-08"], task_list=["Discount"])
filtered_db = ibc.filter_data(db, subject_list=["08"], task_list=["Discount"])

# Authenticate with EBRAINS before downloading
# Returns a link that takes you to EBRAINS login page and stores an access token locally
ibc.authenticate()

# Download all statistic maps for sub-08, task-Discount
# Saved under ibc_data/resulting_smooth_maps/sub-08/task-Discount
# Also creates ibc_data/downloaded_volume_maps.csv
# which contains downloaded file paths and time of download
downloaded_db = ibc.download_data(filtered_db, organise_by='task')
# which contains local file paths and time of download
downloaded_db = ibc.download_data(filtered_db)
```
# Note
Since this api is under active development, make sure to update it regularly
Expand Down
20 changes: 10 additions & 10 deletions examples/example.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import ibc_api.utils as ibc

# Returns a link that takes you to EBRAINS login page and stores an access token locally
ibc.authenticate()

# Fetch info on all available files
# Load as a pandas dataframe and save as ibc_data/available_{data_type}.csv
# Load as a pandas dataframe and save as ibc_data/available_{data_type}.csv
db = ibc.get_info(data_type="volume_maps")

# Keep statistic maps for sub-08, for task-Discount
filtered_db = ibc.filter_data(db, subject_list=["sub-08"], task_list=["Discount"])
filtered_db = ibc.filter_data(db, subject_list=["08"], task_list=["Discount"])

# Authenticate with EBRAINS before downloading
# Returns a link that takes you to EBRAINS login page and stores an access token locally
ibc.authenticate()

# Download all statistic maps for sub-08, task-Discount
# Saved under ibc_data/resulting_smooth_maps/sub-08/task-Discount
# Also creates ibc_data/downloaded_volume_maps.csv
# which contains downloaded file paths and time of download
downloaded_db = ibc.download_data(filtered_db, organise_by='task')
# Download all statistic maps for sub-08, task-Discount
# Also creates ibc_data/downloaded_volume_maps.csv
# which contains local file paths and time of download
downloaded_db = ibc.download_data(filtered_db)
Loading

0 comments on commit 6ef640c

Please sign in to comment.