Repository: nilearn/nilearn

Issue:
Update examples that use old atlas API to showcase new behavior
After merge #3353, examples that use the now deprecated API for 3 atlases need to be updated.

Effected examples:
- examples/00_tutorials/plot_3d_and_4d_niimg.py
- examples/01_plotting/plot_multiscale_parcellations.py
- examples/01_plotting/plot_prob_atlas.py


Discussion:
@achamma723 can you take care of that ?
> @achamma723 can you take care of that ?

Hello @bthirion, sure I'll work on it!


Resolving patch:
diff --git a/examples/00_tutorials/plot_3d_and_4d_niimg.py b/examples/00_tutorials/plot_3d_and_4d_niimg.py
--- a/examples/00_tutorials/plot_3d_and_4d_niimg.py
+++ b/examples/00_tutorials/plot_3d_and_4d_niimg.py
@@ -47,7 +47,7 @@
 #
 # We can download resting-state networks from the Smith 2009 study on
 # correspondence between rest and task
-rsn = datasets.fetch_atlas_smith_2009()["rsn10"]
+rsn = datasets.fetch_atlas_smith_2009(resting=True, dimension=10)["map"]
 rsn
 
 ###############################################################################
diff --git a/examples/01_plotting/plot_multiscale_parcellations.py b/examples/01_plotting/plot_multiscale_parcellations.py
--- a/examples/01_plotting/plot_multiscale_parcellations.py
+++ b/examples/01_plotting/plot_multiscale_parcellations.py
@@ -19,12 +19,16 @@
 # import datasets module and use `fetch_atlas_basc_multiscale_2015` function
 from nilearn import datasets
 
-parcellations = datasets.fetch_atlas_basc_multiscale_2015(version="sym")
+parcellations = [
+    datasets.fetch_atlas_basc_multiscale_2015(version="sym", resolution=64),
+    datasets.fetch_atlas_basc_multiscale_2015(version="sym", resolution=197),
+    datasets.fetch_atlas_basc_multiscale_2015(version="sym", resolution=444),
+]
 
 # We show here networks of 64, 197, 444
-networks_64 = parcellations["scale064"]
-networks_197 = parcellations["scale197"]
-networks_444 = parcellations["scale444"]
+networks_64 = parcellations[0]["map"]
+networks_197 = parcellations[1]["map"]
+networks_444 = parcellations[2]["map"]
 
 ###############################################################################
 # Visualizing brain parcellations
diff --git a/examples/01_plotting/plot_prob_atlas.py b/examples/01_plotting/plot_prob_atlas.py
--- a/examples/01_plotting/plot_prob_atlas.py
+++ b/examples/01_plotting/plot_prob_atlas.py
@@ -22,6 +22,7 @@
 See :ref:`plotting` for more information to know how to tune the parameters.
 """
 # Load 4D probabilistic atlases
+from nilearn import plotting
 from nilearn import datasets
 
 # Harvard Oxford Atlasf
@@ -32,7 +33,24 @@
 msdl = datasets.fetch_atlas_msdl()
 
 # Smith ICA Atlas and Brain Maps 2009
-smith = datasets.fetch_atlas_smith_2009()
+smith_rsn10 = datasets.fetch_atlas_smith_2009(resting=True, dimension=10)[
+    "map"
+]
+smith_rsn20 = datasets.fetch_atlas_smith_2009(resting=True, dimension=20)[
+    "map"
+]
+smith_rsn70 = datasets.fetch_atlas_smith_2009(resting=True, dimension=70)[
+    "map"
+]
+smith_bm10 = datasets.fetch_atlas_smith_2009(resting=False, dimension=10)[
+    "map"
+]
+smith_bm20 = datasets.fetch_atlas_smith_2009(resting=False, dimension=20)[
+    "map"
+]
+smith_bm70 = datasets.fetch_atlas_smith_2009(resting=False, dimension=70)[
+    "map"
+]
 
 # ICBM tissue probability
 icbm = datasets.fetch_icbm152_2009()
@@ -51,17 +69,16 @@
 )
 
 # Visualization
-from nilearn import plotting
 
 atlas_types = {
     "Harvard_Oxford": harvard_oxford.maps,
     "Harvard_Oxford sub": harvard_oxford_sub.maps,
     "MSDL": msdl.maps,
-    "Smith 2009 10 RSNs": smith.rsn10,
-    "Smith2009 20 RSNs": smith.rsn20,
-    "Smith2009 70 RSNs": smith.rsn70,
-    "Smith2009 20 Brainmap": smith.bm20,
-    "Smith2009 70 Brainmap": smith.bm70,
+    "Smith 2009 10 RSNs": smith_rsn10,
+    "Smith2009 20 RSNs": smith_rsn20,
+    "Smith2009 70 RSNs": smith_rsn70,
+    "Smith2009 20 Brainmap": smith_bm20,
+    "Smith2009 70 Brainmap": smith_bm70,
     "ICBM tissues": (icbm["wm"], icbm["gm"], icbm["csf"]),
     "Allen2011": allen.rsn28,
     "Pauli2017 Subcortical Atlas": subcortex.maps,
@@ -73,7 +90,9 @@
 
 # An optional colorbar can be set
 plotting.plot_prob_atlas(
-    smith.bm10, title="Smith2009 10 Brainmap (with" " colorbar)", colorbar=True
+    smith_bm10,
+    title="Smith2009 10 Brainmap (with colorbar)",
+    colorbar=True,
 )
 print("ready")
 plotting.show()


Test patch: