The NeuroVault database (https://neurovault.org/) is a: > place where researchers can publicly store and share unthresholded statistical maps, parcellations, and atlases produced by MRI and PET studies.
This allows researchers to compare results from multiple studies.
The NeuroVault API (https://neurovault.org/api-docs) allows users to access this data with some calls to a RESTful API.
The neurovault
package wraps these commands using httr
. Here we will look
library(neurovault)
res = nv_collection_images(id = 77)
#> GET command is:
#> Response [https://neurovault.org/api/collections/77/images/]
#> Date: 2017-11-30 19:25
#> Status: 200
#> Content-Type: application/json; charset=utf-8
#> Size: 5.11 kB
df = results_to_df(res$content$results)
head(df)
#> url id
#> 1 https://neurovault.org/images/330/ 330
#> 2 https://neurovault.org/images/331/ 331
#> 3 https://neurovault.org/images/332/ 332
#> 4 https://neurovault.org/images/333/ 333
#> file
#> 1 https://neurovault.org/media/images/77/zstat-young.nii.gz
#> 2 https://neurovault.org/media/images/77/zstat-old.nii.gz
#> 3 https://neurovault.org/media/images/77/zstat-young-old.nii.gz
#> 4 https://neurovault.org/media/images/77/zstat-old-young.nii.gz
#> collection collection_id file_size
#> 1 https://neurovault.org/collections/77/ 77 537724
#> 2 https://neurovault.org/collections/77/ 77 534984
#> 3 https://neurovault.org/collections/77/ 77 538597
#> 4 https://neurovault.org/collections/77/ 77 538602
#> cognitive_paradigm_cogatlas cognitive_paradigm_cogatlas_id
#> 1 color-word stroop with task switching trm_5542841f3dcd5
#> 2 color-word stroop with task switching trm_5542841f3dcd5
#> 3 color-word stroop with task switching trm_5542841f3dcd5
#> 4 color-word stroop with task switching trm_5542841f3dcd5
#> cognitive_contrast_cogatlas cognitive_contrast_cogatlas_id map_type
#> 1 NA NA Z map
#> 2 NA NA Z map
#> 3 NA NA Z map
#> 4 NA NA Z map
#> analysis_level name description
#> 1 NA zstat-young.nii.gz FSL4.1
#> 2 NA zstat-old.nii.gz FSL4.1
#> 3 NA zstat-young-old.nii.gz FSL4.1
#> 4 NA zstat-old-young.nii.gz FSL4.1
#> add_date modify_date is_valid
#> 1 2016-01-21T17:22:27.296097Z 2016-01-27T21:44:15.371143Z TRUE
#> 2 2016-01-21T17:23:08.244431Z 2016-01-27T21:47:02.792579Z TRUE
#> 3 2016-01-21T17:21:38.899847Z 2016-01-27T21:41:38.264132Z TRUE
#> 4 2016-01-21T17:21:38.923925Z 2016-01-27T21:41:38.335981Z TRUE
#> surface_left_file surface_right_file data_origin figure
#> 1 NA NA volume
#> 2 NA NA volume
#> 3 NA NA volume
#> 4 NA NA volume
#> thumbnail
#> 1 https://neurovault.org/media/images/77/glass_brain_330.jpg
#> 2 https://neurovault.org/media/images/77/glass_brain_331.jpg
#> 3 https://neurovault.org/media/images/77/glass_brain_332_1.jpg
#> 4 https://neurovault.org/media/images/77/glass_brain_333_1.jpg
#> reduced_representation
#> 1 https://neurovault.org/media/images/77/transform_4mm_330.npy
#> 2 https://neurovault.org/media/images/77/transform_4mm_331.npy
#> 3 https://neurovault.org/media/images/77/transform_4mm_332.npy
#> 4 https://neurovault.org/media/images/77/transform_4mm_333.npy
#> is_thresholded perc_bad_voxels not_mni brain_coverage
#> 1 FALSE 84.39691 FALSE 55.60851
#> 2 FALSE 84.39691 FALSE 55.60851
#> 3 FALSE 84.39691 FALSE 55.60851
#> 4 FALSE 84.39691 FALSE 55.60851
#> perc_voxels_outside number_of_subjects modality statistic_parameters
#> 1 9.785711 64 fMRI-BOLD NA
#> 2 9.785711 64 fMRI-BOLD NA
#> 3 9.785711 64 fMRI-BOLD NA
#> 4 9.785711 64 fMRI-BOLD NA
#> smoothness_fwhm contrast_definition
#> 1 NA stroop inference versus color naming
#> 2 NA stroop inference versus color naming
#> 3 NA stroop inference versus color naming
#> 4 NA stroop inference versus color naming
#> contrast_definition_cogatlas cognitive_paradigm_description_url
#> 1 NA
#> 2 NA
#> 3 NA
#> 4 NA
#> image_type
#> 1 statistic_map
#> 2 statistic_map
#> 3 statistic_map
#> 4 statistic_map
We can download and view a labeled atlas for the results:
library(neurobase)
#> Loading required package: oro.nifti
#> oro.nifti 0.9.2
res = download_nv_atlas(id = 1408)
#> GET command is:
#> Response [https://neurovault.org/api/atlases/1408/]
#> Date: 2017-11-30 19:25
#> Status: 200
#> Content-Type: application/json; charset=utf-8
#> Size: 751 B
#>
#>
|
| | 0%
|
|=================================================================| 100%
#>
|
| | 0%
|
|=================================================================| 100%
atlas = readnii(res$outfile[1])
ortho2(atlas)
You can access the neuroimaging data model (NIDM) (http://nidm.nidash.org/) information using:
nidm = nv_nidm_results()
#> GET command is:
#> Response [https://neurovault.org/api/nidm_results/]
#> Date: 2017-11-30 19:25
#> Status: 200
#> Content-Type: application/json; charset=utf-8
#> Size: 201 kB
#> Multiple pages must be called - more results than 1 call
#> GET command is:
#> Response [https://neurovault.org/api/nidm_results/?limit=100&offset=100]
#> Date: 2017-11-30 19:25
#> Status: 200
#> Content-Type: application/json; charset=utf-8
#> Size: 272 kB
#> GET command is:
#> Response [https://neurovault.org/api/nidm_results/?limit=100&offset=200]
#> Date: 2017-11-30 19:26
#> Status: 200
#> Content-Type: application/json; charset=utf-8
#> Size: 432 kB
#> GET command is:
#> Response [https://neurovault.org/api/nidm_results/?limit=100&offset=300]
#> Date: 2017-11-30 19:26
#> Status: 500
#> Content-Type: text/html
#> Size: 27 B
#> Warning in get_results(url = next_url, query = query, verbose = verbose, :
#> Internal Server Error (HTTP 500).
#> No encoding supplied: defaulting to UTF-8.
#> Warning in append_results(content = L$content, verbose = verbose, max_count
#> = max_count, : Not all records received, may be a problem with the call