Commit df49714b authored by Arvid Lundervold's avatar Arvid Lundervold

imported necessary libraries for colab, typos

parent a62894e3
......@@ -6,7 +6,7 @@
"source": [
"# Explore resting state BOLD fMRI data (work in progress ...)\n",
"\n",
"BMED360-2021 `03-resing-state-fmri-explore.ipynb`\n",
"BMED360-2021 `03-Resting-state-fmri-explore.ipynb`\n",
"\n",
"(using selected datasets from the Brain-Gut BIDS collection) "
]
......@@ -15,7 +15,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"<a href=\"https://colab.research.google.com/github/computational-medicine/BMED360-2021/blob/main/Lab6-Networks-Graphs/03-resting-state-fmri-explore.ipynb\">\n",
"<a href=\"https://colab.research.google.com/github/computational-medicine/BMED360-2021/blob/main/Lab6-Networks-Graphs/03-Resting-state-fmri-explore.ipynb\">\n",
" <img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/>\n",
"</a>"
]
......@@ -705,74 +705,74 @@
{
"data": {
"text/plain": [
"{'subject': <bids.layout.models.Entity at 0x7f8c5899dcd0>,\n",
" 'session': <bids.layout.models.Entity at 0x7f8c58b52cd0>,\n",
" 'task': <bids.layout.models.Entity at 0x7f8bf85d19d0>,\n",
" 'acquisition': <bids.layout.models.Entity at 0x7f8bf85d1a30>,\n",
" 'ceagent': <bids.layout.models.Entity at 0x7f8bf85d1a90>,\n",
" 'reconstruction': <bids.layout.models.Entity at 0x7f8bf85d1af0>,\n",
" 'direction': <bids.layout.models.Entity at 0x7f8bf85d1b50>,\n",
" 'run': <bids.layout.models.Entity at 0x7f8bf85d1bb0>,\n",
" 'proc': <bids.layout.models.Entity at 0x7f8bf85d1c10>,\n",
" 'modality': <bids.layout.models.Entity at 0x7f8bf85d1c70>,\n",
" 'echo': <bids.layout.models.Entity at 0x7f8bf85d1cd0>,\n",
" 'flip': <bids.layout.models.Entity at 0x7f8bf85d1d30>,\n",
" 'inv': <bids.layout.models.Entity at 0x7f8bf85d1d90>,\n",
" 'mt': <bids.layout.models.Entity at 0x7f8bf85d1df0>,\n",
" 'part': <bids.layout.models.Entity at 0x7f8bf85d1e50>,\n",
" 'recording': <bids.layout.models.Entity at 0x7f8bf85d1eb0>,\n",
" 'space': <bids.layout.models.Entity at 0x7f8bf85d1f10>,\n",
" 'suffix': <bids.layout.models.Entity at 0x7f8bf85d1f70>,\n",
" 'scans': <bids.layout.models.Entity at 0x7f8bf85d1fd0>,\n",
" 'fmap': <bids.layout.models.Entity at 0x7f8bf85d1f40>,\n",
" 'datatype': <bids.layout.models.Entity at 0x7f8bf85d60d0>,\n",
" 'extension': <bids.layout.models.Entity at 0x7f8bf85d6130>,\n",
" 'participant_id': <bids.layout.models.Entity at 0x7f8bf85d6190>,\n",
" 'gender': <bids.layout.models.Entity at 0x7f8bf85d61f0>,\n",
" 'age': <bids.layout.models.Entity at 0x7f8bf85d6250>,\n",
" 'group': <bids.layout.models.Entity at 0x7f8bf85d62b0>,\n",
" 'pre_soup_pain': <bids.layout.models.Entity at 0x7f8bf85d6310>,\n",
" 'pre_soup_nausea': <bids.layout.models.Entity at 0x7f8bf85d6370>,\n",
" 'pre_soup_fullnes': <bids.layout.models.Entity at 0x7f8bf85d63d0>,\n",
" 'pre_soup_total': <bids.layout.models.Entity at 0x7f8bf85d6430>,\n",
" 'pre_soup_full': <bids.layout.models.Entity at 0x7f8bf85d6490>,\n",
" 'post_soup_pain': <bids.layout.models.Entity at 0x7f8bf85d64f0>,\n",
" 'post_soup_nausea': <bids.layout.models.Entity at 0x7f8bf85d6550>,\n",
" 'post_soup_fullness': <bids.layout.models.Entity at 0x7f8bf85d65b0>,\n",
" 'post_soup_total': <bids.layout.models.Entity at 0x7f8bf85d6610>,\n",
" 'post_soup_full': <bids.layout.models.Entity at 0x7f8bf85d6670>,\n",
" 'num_glasses': <bids.layout.models.Entity at 0x7f8bf85d66d0>,\n",
" 'ConversionSoftware': <bids.layout.models.Entity at 0x7f8bf85d6730>,\n",
" 'SeriesNumber': <bids.layout.models.Entity at 0x7f8bf85d6790>,\n",
" 'SeriesDescription': <bids.layout.models.Entity at 0x7f8bf85d67f0>,\n",
" 'ImageType': <bids.layout.models.Entity at 0x7f8bf85d6850>,\n",
" 'Modality': <bids.layout.models.Entity at 0x7f8bf85d68b0>,\n",
" 'AcquisitionDateTime': <bids.layout.models.Entity at 0x7f8bf85d6910>,\n",
" 'RepetitionTime': <bids.layout.models.Entity at 0x7f8bf85d6970>,\n",
" 'PhaseEncodingDirection': <bids.layout.models.Entity at 0x7f8bf85d69d0>,\n",
" 'EchoTime': <bids.layout.models.Entity at 0x7f8bf85d6a30>,\n",
" 'InversionTime': <bids.layout.models.Entity at 0x7f8bf85d6a90>,\n",
" 'PatientName': <bids.layout.models.Entity at 0x7f8bf85d6af0>,\n",
" 'PatientAge': <bids.layout.models.Entity at 0x7f8bf85d6b50>,\n",
" 'PatientWeight': <bids.layout.models.Entity at 0x7f8bf85d6bb0>,\n",
" 'PatientPosition': <bids.layout.models.Entity at 0x7f8bf85d6c10>,\n",
" 'SliceThickness': <bids.layout.models.Entity at 0x7f8bf85d6c70>,\n",
" 'FlipAngle': <bids.layout.models.Entity at 0x7f8bf85d6cd0>,\n",
" 'Manufacturer': <bids.layout.models.Entity at 0x7f8bf85d6d30>,\n",
" 'SoftwareVersion': <bids.layout.models.Entity at 0x7f8bf85d6d90>,\n",
" 'MRAcquisitionType': <bids.layout.models.Entity at 0x7f8bf85d6df0>,\n",
" 'InstitutionName': <bids.layout.models.Entity at 0x7f8bf85d6e50>,\n",
" 'DeviceSerialNumber': <bids.layout.models.Entity at 0x7f8bf85d6eb0>,\n",
" 'ScanningSequence': <bids.layout.models.Entity at 0x7f8bf85d6f10>,\n",
" 'SequenceVariant': <bids.layout.models.Entity at 0x7f8bf85d6f70>,\n",
" 'ScanOptions': <bids.layout.models.Entity at 0x7f8bf85d6fd0>,\n",
" 'SequenceName': <bids.layout.models.Entity at 0x7f8bf85d6f40>,\n",
" 'DiffusionBValue': <bids.layout.models.Entity at 0x7f8bf85dd0d0>,\n",
" 'DiffusionGradientOrientation': <bids.layout.models.Entity at 0x7f8bf85dd130>,\n",
" 'TotalReadoutTime': <bids.layout.models.Entity at 0x7f8bf85dd190>,\n",
" 'EffectiveEchoSpacing': <bids.layout.models.Entity at 0x7f8bf85dd1f0>,\n",
" 'TaskName': <bids.layout.models.Entity at 0x7f8bf85dd250>,\n",
" 'SliceTiming': <bids.layout.models.Entity at 0x7f8bf85dd2b0>}"
"{'subject': <bids.layout.models.Entity at 0x7fbd08486760>,\n",
" 'session': <bids.layout.models.Entity at 0x7fbcc9951280>,\n",
" 'task': <bids.layout.models.Entity at 0x7fbd1a7d39d0>,\n",
" 'acquisition': <bids.layout.models.Entity at 0x7fbd1a7d3a30>,\n",
" 'ceagent': <bids.layout.models.Entity at 0x7fbd1a7d3a90>,\n",
" 'reconstruction': <bids.layout.models.Entity at 0x7fbd1a7d3af0>,\n",
" 'direction': <bids.layout.models.Entity at 0x7fbd1a7d3b50>,\n",
" 'run': <bids.layout.models.Entity at 0x7fbd1a7d3bb0>,\n",
" 'proc': <bids.layout.models.Entity at 0x7fbd1a7d3c10>,\n",
" 'modality': <bids.layout.models.Entity at 0x7fbd1a7d3c70>,\n",
" 'echo': <bids.layout.models.Entity at 0x7fbd1a7d3cd0>,\n",
" 'flip': <bids.layout.models.Entity at 0x7fbd1a7d3d30>,\n",
" 'inv': <bids.layout.models.Entity at 0x7fbd1a7d3d90>,\n",
" 'mt': <bids.layout.models.Entity at 0x7fbd1a7d3df0>,\n",
" 'part': <bids.layout.models.Entity at 0x7fbd1a7d3e50>,\n",
" 'recording': <bids.layout.models.Entity at 0x7fbd1a7d3eb0>,\n",
" 'space': <bids.layout.models.Entity at 0x7fbd1a7d3f10>,\n",
" 'suffix': <bids.layout.models.Entity at 0x7fbd1a7d3f70>,\n",
" 'scans': <bids.layout.models.Entity at 0x7fbd1a7d3fd0>,\n",
" 'fmap': <bids.layout.models.Entity at 0x7fbd1a7d3f40>,\n",
" 'datatype': <bids.layout.models.Entity at 0x7fbd1a7d70d0>,\n",
" 'extension': <bids.layout.models.Entity at 0x7fbd1a7d7130>,\n",
" 'participant_id': <bids.layout.models.Entity at 0x7fbd1a7d7190>,\n",
" 'gender': <bids.layout.models.Entity at 0x7fbd1a7d71f0>,\n",
" 'age': <bids.layout.models.Entity at 0x7fbd1a7d7250>,\n",
" 'group': <bids.layout.models.Entity at 0x7fbd1a7d72b0>,\n",
" 'pre_soup_pain': <bids.layout.models.Entity at 0x7fbd1a7d7310>,\n",
" 'pre_soup_nausea': <bids.layout.models.Entity at 0x7fbd1a7d7370>,\n",
" 'pre_soup_fullnes': <bids.layout.models.Entity at 0x7fbd1a7d73d0>,\n",
" 'pre_soup_total': <bids.layout.models.Entity at 0x7fbd1a7d7430>,\n",
" 'pre_soup_full': <bids.layout.models.Entity at 0x7fbd1a7d7490>,\n",
" 'post_soup_pain': <bids.layout.models.Entity at 0x7fbd1a7d74f0>,\n",
" 'post_soup_nausea': <bids.layout.models.Entity at 0x7fbd1a7d7550>,\n",
" 'post_soup_fullness': <bids.layout.models.Entity at 0x7fbd1a7d75b0>,\n",
" 'post_soup_total': <bids.layout.models.Entity at 0x7fbd1a7d7610>,\n",
" 'post_soup_full': <bids.layout.models.Entity at 0x7fbd1a7d7670>,\n",
" 'num_glasses': <bids.layout.models.Entity at 0x7fbd1a7d76d0>,\n",
" 'ConversionSoftware': <bids.layout.models.Entity at 0x7fbd1a7d7730>,\n",
" 'SeriesNumber': <bids.layout.models.Entity at 0x7fbd1a7d7790>,\n",
" 'SeriesDescription': <bids.layout.models.Entity at 0x7fbd1a7d77f0>,\n",
" 'ImageType': <bids.layout.models.Entity at 0x7fbd1a7d7850>,\n",
" 'Modality': <bids.layout.models.Entity at 0x7fbd1a7d78b0>,\n",
" 'AcquisitionDateTime': <bids.layout.models.Entity at 0x7fbd1a7d7910>,\n",
" 'RepetitionTime': <bids.layout.models.Entity at 0x7fbd1a7d7970>,\n",
" 'PhaseEncodingDirection': <bids.layout.models.Entity at 0x7fbd1a7d79d0>,\n",
" 'EchoTime': <bids.layout.models.Entity at 0x7fbd1a7d7a30>,\n",
" 'InversionTime': <bids.layout.models.Entity at 0x7fbd1a7d7a90>,\n",
" 'PatientName': <bids.layout.models.Entity at 0x7fbd1a7d7af0>,\n",
" 'PatientAge': <bids.layout.models.Entity at 0x7fbd1a7d7b50>,\n",
" 'PatientWeight': <bids.layout.models.Entity at 0x7fbd1a7d7bb0>,\n",
" 'PatientPosition': <bids.layout.models.Entity at 0x7fbd1a7d7c10>,\n",
" 'SliceThickness': <bids.layout.models.Entity at 0x7fbd1a7d7c70>,\n",
" 'FlipAngle': <bids.layout.models.Entity at 0x7fbd1a7d7cd0>,\n",
" 'Manufacturer': <bids.layout.models.Entity at 0x7fbd1a7d7d30>,\n",
" 'SoftwareVersion': <bids.layout.models.Entity at 0x7fbd1a7d7d90>,\n",
" 'MRAcquisitionType': <bids.layout.models.Entity at 0x7fbd1a7d7df0>,\n",
" 'InstitutionName': <bids.layout.models.Entity at 0x7fbd1a7d7e50>,\n",
" 'DeviceSerialNumber': <bids.layout.models.Entity at 0x7fbd1a7d7eb0>,\n",
" 'ScanningSequence': <bids.layout.models.Entity at 0x7fbd1a7d7f10>,\n",
" 'SequenceVariant': <bids.layout.models.Entity at 0x7fbd1a7d7f70>,\n",
" 'ScanOptions': <bids.layout.models.Entity at 0x7fbd1a7d7fd0>,\n",
" 'SequenceName': <bids.layout.models.Entity at 0x7fbd1a7d7f40>,\n",
" 'DiffusionBValue': <bids.layout.models.Entity at 0x7fbd1a7e00d0>,\n",
" 'DiffusionGradientOrientation': <bids.layout.models.Entity at 0x7fbd1a7e0130>,\n",
" 'TotalReadoutTime': <bids.layout.models.Entity at 0x7fbd1a7e0190>,\n",
" 'EffectiveEchoSpacing': <bids.layout.models.Entity at 0x7fbd1a7e01f0>,\n",
" 'TaskName': <bids.layout.models.Entity at 0x7fbd1a7e0250>,\n",
" 'SliceTiming': <bids.layout.models.Entity at 0x7fbd1a7e02b0>}"
]
},
"execution_count": 19,
......@@ -1397,26 +1397,7 @@
"cell_type": "code",
"execution_count": 35,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"Dataset created in /Users/arvid/nilearn_data/fsl\n",
"\n",
"Downloading data from http://www.nitrc.org/frs/download.php/9902/HarvardOxford.tgz ...\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Downloaded 25698304 of 25716861 bytes (99.9%, 0.1s remaining) ...done. (113 seconds, 1 min)\n",
"Extracting data from /Users/arvid/nilearn_data/fsl/245b1ae3f43e3ea47e2ed9f438694f4a/HarvardOxford.tgz..... done.\n"
]
}
],
"outputs": [],
"source": [
"## import an existing map\n",
"\n",
......@@ -1433,95 +1414,7 @@
"cell_type": "code",
"execution_count": 36,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"Dataset created in /Users/arvid/nilearn_data/smith_2009\n",
"\n",
"Downloading data from http://www.fmrib.ox.ac.uk/datasets/brainmap+rsns/rsn20.nii.gz ...\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Downloaded 14573568 of 15129514 bytes (96.3%, 1.3s remaining) ...done. (37 seconds, 0 min)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloading data from http://www.fmrib.ox.ac.uk/datasets/brainmap+rsns/PNAS_Smith09_rsn10.nii.gz ...\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Downloaded 6856704 of 7565016 bytes (90.6%, 1.7s remaining) ...done. (17 seconds, 0 min)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloading data from http://www.fmrib.ox.ac.uk/datasets/brainmap+rsns/rsn70.nii.gz ...\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Downloaded 52551680 of 53028809 bytes (99.1%, 1.2s remaining) ...done. (134 seconds, 2 min)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloading data from http://www.fmrib.ox.ac.uk/datasets/brainmap+rsns/bm20.nii.gz ...\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Downloaded 19046400 of 19114114 bytes (99.6%, 0.2s remaining) ...done. (55 seconds, 0 min)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloading data from http://www.fmrib.ox.ac.uk/datasets/brainmap+rsns/PNAS_Smith09_bm10.nii.gz ...\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Downloaded 9560064 of 9566632 bytes (99.9%, 0.0s remaining) ...done. (27 seconds, 0 min)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloading data from http://www.fmrib.ox.ac.uk/datasets/brainmap+rsns/bm70.nii.gz ...\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Downloaded 66789376 of 67017538 bytes (99.7%, 0.6s remaining) ...done. (167 seconds, 2 min)\n"
]
}
],
"outputs": [],
"source": [
"## load the smith (ICA based) mask\n",
"## 'rsn10': 10 ICA maps from the above that matched across task and rest\n",
......@@ -1555,15 +1448,15 @@
},
{
"cell_type": "code",
"execution_count": 40,
"execution_count": 38,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 25min 36s, sys: 20.9 s, total: 25min 57s\n",
"Wall time: 1min 40s\n"
"CPU times: user 27min 37s, sys: 39.8 s, total: 28min 17s\n",
"Wall time: 1min 50s\n"
]
}
],
......@@ -1579,7 +1472,7 @@
},
{
"cell_type": "code",
"execution_count": 41,
"execution_count": 39,
"metadata": {},
"outputs": [
{
......@@ -1600,7 +1493,7 @@
},
{
"cell_type": "code",
"execution_count": 42,
"execution_count": 40,
"metadata": {},
"outputs": [
{
......@@ -1623,7 +1516,7 @@
},
{
"cell_type": "code",
"execution_count": 43,
"execution_count": 41,
"metadata": {},
"outputs": [],
"source": [
......@@ -1637,7 +1530,7 @@
},
{
"cell_type": "code",
"execution_count": 44,
"execution_count": 42,
"metadata": {},
"outputs": [],
"source": [
......@@ -1646,7 +1539,7 @@
},
{
"cell_type": "code",
"execution_count": 45,
"execution_count": 43,
"metadata": {},
"outputs": [
{
......@@ -1671,7 +1564,7 @@
},
{
"cell_type": "code",
"execution_count": 46,
"execution_count": 44,
"metadata": {},
"outputs": [
{
......@@ -1704,7 +1597,7 @@
},
{
"cell_type": "code",
"execution_count": 47,
"execution_count": 45,
"metadata": {},
"outputs": [
{
......@@ -1713,7 +1606,7 @@
"CanICA(random_state=0)"
]
},
"execution_count": 47,
"execution_count": 45,
"metadata": {},
"output_type": "execute_result"
}
......@@ -1728,7 +1621,7 @@
},
{
"cell_type": "code",
"execution_count": 48,
"execution_count": 46,
"metadata": {},
"outputs": [
{
......@@ -1737,7 +1630,7 @@
"(20, 44591)"
]
},
"execution_count": 48,
"execution_count": 46,
"metadata": {},
"output_type": "execute_result"
}
......@@ -1748,7 +1641,7 @@
},
{
"cell_type": "code",
"execution_count": 49,
"execution_count": 47,
"metadata": {},
"outputs": [
{
......@@ -1771,7 +1664,7 @@
},
{
"cell_type": "code",
"execution_count": 50,
"execution_count": 48,
"metadata": {},
"outputs": [
{
......@@ -1790,8 +1683,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 42.3 s, sys: 1.03 s, total: 43.3 s\n",
"Wall time: 36.4 s\n"
"CPU times: user 43.8 s, sys: 1.2 s, total: 45 s\n",
"Wall time: 38.1 s\n"
]
}
],
......@@ -1806,16 +1699,16 @@
},
{
"cell_type": "code",
"execution_count": 56,
"execution_count": 49,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(152, 1929)"
"(152, 1783)"
]
},
"execution_count": 56,
"execution_count": 49,
"metadata": {},
"output_type": "execute_result"
}
......@@ -9,7 +9,7 @@
- [**02-Network-based-statistics.ipynb**](https://nbviewer.jupyter.org/github/computational-medicine/BMED360-2021/blob/main/Lab6-Networks-Graphs/02-Network-based-statistics.ipynb) <a href="https://colab.research.google.com/github/computational-medicine/BMED360-2021/blob/main/Lab6-Networks-Graphs/02-Network-based-statistics.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
- [**03-resting-state-fmri-explore.ipynb**](https://nbviewer.jupyter.org/github/computational-medicine/BMED360-2021/blob/main/Lab6-Networks-Graphs/03-resting-state-fmri-explore.ipynb) <a href="https://colab.research.google.com/github/computational-medicine/BMED360-2021/blob/main/Lab6-Networks-Graphs/03-resting-state-fmri-explore.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
- [**03-Resting-state-fmri-explore.ipynb**](https://nbviewer.jupyter.org/github/computational-medicine/BMED360-2021/blob/main/Lab6-Networks-Graphs/03-Resting-state-fmri-explore.ipynb) <a href="https://colab.research.google.com/github/computational-medicine/BMED360-2021/blob/main/Lab6-Networks-Graphs/03-Resting-state-fmri-explore.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
- [**Brain connectivity and fMRI**](Connectivity-fMRI.md)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment