BrainStat icon indicating copy to clipboard operation
BrainStat copied to clipboard

The urls of bigbrain histology data for fslr32k is actually 64k, not 32k

Open YCHuang0610 opened this issue 6 months ago • 0 comments

  • What is the current behavior?

When running the following code: histology_profiles = read_histology_profile(template="fslr32k"), the error will occur:

"File /opt/miniconda3/envs/imagingwork/lib/python3.8/site-packages/brainstat/context/histology.py:159, in read_histology_profile(data_dir, template, overwrite)
    [154](https://file+.vscode-resource.vscode-cdn.net/opt/miniconda3/envs/imagingwork/lib/python3.8/site-packages/brainstat/context/histology.py:154)     download_histology_profiles(
    [155](https://file+.vscode-resource.vscode-cdn.net/opt/miniconda3/envs/imagingwork/lib/python3.8/site-packages/brainstat/context/histology.py:155)         data_dir=data_dir, template=template, overwrite=overwrite
    [156](https://file+.vscode-resource.vscode-cdn.net/opt/miniconda3/envs/imagingwork/lib/python3.8/site-packages/brainstat/context/histology.py:156)     )
    [158](https://file+.vscode-resource.vscode-cdn.net/opt/miniconda3/envs/imagingwork/lib/python3.8/site-packages/brainstat/context/histology.py:158) with h5py.File(histology_file, "r") as h5_file:
--> [159](https://file+.vscode-resource.vscode-cdn.net/opt/miniconda3/envs/imagingwork/lib/python3.8/site-packages/brainstat/context/histology.py:159)     profiles = h5_file.get(template)[...]
    [160](https://file+.vscode-resource.vscode-cdn.net/opt/miniconda3/envs/imagingwork/lib/python3.8/site-packages/brainstat/context/histology.py:160)     if civet_template:
    [161](https://file+.vscode-resource.vscode-cdn.net/opt/miniconda3/envs/imagingwork/lib/python3.8/site-packages/brainstat/context/histology.py:161)         fsaverage_surface = fetch_template_surface("fsaverage")

TypeError: 'NoneType' object is not subscriptable"

I debugged it and found that the bigbrain_profiles download from the urls for template "fslr32k" in brainstat/data/data_urls.json is actually for the template "fs_LR_64k", not "fslr32k".

    },
    "bigbrain_profiles": {
        "fsaverage": {
            "url": "https://box.bic.mni.mcgill.ca/s/znBp7Emls0mMW1a/download"
        },
        "fsaverage5": {
            "url": "https://box.bic.mni.mcgill.ca/s/N8zstvuRb4sNcSe/download"
        },
        "fslr32k": {
            "url": "https://box.bic.mni.mcgill.ca/s/6zKHcg9xXu5inPR/download"
        }
    },

Maybe this can be fixed by modifing the fslr32k to fslr64k and downsampling the mesh.

YCHuang0610 avatar Aug 16 '24 04:08 YCHuang0610