Skip to content

Commit

Permalink
Added jupytext metadata to all code/notebooks
Browse files Browse the repository at this point in the history
Added jupytext metadata to all code/notebooks so they are paired to the _episode md files
  • Loading branch information
samwalkow committed Oct 5, 2021
1 parent b38daaf commit a0cb6f4
Show file tree
Hide file tree
Showing 13 changed files with 84 additions and 26 deletions.
7 changes: 5 additions & 2 deletions code/01_preprocessing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,11 @@
}
],
"metadata": {
"jupytext": {
"formats": "code///ipynb,_episodes///md"
},
"kernelspec": {
"display_name": "Python [default]",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -88,7 +91,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.2"
"version": "3.7.3"
}
},
"nbformat": 4,
Expand Down
6 changes: 5 additions & 1 deletion code/02-exploring_fmriprep.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"BIDS applications such as fMRIPREP output data into a full data structure with strong similarity to BIDS organization principals. In fact, there is a specification for derivatives (outputs derived from) BIDS datasets; although this is a current work in progress, details can be found in: [BIDS Derivatives](https://bids-specification.readthedocs.io/en/latest/06-extensions.html). \n",
"\n",
"In this tutorial, we'll explore the outputs generated by fMRIPREP and get a handle of how the data is organized from this preprocessing pipeline\n",
"\n",
"***"
]
},
Expand Down Expand Up @@ -360,6 +361,9 @@
}
],
"metadata": {
"jupytext": {
"formats": "code///ipynb,_episodes///md"
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
Expand All @@ -375,7 +379,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.0"
"version": "3.7.3"
}
},
"nbformat": 4,
Expand Down
11 changes: 6 additions & 5 deletions code/02-exploring_fmriprep_solutions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -297,15 +297,16 @@
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"metadata": {},
"source": [
"Now that we have a handle on how fMRIPREP preprocessed data is organized and how we can pull this data. Let's start working with the actual data itself!"
]
}
],
"metadata": {
"jupytext": {
"formats": "code///ipynb,_episodes///md"
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
Expand All @@ -321,9 +322,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.0"
"version": "3.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
5 changes: 4 additions & 1 deletion code/03-basic_image_manipulation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,9 @@
}
],
"metadata": {
"jupytext": {
"formats": "code///ipynb,_episodes///md"
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
Expand All @@ -348,7 +351,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.0"
"version": "3.7.3"
}
},
"nbformat": 4,
Expand Down
10 changes: 8 additions & 2 deletions code/03-basic_image_manipulation_solutions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,12 @@
}
],
"metadata": {
"interpreter": {
"hash": "2fe2689612c0ab7397cf4462f922098fb75a2e15e2b422cd69da130ba4292710"
},
"jupytext": {
"formats": "code///ipynb,_episodes///md"
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
Expand All @@ -344,9 +350,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.0"
"version": "3.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
5 changes: 4 additions & 1 deletion code/04-integrating_functional_data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,9 @@
}
],
"metadata": {
"jupytext": {
"formats": "code///ipynb,_episodes///md"
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
Expand All @@ -550,7 +553,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.0"
"version": "3.7.3"
}
},
"nbformat": 4,
Expand Down
5 changes: 4 additions & 1 deletion code/04-integrating_functional_data_solutions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,9 @@
}
],
"metadata": {
"jupytext": {
"formats": "code///ipynb,_episodes///md"
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
Expand All @@ -563,7 +566,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.0"
"version": "3.7.3"
}
},
"nbformat": 4,
Expand Down
5 changes: 4 additions & 1 deletion code/05_applying-a-parcellation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@
],
"metadata": {
"anaconda-cloud": {},
"jupytext": {
"formats": "code///ipynb,_episodes///md"
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
Expand All @@ -245,7 +248,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.0"
"version": "3.7.3"
}
},
"nbformat": 4,
Expand Down
9 changes: 6 additions & 3 deletions code/05_applying-a-parcellation_solutions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"outputs": [],
"source": [
"from nilearn import datasets\n",
"from nilearn import image as nimg\n",
"from nilearn import plotting as nplot\n",
"from nilearn import image as nimg\n",
"from nilearn import plotting as nplot\n",
"\n",
"#for inline visualization in jupyter notebook\n",
"%matplotlib inline"
Expand Down Expand Up @@ -273,6 +273,9 @@
],
"metadata": {
"anaconda-cloud": {},
"jupytext": {
"formats": "code///ipynb,_episodes///md"
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
Expand All @@ -288,7 +291,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.0"
"version": "3.7.3"
}
},
"nbformat": 4,
Expand Down
5 changes: 4 additions & 1 deletion code/06_data-cleaning-with-nilearn.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,9 @@
}
],
"metadata": {
"jupytext": {
"formats": "code///ipynb,_episodes///md"
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
Expand All @@ -692,7 +695,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.0"
"version": "3.7.3"
}
},
"nbformat": 4,
Expand Down
5 changes: 4 additions & 1 deletion code/06_data-cleaning-with-nilearn_solutions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,9 @@
}
],
"metadata": {
"jupytext": {
"formats": "code///ipynb,_episodes///md"
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
Expand All @@ -727,7 +730,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.0"
"version": "3.7.3"
}
},
"nbformat": 4,
Expand Down
5 changes: 4 additions & 1 deletion code/07_functional-connectivity-analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,9 @@
}
],
"metadata": {
"jupytext": {
"formats": "code///ipynb,_episodes///md"
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
Expand All @@ -1083,7 +1086,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.0"
"version": "3.7.3"
}
},
"nbformat": 4,
Expand Down
32 changes: 26 additions & 6 deletions code/07_functional-connectivity-analysis_solutions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -91,7 +91,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -102,9 +102,23 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"execution_count": 8,
"metadata": {},
"outputs": [
{
"ename": "ValueError",
"evalue": "BIDS root does not exist: /Users/swalkow2/Documents/GitHub/SDC-BIDS-fMRI/data/ds000030/derivatives/fmriprep",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m/var/folders/02/bsg_wyl53q1bq10qyh56b_q40000gp/T/ipykernel_2951/865981971.py\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;31m#Use PyBIDS to parse BIDS data structure\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mlayout\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mBIDSLayout\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfmriprep_dir\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mvalidate\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;32m~/Documents/GitHub/SDC-BIDS-fMRI/CDS-BIDS-fMRI/lib/python3.9/site-packages/bids/layout/layout.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, root, validate, absolute_paths, derivatives, config, sources, ignore, force_index, config_filename, regex_search, database_path, database_file, reset_database, index_metadata)\u001b[0m\n\u001b[1;32m 254\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 255\u001b[0m \u001b[0;31m# Do basic BIDS validation on root directory\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 256\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_validate_root\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 257\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 258\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mignore\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/Documents/GitHub/SDC-BIDS-fMRI/CDS-BIDS-fMRI/lib/python3.9/site-packages/bids/layout/layout.py\u001b[0m in \u001b[0;36m_validate_root\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 484\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 485\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mexists\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mroot\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 486\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"BIDS root does not exist: %s\"\u001b[0m \u001b[0;34m%\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mroot\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 487\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 488\u001b[0m \u001b[0mtarget\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mroot\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'dataset_description.json'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mValueError\u001b[0m: BIDS root does not exist: /Users/swalkow2/Documents/GitHub/SDC-BIDS-fMRI/data/ds000030/derivatives/fmriprep"
]
}
],
"source": [
"#Use PyBIDS to parse BIDS data structure\n",
"layout = BIDSLayout(fmriprep_dir, validate=False)"
Expand Down Expand Up @@ -1017,6 +1031,12 @@
}
],
"metadata": {
"interpreter": {
"hash": "2fe2689612c0ab7397cf4462f922098fb75a2e15e2b422cd69da130ba4292710"
},
"jupytext": {
"formats": "code///ipynb,_episodes///md"
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
Expand All @@ -1032,7 +1052,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.0"
"version": "3.7.3"
}
},
"nbformat": 4,
Expand Down

0 comments on commit a0cb6f4

Please sign in to comment.