Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added NWB file example #342

Merged
merged 6 commits into from
Dec 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ bids-examples (in alphabetical order).
| eeg_ds000117 | @robertoostenveld | Multimodal (fMRI, MEG, EEG) stripped down to EEG with MRI anatomical scan and electrode coordinates. EEGLAB data format (.set, .fdt) | anat | | eeg | | | https://openneuro.org/datasets/ds000117/ |
| eeg_rest_fmri | @cpernet | Resting state with simultaneous fMRI. BrainVision data format (.eeg, .vhdr, .vmrk) | anat, dwi, func | | eeg | | | |
| ieeg_epilepsy | @ftadel | multiple sessions, tutorial | anat | | | ieeg | | https://neuroimage.usc.edu/bst/getupdate.php?s=tutorial_epimap_bids |
| ieeg_epilepsyNWB | @TheChymera | multiple sessions, tutorial — derivative dataset of `ieeg_epilepsy` showcasing the NWB file format alternative | anat | | | ieeg | | https://neuroimage.usc.edu/bst/getupdate.php?s=tutorial_epimap_bids |
| ieeg_epilepsy_ecog | @ftadel | multiple sessions, tutorial | anat | | | ieeg | | https://neuroimage.usc.edu/bst/getupdate.php?s=sample_ecog |
| ieeg_visual_multimodal | @irisgroen | | anat, fmap, func | | | ieeg | | |
| genetics_ukbb | @cpernet | multiple tasks, T1w, DTI, BOLD, genetic info | anat, dwi, func, fmap | | | | genetics | |
7 changes: 4 additions & 3 deletions ieeg_epilepsy/README
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ The acquisition methodology is described in the following articles:
License
=======

This tutorial dataset (EEG and MRI data) remains property of the Grenoble University Hospital, France.
Its use and transfer outside the ImaGIN tutorial, e.g. for research purposes, is prohibited without written consent.
For questions, please contact Olivier David, PhD ([email protected]).
This tutorial dataset (EEG and MRI data) remains property of the Grenoble University Hospital, France.
Its use and transfer outside the ImaGIN tutorial, e.g. for research purposes, is prohibited without written consent.
For questions, please contact Olivier David, PhD ([email protected]).
The metadata and filename stubs shared in this repository can be used, transferred, and derived, without explicit permission.
7 changes: 7 additions & 0 deletions ieeg_epilepsyNWB/CHANGES
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Release history for this Brainstorm/ImaGIN epileptogenicity tutorial dataset.

1.0.1 2022-07-04
- Updated to follow new BIDS rules

1.0.0 2018-11-30
- Initial release
56 changes: 56 additions & 0 deletions ieeg_epilepsyNWB/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Dataset Description

This is a copy of the `ieeg_epilepsy` dataset which is part of the `bids_examples` collection.
Fies with the extension `.eeg` are replaced with `.nwb` files with an empty data matrix and a subject field definition.
The `ieeg_epilepsy` was chosen for duplication as it was the smallest dataset using the `ieeg` modality.

```python
import os
from uuid import uuid4
from datetime import datetime, timezone
from dateutil.tz import tzlocal, tzutc
import pynwb
from dandi.pynwb_utils import make_nwb_file, metadata_nwb_file_fields

def simple1_nwb_metadata():
# very simple assignment with the same values as the key with 1 as suffix
metadata = {f: f"{f}1" for f in metadata_nwb_file_fields}
metadata["identifier"] = uuid4().hex
# subject_fields

# tune specific ones:
# Needs an explicit time zone since otherwise pynwb would add one
# But then comparison breaks anyways any ways yoh have tried to set it
# for datetime.now. Taking example from pynwb tests
metadata["session_start_time"] = datetime(2017, 4, 15, 12, tzinfo=tzutc())
metadata["keywords"] = ["keyword1", "keyword 2"]
# since NWB 2.1.0 some fields values become "arrays" which are
# then reloaded as tuples, so we force them being tuples here
# See e.g. https://github.com/NeurodataWithoutBorders/pynwb/issues/1091
for f in "related_publications", "experimenter":
metadata[f] = (metadata[f],)
return metadata

for i in os.listdir("."):
if i.endswith("nwb"):
b = simple1_nwb_metadata()
a = make_nwb_file(
i+"1",
subject=pynwb.file.Subject(
subject_id="01",
date_of_birth=datetime(2016, 12, 1, tzinfo=tzutc()),
sex="U",
species="Mus musculus",
),
**b,
)
print(a)
```


# Parent Dataset License

This tutorial dataset (EEG and MRI data) remains property of the Grenoble University Hospital, France.
Its use and transfer outside the ImaGIN tutorial, e.g. for research purposes, is prohibited without written consent.
For questions, please contact Olivier David, PhD ([email protected]).
The metadata and filename stubs shared in this repository can be used, transferred, and derived, without explicit permission.
20 changes: 20 additions & 0 deletions ieeg_epilepsyNWB/dataset_description.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"Name": "Brainstorm epileptogenicity tutorial",
"BIDSVersion": "1.7.0",
"License": "This tutorial dataset (EEG and MRI data) remains property of the Grenoble University Hospital, France. Its use and transfer outside the ImaGIN tutorial, e.g. for research purposes, is prohibited without written consent. For questions, please contact Olivier David, PhD ([email protected]).",
"Authors": [
"Olivier David",
"Thomas Blauwblomme",
"Anne-Sophie Job",
"Stephan Chabardès",
"Dominique Hoffmann",
"Lorella Minotti",
"Philippe Kahane"
],
"ReferencesAndLinks": [
"David O, Blauwblomme T, Job AS, Chabardès S, Hoffmann D, Minotti L, Kahane P, Imaging the seizure onset zone with stereo-electroencephalography, Brain. 2011 Oct;134(10):2898-911",
"Lamarche F, Job AS, Deman P, Bhattacharjee M, Hoffmann D, Gallazzini-Crépin C, Bouvard S, Minotti L, Kahane P, David O, Correlation of FDG-PET hypometabolism and SEEG epileptogenicity mapping in patients with drug-resistant focal epilepsy, Epilepsia. 2016 Dec; 57(12):2045–2055",
"https://neuroimage.usc.edu/brainstorm/Tutorials/Epileptogenicity",
"https://f-tract.eu/tutorials/"
]
}
Empty file.
15 changes: 15 additions & 0 deletions ieeg_epilepsyNWB/participants.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"age": {
"LongName": "age",
"Description": "age of the participant",
"Units": "years"
},
"sex": {
"LongName": "sex",
"Description": "sex of the participant",
"Levels": {
"m": "male",
"f": "female"
}
}
}
2 changes: 2 additions & 0 deletions ieeg_epilepsyNWB/participants.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
participant_id age sex
sub-01 XX m
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"iEEGCoordinateSystem": "IXI549Space",
"iEEGCoordinateUnits": "mm",
"iEEGCoordinateProcessingDescription": "SEEG contacts manually placed with IntrAnat on the post-implantation T1w MRI, registered on the pre-implantation T1w, and normalized to IXI549Space with SPM12",
"iEEGCoordinateProcessingReference": "Deman, P., Bhattacharjee, M., Tadel, F., Job, A. S., Rivière, D., Cointepas, Y., Kahane, P., … David, O. (2018). IntrAnat Electrodes: A Free Database and Visualization Software for Intracranial Electroencephalographic Data Processed for Case and Group Studies. Frontiers in neuroinformatics, 12, 40. doi:10.3389/fninf.2018.00040",
"IntendedFor": "sub-01/ses-postimp/anat/sub-01_ses-postimp_T1w.nii.gz"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
name x y z size hemisphere group type manufacturer
v'1 -2.142773 -38.682196 29.607849 5 L v' depth DIXI
v'2 -5.780327 -38.508810 29.615667 5 L v' depth DIXI
v'3 -9.424170 -38.327154 29.617274 5 L v' depth DIXI
v'4 -13.085162 -38.201440 29.737389 5 L v' depth DIXI
v'12 -42.867225 -37.987649 31.423371 5 L v' depth DIXI
v'13 -46.706554 -38.042728 31.546932 5 L v' depth DIXI
v'14 -50.542716 -38.146570 31.587165 5 L v' depth DIXI
v'15 -54.334033 -38.261455 31.585984 5 L v' depth DIXI
y'1 -33.025540 -1.252980 -7.783847 5 L y' depth DIXI
y'2 -32.750495 -3.502531 -4.431253 5 L y' depth DIXI
y'3 -32.456122 -5.760685 -1.115406 5 L y' depth DIXI
y'4 -32.245241 -8.014321 2.105200 5 L y' depth DIXI
y'5 -32.074522 -10.254071 5.316606 5 L y' depth DIXI
y'6 -31.822629 -12.486407 8.532736 5 L y' depth DIXI
y'7 -31.545732 -14.705389 11.727607 5 L y' depth DIXI
y'8 -31.200463 -16.906653 14.948259 5 L y' depth DIXI
y'9 -30.755714 -19.100763 18.214311 5 L y' depth DIXI
y'16 -27.271179 -34.686096 41.592751 5 L y' depth DIXI
y'17 -26.901452 -36.948599 45.168776 5 L y' depth DIXI
y'18 -26.652344 -39.195087 48.759740 5 L y' depth DIXI
t'1 -36.477081 -12.130454 -5.542343 5 L t' depth DIXI
t'2 -40.490739 -11.987153 -5.788616 5 L t' depth DIXI
t'3 -44.478796 -11.912610 -6.182991 5 L t' depth DIXI
t'4 -48.495460 -11.858580 -6.667650 5 L t' depth DIXI
t'5 -52.414682 -11.684004 -6.994740 5 L t' depth DIXI
t'6 -56.305639 -11.417642 -7.070488 5 L t' depth DIXI
t'7 -60.219873 -11.114201 -6.998614 5 L t' depth DIXI
t'8 -64.100601 -10.821062 -6.891831 5 L t' depth DIXI
u'1 -34.273569 -23.539595 7.111468 5 L u' depth DIXI
u'2 -38.179204 -23.548648 7.146989 5 L u' depth DIXI
u'3 -42.036746 -23.488456 7.177517 5 L u' depth DIXI
u'5 -49.671873 -23.430936 6.977465 5 L u' depth DIXI
u'6 -53.534716 -23.433236 6.874113 5 L u' depth DIXI
u'7 -57.434853 -23.415320 6.853044 5 L u' depth DIXI
u'8 -61.340470 -23.373730 6.878782 5 L u' depth DIXI
et'1 -19.641694 -10.584633 -31.317752 5 L et' depth DIXI
et'2 -23.507686 -10.449209 -31.051202 5 L et' depth DIXI
et'3 -27.376315 -10.265294 -30.889556 5 L et' depth DIXI
et'6 -38.840219 -9.844312 -31.080512 5 L et' depth DIXI
et'7 -42.698294 -9.573310 -31.230694 5 L et' depth DIXI
et'8 -46.549838 -9.317575 -31.487532 5 L et' depth DIXI
et'9 -50.410073 -9.045922 -31.776961 5 L et' depth DIXI
b'1 -19.760858 -21.741360 -16.908227 5 L b' depth DIXI
b'2 -23.625238 -21.448536 -16.765302 5 L b' depth DIXI
b'3 -27.517539 -21.150555 -16.651107 5 L b' depth DIXI
b'4 -31.398185 -20.840874 -16.575389 5 L b' depth DIXI
b'5 -35.241980 -20.516587 -16.643377 5 L b' depth DIXI
b'10 -54.662436 -18.545752 -16.762771 5 L b' depth DIXI
b'11 -58.460258 -18.098090 -16.606681 5 L b' depth DIXI
b'12 -62.193658 -17.715260 -16.604731 5 L b' depth DIXI
c'1 -22.972342 -37.078481 -3.024145 5 L c' depth DIXI
c'2 -26.816046 -37.028026 -2.857873 5 L c' depth DIXI
c'3 -30.667653 -37.023213 -2.737279 5 L c' depth DIXI
c'9 -53.634711 -38.230278 -2.668444 5 L c' depth DIXI
c'10 -57.378449 -38.345531 -2.617648 5 L c' depth DIXI
c'11 -61.115287 -38.427118 -2.468983 5 L c' depth DIXI
c'12 -64.853527 -38.511015 -2.231203 5 L c' depth DIXI
d'7 -50.834022 -47.171589 6.094132 5 L d' depth DIXI
d'8 -54.584015 -47.169812 6.242061 5 L d' depth DIXI
d'9 -58.310114 -47.135934 6.468913 5 L d' depth DIXI
d'10 -62.028192 -47.099832 6.762434 5 L d' depth DIXI
d'11 -65.764226 -47.101859 7.076189 5 L d' depth DIXI
x'1 -0.301606 -63.476428 35.783738 5 L x' depth DIXI
x'2 -3.881344 -63.327029 35.998620 5 L x' depth DIXI
x'3 -7.434621 -63.192405 36.152311 5 L x' depth DIXI
x'6 -18.155808 -62.823027 36.445711 5 L x' depth DIXI
x'7 -21.899046 -62.710971 36.726490 5 L x' depth DIXI
x'8 -25.633892 -62.456306 36.874153 5 L x' depth DIXI
x'9 -29.421238 -62.068526 36.939126 5 L x' depth DIXI
x'12 -40.765196 -61.195940 37.297498 5 L x' depth DIXI
x'13 -44.580039 -61.084174 37.296060 5 L x' depth DIXI
x'14 -48.444748 -61.083850 37.273794 5 L x' depth DIXI
e'1 -20.915413 -33.859055 -13.935391 5 L e' depth DIXI
e'2 -24.818663 -33.769540 -13.760457 5 L e' depth DIXI
e'3 -28.762218 -33.644963 -13.524973 5 L e' depth DIXI
e'4 -32.704405 -33.555932 -13.390849 5 L e' depth DIXI
e'5 -36.617365 -33.519510 -13.387071 5 L e' depth DIXI
e'8 -48.207656 -33.312034 -12.768362 5 L e' depth DIXI
e'9 -52.014556 -33.263218 -12.600289 5 L e' depth DIXI
e'10 -55.769064 -33.242006 -12.556868 5 L e' depth DIXI
e'11 -59.494495 -33.241149 -12.580450 5 L e' depth DIXI
l'1 -20.004693 -51.854923 -12.754893 5 L l' depth DIXI
l'2 -23.733068 -51.686399 -12.633724 5 L l' depth DIXI
l'3 -27.461860 -51.550031 -12.405111 5 L l' depth DIXI
l'4 -31.220036 -51.446617 -12.141054 5 L l' depth DIXI
l'5 -35.049386 -51.392473 -11.982179 5 L l' depth DIXI
l'6 -38.951844 -51.405717 -11.931394 5 L l' depth DIXI
l'7 -42.843860 -51.465370 -12.030616 5 L l' depth DIXI
l'8 -46.683136 -51.519830 -12.116584 5 L l' depth DIXI
l'9 -50.497398 -51.553525 -12.128410 5 L l' depth DIXI
f'1 -13.381800 -58.327880 -4.430583 5 L f' depth DIXI
f'2 -17.071247 -57.816084 -4.542754 5 L f' depth DIXI
f'3 -20.781428 -57.348724 -4.798471 5 L f' depth DIXI
f'4 -24.530090 -56.921080 -4.815027 5 L f' depth DIXI
f'8 -39.742365 -55.551939 -4.848105 5 L f' depth DIXI
f'9 -43.612983 -55.359501 -5.093762 5 L f' depth DIXI
f'10 -47.435440 -55.106644 -5.255262 5 L f' depth DIXI
f'11 -51.223598 -54.779276 -5.294677 5 L f' depth DIXI
f'12 -54.972965 -54.441188 -5.274485 5 L f' depth DIXI
g'1 -14.421640 -68.216339 -6.006746 5 L g' depth DIXI
g'2 -18.095039 -67.924432 -5.996758 5 L g' depth DIXI
g'3 -21.781389 -67.673557 -6.024051 5 L g' depth DIXI
g'4 -25.487633 -67.422159 -6.203625 5 L g' depth DIXI
g'5 -29.239072 -67.197338 -6.339088 5 L g' depth DIXI
g'6 -33.128154 -67.041501 -6.343514 5 L g' depth DIXI
g'7 -37.055168 -66.937886 -6.413480 5 L g' depth DIXI
g'8 -40.873691 -66.858977 -6.507874 5 L g' depth DIXI
g'9 -44.671029 -66.787042 -6.605360 5 L g' depth DIXI
g'10 -48.471380 -66.700153 -6.679663 5 L g' depth DIXI
g'11 -52.262645 -66.628434 -6.725315 5 L g' depth DIXI
g'12 -56.040730 -66.589013 -6.742267 5 L g' depth DIXI
o'1 -3.408633 -75.117663 7.385122 5 L o' depth DIXI
o'2 -7.297317 -74.916817 7.554708 5 L o' depth DIXI
o'5 -18.688930 -74.089095 7.603606 5 L o' depth DIXI
o'6 -22.440437 -73.838651 7.660253 5 L o' depth DIXI
o'10 -37.048880 -72.982624 7.500245 5 L o' depth DIXI
o'11 -40.720452 -72.794512 7.441627 5 L o' depth DIXI
o'12 -44.415895 -72.613910 7.395660 5 L o' depth DIXI
s'1 -3.371844 -68.452939 15.602427 5 L s' depth DIXI
s'2 -7.236137 -68.408966 15.848333 5 L s' depth DIXI
s'3 -11.093324 -68.329863 15.970856 5 L s' depth DIXI
s'10 -36.671355 -66.523135 17.376069 5 L s' depth DIXI
s'11 -40.361248 -66.365287 17.453095 5 L s' depth DIXI
s'12 -44.088159 -66.241898 17.527388 5 L s' depth DIXI
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"iEEGCoordinateSystem": "ScanRAS",
"iEEGCoordinateUnits": "mm",
"iEEGCoordinateSystemDescription": "Scanner-based RAS coordinates of the post-implantation T1 MRI",
"iEEGCoordinateProcessingDescription": "SEEG contacts manually placed with IntrAnat on the post-implantation T1w MRI, which was registered on the pre-implantation T1w",
"iEEGCoordinateProcessingReference": "Deman, P., Bhattacharjee, M., Tadel, F., Job, A. S., Rivière, D., Cointepas, Y., Kahane, P., … David, O. (2018). IntrAnat Electrodes: A Free Database and Visualization Software for Intracranial Electroencephalographic Data Processed for Case and Group Studies. Frontiers in neuroinformatics, 12, 40. doi:10.3389/fninf.2018.00040",
"IntendedFor": "sub-01/ses-postimp/anat/sub-01_ses-postimp_T1w.nii.gz"
}
Loading