Skip to content

Commit

Permalink
update HIBALL winterschool tutorial for 1.0a14
Browse files Browse the repository at this point in the history
  • Loading branch information
dickscheid committed Sep 9, 2024
1 parent 4078799 commit 7b60742
Showing 1 changed file with 9 additions and 51 deletions.
60 changes: 9 additions & 51 deletions HIBALL-winterschool-2023.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"assert Version(siibra.__version__) >= Version('1.0a08')\n",
"\n",
"import matplotlib\n",
"%matplotlib notebook\n",
"from nilearn import plotting\n",
"\n",
"# ignore the following lines at this point - we just touch some objects to trigger data loading \n",
"# while we still take the introduction\n"
Expand All @@ -41,7 +41,7 @@
"metadata": {},
"outputs": [],
"source": [
"julich_brain = siibra.parcellations.get('julich 2.9')\n",
"julich_brain = siibra.parcellations.get('julich 3.1')\n",
"julich_pmaps = julich_brain.get_map('mni152', 'statistical')\n",
"julich_pmaps.fetch(region='4a left')\n",
"siibra.warm_cache()"
Expand Down Expand Up @@ -251,37 +251,6 @@
"print(amygdala.tree2str())"
]
},
{
"cell_type": "markdown",
"id": "111a852f",
"metadata": {},
"source": [
"Regions have several functions. Just as an example, we can request to compute its centroids in a given reference space, and plot them using nilearn's plotting library."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8fd48b3c",
"metadata": {},
"outputs": [],
"source": [
"centroids = amygdala.compute_centroids(\n",
" space=siibra.spaces.MNI_152_ICBM_2009C_NONLINEAR_ASYMMETRIC\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f78d5927",
"metadata": {},
"outputs": [],
"source": [
"from nilearn import plotting\n",
"plotting.view_markers(centroids.as_list(), marker_color='r')"
]
},
{
"cell_type": "markdown",
"id": "b6d7a255",
Expand Down Expand Up @@ -832,11 +801,11 @@
"outputs": [],
"source": [
"# We can plot the MNI coordinates to localize the measures and verify they are located in V1.\n",
"locations = siibra.PointSet(features[0].data.mni_xyz, space=\"mni152\")\n",
"locations = siibra.PointSet(features[0].data.mni_xyz.tolist(), space=\"mni152\")\n",
"\n",
"from nilearn import plotting\n",
"mask = v1.fetch_regional_map(\"mni152\")\n",
"display = plotting.plot_glass_brain(mask, cmap='viridis')\n",
"mask = v1.get_regional_map(\"mni152\")\n",
"display = plotting.plot_glass_brain(mask.fetch(), cmap='viridis')\n",
"display.add_markers(locations.as_list(), marker_size=2) "
]
},
Expand Down Expand Up @@ -952,28 +921,17 @@
"To access full resolution data of BigBrain, we specify a bounding box in the physical space. For now, we just define a volume of interest from two corner points in the histological space. We specify the points with a string representation, which could be conveniently copy pasted from the interactive viewer siibra explorer. Note that the coordinates can be specified by 3-tuples, and in other ways."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "941867c1",
"metadata": {},
"outputs": [],
"source": [
"space.get_template().fetch().get_bounding_box()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4814d107",
"metadata": {},
"outputs": [],
"source": [
"space = siibra.spaces.get('bigbrain')\n",
"space.\n",
"voi = space.bou(\n",
"voi = siibra.locations.BoundingBox(\n",
" point1=\"-30.590mm, 3.270mm, 47.814mm\",\n",
" point2=\"-26.557mm, 6.277mm, 50.631mm\"\n",
" point2=\"-26.557mm, 6.277mm, 50.631mm\",\n",
" space='bigbrain'\n",
")\n",
"\n",
"# Note: we can reuse the template object from above,\n",
Expand Down Expand Up @@ -1142,7 +1100,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.11.8"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 7b60742

Please sign in to comment.