Skip to content

Commit

Permalink
Merge branch 'auth_fix' of github.com:individual-brain-charting/api i…
Browse files Browse the repository at this point in the history
…nto auth_fix
  • Loading branch information
man-shu committed Oct 5, 2023
2 parents c5fa689 + c7131d4 commit 29b65f0
Showing 1 changed file with 68 additions and 58 deletions.
126 changes: 68 additions & 58 deletions examples/get_data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"text": [
"[siibra:INFO] Version: 0.4a47\n",
"[siibra:WARNING] This is a development release. Use at your own risk.\n",
"[siibra:INFO] Please file bugs and issues at https://github.com/FZJ-INM1-BDA/siibra-python.\n"
"[siibra:INFO] Please file bugs and issues at https://github.com/FZJ-INM1-BDA/siibra-python.\n",
"[siibra:INFO] Clearing siibra cache at /home/himanshu/.cache/siibra.retrieval\n"
]
}
],
Expand Down Expand Up @@ -485,6 +486,13 @@
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Found 12 files for subjects ['08'] and tasks ['Discount'].\n"
]
},
{
"data": {
"text/html": [
Expand Down Expand Up @@ -802,52 +810,54 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Now before we download these files, we need to authenticate with EBRAINS. This will return a link that takes you to EBRAINS login page and stores an access token locally.\n",
"\n"
"Now we are ready to download the few selected maps that we filtered.\n",
"\n",
"The following will save the requested maps under\n",
"``ibc_data/resulting_smooth_maps/sub-08/task-Discount`` \n",
"(or whatever subject you chose). And will also create a local CSV file ``ibc_data/downloaded_volume_maps.csv`` to track the downloaded files. This will contain local file paths and the time they were downloaded at, and is updated everytime you download new files.\n"
]
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Found 12 files to download.\n",
"***\n",
"To continue, please go to https://iam.ebrains.eu/auth/realms/hbp/device?user_code=LGDW-XTRE\n",
"***\n",
"To continue, please go to https://iam.ebrains.eu/auth/realms/hbp/device?user_code=UFKZ-XXQU\n",
"***\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"[siibra:INFO] 139625 objects found for dataset ad04f919-7dcc-48d9-864a-d7b62af3d49d returned.\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"ebrains token successfuly set.\n"
]
}
],
"source": [
"ibc.authenticate()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now we are ready to download the few selected maps that we filtered.\n",
"\n",
"The following will save the requested maps under\n",
"``ibc_data/resulting_smooth_maps/sub-08/task-Discount`` \n",
"(or whatever subject you chose). And will also create a local CSV file ``ibc_data/downloaded_volume_maps.csv`` to track the downloaded files. This will contain local file paths and the time they were downloaded at, and is updated everytime you download new files.\n"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"[siibra:INFO] 139625 objects found for dataset ad04f919-7dcc-48d9-864a-d7b62af3d49d returned.\n",
"12it [00:01, 11.22it/s]\n"
"\n",
"Overall Progress: 0%|\u001b[32m \u001b[0m| 0/12 [00:00<?, ?it/s]\u001b[0m\u001b[A\n",
"Overall Progress: 17%|\u001b[32m██████████████████████████████████████████▌ \u001b[0m| 2/12 [00:00<00:00, 12.46it/s]\u001b[0m\u001b[A\n",
"Overall Progress: 33%|\u001b[32m█████████████████████████████████████████████████████████████████████████████████████ \u001b[0m| 4/12 [00:00<00:00, 12.26it/s]\u001b[0m\u001b[A\n",
"Overall Progress: 50%|\u001b[32m███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▌ \u001b[0m| 6/12 [00:00<00:00, 11.73it/s]\u001b[0m\u001b[A\n",
"Overall Progress: 67%|\u001b[32m██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ \u001b[0m| 8/12 [00:00<00:00, 11.80it/s]\u001b[0m\u001b[A\n",
"Overall Progress: 83%|\u001b[32m███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ \u001b[0m| 10/12 [00:00<00:00, 11.94it/s]\u001b[0m\u001b[A\n",
"Overall Progress: 100%|\u001b[32m██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████\u001b[0m| 12/12 [00:01<00:00, 11.97it/s]\u001b[0m\u001b[A\n"
]
},
{
Expand Down Expand Up @@ -886,62 +896,62 @@
" <tr>\n",
" <th>0</th>\n",
" <td>ibc_data/volume_maps/sub-08/ses-27/sub-08_ses-...</td>\n",
" <td>2023-09-18 17:37:15.588770</td>\n",
" <td>2023-10-05 17:23:53.472528</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>ibc_data/volume_maps/sub-08/ses-27/sub-08_ses-...</td>\n",
" <td>2023-09-18 17:37:15.765652</td>\n",
" <td>2023-10-05 17:23:53.628380</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>ibc_data/volume_maps/sub-08/ses-27/sub-08_ses-...</td>\n",
" <td>2023-09-18 17:37:15.772669</td>\n",
" <td>2023-10-05 17:23:53.634523</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>ibc_data/volume_maps/sub-08/ses-27/sub-08_ses-...</td>\n",
" <td>2023-09-18 17:37:15.944780</td>\n",
" <td>2023-10-05 17:23:53.793226</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>ibc_data/volume_maps/sub-08/ses-27/sub-08_ses-...</td>\n",
" <td>2023-09-18 17:37:15.949580</td>\n",
" <td>2023-10-05 17:23:53.799418</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>ibc_data/volume_maps/sub-08/ses-27/sub-08_ses-...</td>\n",
" <td>2023-09-18 17:37:16.116007</td>\n",
" <td>2023-10-05 17:23:53.972341</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>ibc_data/volume_maps/sub-08/ses-27/sub-08_ses-...</td>\n",
" <td>2023-09-18 17:37:16.121902</td>\n",
" <td>2023-10-05 17:23:53.979429</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>ibc_data/volume_maps/sub-08/ses-27/sub-08_ses-...</td>\n",
" <td>2023-09-18 17:37:16.298023</td>\n",
" <td>2023-10-05 17:23:54.140314</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>ibc_data/volume_maps/sub-08/ses-27/sub-08_ses-...</td>\n",
" <td>2023-09-18 17:37:16.302662</td>\n",
" <td>2023-10-05 17:23:54.146809</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>ibc_data/volume_maps/sub-08/ses-27/sub-08_ses-...</td>\n",
" <td>2023-09-18 17:37:16.471236</td>\n",
" <td>2023-10-05 17:23:54.304385</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>ibc_data/volume_maps/sub-08/ses-27/sub-08_ses-...</td>\n",
" <td>2023-09-18 17:37:16.476903</td>\n",
" <td>2023-10-05 17:23:54.310566</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>ibc_data/volume_maps/sub-08/ses-27/sub-08_ses-...</td>\n",
" <td>2023-09-18 17:37:16.651207</td>\n",
" <td>2023-10-05 17:23:54.468429</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
Expand All @@ -963,21 +973,21 @@
"11 ibc_data/volume_maps/sub-08/ses-27/sub-08_ses-... \n",
"\n",
" downloaded_on \n",
"0 2023-09-18 17:37:15.588770 \n",
"1 2023-09-18 17:37:15.765652 \n",
"2 2023-09-18 17:37:15.772669 \n",
"3 2023-09-18 17:37:15.944780 \n",
"4 2023-09-18 17:37:15.949580 \n",
"5 2023-09-18 17:37:16.116007 \n",
"6 2023-09-18 17:37:16.121902 \n",
"7 2023-09-18 17:37:16.298023 \n",
"8 2023-09-18 17:37:16.302662 \n",
"9 2023-09-18 17:37:16.471236 \n",
"10 2023-09-18 17:37:16.476903 \n",
"11 2023-09-18 17:37:16.651207 "
"0 2023-10-05 17:23:53.472528 \n",
"1 2023-10-05 17:23:53.628380 \n",
"2 2023-10-05 17:23:53.634523 \n",
"3 2023-10-05 17:23:53.793226 \n",
"4 2023-10-05 17:23:53.799418 \n",
"5 2023-10-05 17:23:53.972341 \n",
"6 2023-10-05 17:23:53.979429 \n",
"7 2023-10-05 17:23:54.140314 \n",
"8 2023-10-05 17:23:54.146809 \n",
"9 2023-10-05 17:23:54.304385 \n",
"10 2023-10-05 17:23:54.310566 \n",
"11 2023-10-05 17:23:54.468429 "
]
},
"execution_count": 7,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -996,16 +1006,16 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<nilearn.plotting.displays._slicers.OrthoSlicer at 0x7f341bf5fb80>"
"<nilearn.plotting.displays._slicers.OrthoSlicer at 0x7f7bdd436bb0>"
]
},
"execution_count": 8,
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
},
Expand Down

0 comments on commit 29b65f0

Please sign in to comment.