Repository: nilearn/nilearn

Issue:
difumo atlas resolution
difumo maps downloaded with `resolution_mm=2` seem to have 1.875 mm resolution
```
from nilearn import datasets, image

difumo = datasets.fetch_atlas_difumo(dimension=64, resolution_mm=2)
difumo_maps = image.load_img(difumo["maps"])
print(difumo_maps.affine)
```

also why are we downloading the `resample_dictionaries.py` script?


Discussion:
Indeed...
>difumo maps downloaded with resolution_mm=2 seem to have 1.875 mm resolution

so what do you suggest?

>also why are we downloading the resample_dictionaries.py script?

down the lane somebody should not ask a question of how it is resampled.
> so what do you suggest?

in order of preference:

- upload the maps resampled to 2mm and download these
- resample the maps in the fetcher

> so what do you suggest?
>in order of preference:

>- upload the maps resampled to 2mm and download these
>- resample the maps in the fetcher

why not modifying the doc string to 1.875

>>- upload the maps resampled to 2mm and download these
>>- resample the maps in the fetcher
>
> why not modifying the doc string to 1.875

yes that's also an option. but it is not only the docstring, the value
of resolution_mm parameter value would also have to be changed, and we
probably don't want to rely on a float comparison to identify which maps
to return (passing `resolution_mm=1.875` doesn't seem like a good
option)

I am in favor of resampling it to 2mm.
Ok. So, the option is either 2mm or 3mm and nothing else. Right? How about resample_dictionaries.py, remove?

I think there is an Open Science Framework (OSF) account in the name of Nilearn. I don't know the credentials. Currently, the files on my personal OSF account.
> I think there is an Open Science Framework (OSF) account in the name of Nilearn. I don't know the credentials. Currently, the files on my personal OSF account.
I don't have it either. maybe @kchawla-pi ? or @GaelVaroquaux ?

> Ok. So, the option is either 2mm or 3mm and nothing else. Right? How about resample_dictionaries.py, remove?

Yes. But keep resample dictionaries, that is always useful. 
>I think there is an Open Science Framework (OSF) account in the name of Nilearn. I don't know the credentials. Currently, the files on my personal OSF account.
>I don't have it either. maybe @kchawla-pi ? or @GaelVaroquaux ?

Good point. Just searched in my inria email account and found them. I shared with you again.
>     I don't have it either. maybe @kchawla-pi ? or @GaelVaroquaux ?

The account was created on Oct 8th 2018, by Kshitij, and the credentials
were shared with Kamalakar, Bertrand and myself in an email named
"NiLearn account on https://osf.io"

If you have difficulties finding it, I'll forward it again.

Got it, thx.

Resolving patch:
diff --git a/nilearn/datasets/atlas.py b/nilearn/datasets/atlas.py
--- a/nilearn/datasets/atlas.py
+++ b/nilearn/datasets/atlas.py
@@ -32,11 +32,11 @@ def fetch_atlas_difumo(dimension=64, resolution_mm=2, data_dir=None, resume=True
     -----
     Direct download links from OSF:
 
-    - 64: https://osf.io/wjum7/download
-    - 128: https://osf.io/n3vba/download
-    - 256: https://osf.io/vza2y/download
-    - 512: https://osf.io/a23gw/download
-    - 1024: https://osf.io/jpdum/download
+    - 64: https://osf.io/pqu9r/download
+    - 128: https://osf.io/wjvd5/download
+    - 256: https://osf.io/3vrct/download
+    - 512: https://osf.io/9b76y/download
+    - 1024: https://osf.io/34792/download
 
     Parameters
     ----------
@@ -77,11 +77,11 @@ def fetch_atlas_difumo(dimension=64, resolution_mm=2, data_dir=None, resume=True
        NeuroImage, Elsevier, 2020, pp.117126, https://hal.inria.fr/hal-02904869
 
     """
-    dic = {64: 'wjum7',
-           128: 'n3vba',
-           256: 'vza2y',
-           512: 'a23gw',
-           1024: 'jpdum',
+    dic = {64: 'pqu9r',
+           128: 'wjvd5',
+           256: '3vrct',
+           512: '9b76y',
+           1024: '34792',
            }
     valid_dimensions = [64, 128, 256, 512, 1024]
     valid_resolution_mm = [2, 3]
@@ -98,9 +98,9 @@ def fetch_atlas_difumo(dimension=64, resolution_mm=2, data_dir=None, resume=True
 
     csv_file = os.path.join('{0}', 'labels_{0}_dictionary.csv')
     if resolution_mm != 3:
-        nifti_file = os.path.join('{0}', 'maps.nii.gz')
+        nifti_file = os.path.join('{0}', '2mm', 'maps.nii.gz')
     else:
-        nifti_file = os.path.join('{0}', '3mm', 'resampled_maps.nii.gz')
+        nifti_file = os.path.join('{0}', '3mm', 'maps.nii.gz')
 
     files = [(csv_file.format(dimension), url, opts),
              (nifti_file.format(dimension), url, opts)]
@@ -115,17 +115,11 @@ def fetch_atlas_difumo(dimension=64, resolution_mm=2, data_dir=None, resume=True
     labels = np.recfromcsv(files_[0])
 
     # README
-    readme_files = [('README.md', 'https://osf.io/u5xhn/download',
+    readme_files = [('README.md', 'https://osf.io/4k9bf/download',
                     {'move': 'README.md'})]
     if not os.path.exists(os.path.join(data_dir, 'README.md')):
         _fetch_files(data_dir, readme_files, verbose=verbose)
 
-    # Python resampling script
-    script_files = [('resample_dictionaries.py', 'https://osf.io/ezr37/download',
-                    {'move': 'resample_dictionaries.py'})]
-    if not os.path.exists(os.path.join(data_dir, 'resample_dictionaries.py')):
-        _fetch_files(data_dir, script_files, verbose=verbose)
-
     fdescr = _get_dataset_descr(dataset_name)
 
     params = dict(description=fdescr, maps=files_[1], labels=labels)


Test patch:
diff --git a/nilearn/datasets/tests/test_atlas.py b/nilearn/datasets/tests/test_atlas.py
--- a/nilearn/datasets/tests/test_atlas.py
+++ b/nilearn/datasets/tests/test_atlas.py
@@ -372,9 +372,9 @@ def test_fetch_atlas_yeo_2011(tmp_path, request_mocker):
 def test_fetch_atlas_difumo(tmp_path, request_mocker):
     resolutions = [2, 3] # Valid resolution values
     dimensions = [64, 128, 256, 512, 1024] # Valid dimension values
-    dimension_urls =  ['wjum7','n3vba','vza2y','a23gw','jpdum']
+    dimension_urls =  ['pqu9r','wjvd5','3vrct','9b76y','34792']
     url_mapping = {k:v for k,v in zip(dimensions, dimension_urls)}
-    url_count = 2
+    url_count = 1
 
     for dim in dimensions:
         url_count += 1
@@ -390,8 +390,8 @@ def test_fetch_atlas_difumo(tmp_path, request_mocker):
         )
         root = Path("{0}".format(dim))
         archive = {root / "labels_{0}_dictionary.csv".format(dim): labels.to_csv(index=False),
-                   root / "maps.nii.gz": "",
-                   root / "3mm" / "resampled_maps.nii.gz": ""}
+                   root / "2mm" / "maps.nii.gz": "",
+                   root / "3mm" / "maps.nii.gz": ""}
         request_mocker.url_mapping[url] = dict_to_archive(archive, "zip")
 
         for res in resolutions: