prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  [DOC] Minor discrepancy in comparing means example
  ### Is there an existing issue for this?
  
  - [X] I have searched the existing issues
  
  ### Describe your proposed suggestion in detail.
  
  Using a movie watching dataset as an example but calling it "resting state" in several places
  
  ### List any pages that would be impacted.
  
  The "comparing means of images with `math_img`" example: https://nilearn.github.io/stable/auto_examples/06_manipulating_images/plot_compare_mean_image.html
  
  </issue>
  <code>
  [start of examples/06_manipulating_images/plot_compare_mean_image.py]
  1 """
  2 Comparing the means of 2 images
  3 ===============================
  4 
  5 The goal of this example is to illustrate the use of the function
  6 :func:`nilearn.image.math_img` with a list of images as input.
  7 We compare the means of 2 resting state 4D images. The mean of the images
  8 could have been computed with nilearn :func:`nilearn.image.mean_img` function.
  9 """
  10 
  11 # %%
  12 # Fetching 2 subject movie watching brain development :term:`fMRI` datasets.
  13 from nilearn import datasets
  14 
  15 dataset = datasets.fetch_development_fmri(n_subjects=2)
  16 
  17 
  18 # %%
  19 # Print basic information on the adhd subjects resting state datasets.
  20 print(f"Subject 1 resting state dataset at: {dataset.func[0]}")
  21 print(f"Subject 2 resting state dataset at: {dataset.func[1]}")
  22 
  23 
  24 # %%
  25 # Comparing the means of the 2 movie watching datasets.
  26 from nilearn import image, plotting
  27 
  28 result_img = image.math_img(
  29     "np.mean(img1, axis=-1) - np.mean(img2, axis=-1)",
  30     img1=dataset.func[0],
  31     img2=dataset.func[1],
  32 )
  33 
  34 plotting.plot_stat_map(
  35     result_img, title="Comparing means of 2 resting state 4D images."
  36 )
  37 plotting.show()
  38
  [end of examples/06_manipulating_images/plot_compare_mean_image.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/examples/06_manipulating_images/plot_compare_mean_image.py b/examples/06_manipulating_images/plot_compare_mean_image.py
  --- a/examples/06_manipulating_images/plot_compare_mean_image.py
  +++ b/examples/06_manipulating_images/plot_compare_mean_image.py
  @@ -4,7 +4,7 @@
   
   The goal of this example is to illustrate the use of the function
   :func:`nilearn.image.math_img` with a list of images as input.
  -We compare the means of 2 resting state 4D images. The mean of the images
  +We compare the means of 2 movie watching 4D images. The mean of the images
   could have been computed with nilearn :func:`nilearn.image.mean_img` function.
   """
   
  @@ -16,9 +16,9 @@
   
   
   # %%
  -# Print basic information on the adhd subjects resting state datasets.
  -print(f"Subject 1 resting state dataset at: {dataset.func[0]}")
  -print(f"Subject 2 resting state dataset at: {dataset.func[1]}")
  +# Print file locations for both subjects.
  +print(f"Subject 1 dataset at: {dataset.func[0]}")
  +print(f"Subject 2 dataset at: {dataset.func[1]}")
   
   
   # %%
  @@ -32,6 +32,6 @@
   )
   
   plotting.plot_stat_map(
  -    result_img, title="Comparing means of 2 resting state 4D images."
  +    result_img, title="Comparing means of 2 movie watching 4D images."
   )
   plotting.show()
  
verification_info: {"golden_diff": "diff --git a/examples/06_manipulating_images/plot_compare_mean_image.py b/examples/06_manipulating_images/plot_compare_mean_image.py\n--- a/examples/06_manipulating_images/plot_compare_mean_image.py\n+++ b/examples/06_manipulating_images/plot_compare_mean_image.py\n@@ -4,7 +4,7 @@\n \n The goal of this example is to illustrate the use of the function\n :func:`nilearn.image.math_img` with a list of images as input.\n-We compare the means of 2 resting state 4D images. The mean of the images\n+We compare the means of 2 movie watching 4D images. The mean of the images\n could have been computed with nilearn :func:`nilearn.image.mean_img` function.\n \"\"\"\n \n@@ -16,9 +16,9 @@\n \n \n # %%\n-# Print basic information on the adhd subjects resting state datasets.\n-print(f\"Subject 1 resting state dataset at: {dataset.func[0]}\")\n-print(f\"Subject 2 resting state dataset at: {dataset.func[1]}\")\n+# Print file locations for both subjects.\n+print(f\"Subject 1 dataset at: {dataset.func[0]}\")\n+print(f\"Subject 2 dataset at: {dataset.func[1]}\")\n \n \n # %%\n@@ -32,6 +32,6 @@\n )\n \n plotting.plot_stat_map(\n-    result_img, title=\"Comparing means of 2 resting state 4D images.\"\n+    result_img, title=\"Comparing means of 2 movie watching 4D images.\"\n )\n plotting.show()\n", "issue": "[DOC] Minor discrepancy in comparing means example\n### Is there an existing issue for this?\n\n- [X] I have searched the existing issues\n\n### Describe your proposed suggestion in detail.\n\nUsing a movie watching dataset as an example but calling it \"resting state\" in several places\n\n### List any pages that would be impacted.\n\nThe \"comparing means of images with `math_img`\" example: https://nilearn.github.io/stable/auto_examples/06_manipulating_images/plot_compare_mean_image.html\n", "before_files": [{"content": "\"\"\"\nComparing the means of 2 images\n===============================\n\nThe goal of this example is to illustrate the use of the function\n:func:`nilearn.image.math_img` with a list of images as input.\nWe compare the means of 2 resting state 4D images. The mean of the images\ncould have been computed with nilearn :func:`nilearn.image.mean_img` function.\n\"\"\"\n\n# %%\n# Fetching 2 subject movie watching brain development :term:`fMRI` datasets.\nfrom nilearn import datasets\n\ndataset = datasets.fetch_development_fmri(n_subjects=2)\n\n\n# %%\n# Print basic information on the adhd subjects resting state datasets.\nprint(f\"Subject 1 resting state dataset at: {dataset.func[0]}\")\nprint(f\"Subject 2 resting state dataset at: {dataset.func[1]}\")\n\n\n# %%\n# Comparing the means of the 2 movie watching datasets.\nfrom nilearn import image, plotting\n\nresult_img = image.math_img(\n    \"np.mean(img1, axis=-1) - np.mean(img2, axis=-1)\",\n    img1=dataset.func[0],\n    img2=dataset.func[1],\n)\n\nplotting.plot_stat_map(\n    result_img, title=\"Comparing means of 2 resting state 4D images.\"\n)\nplotting.show()\n", "path": "examples/06_manipulating_images/plot_compare_mean_image.py"}]}