convert_neurosynth_to_dataset(coordinates_file, metadata_file, annotations_files=None, feature_groups=None, target='mni152_2mm')[source]

Convert Neurosynth/NeuroQuery database files into NiMARE Dataset.

Changed in version 0.0.10:

  • Use new format for Neurosynth and NeuroQuery files.

Changed in version 0.0.9:

  • Support annotations files organized in a dictionary.

  • coordinates_file (str) – TSV.GZ file with Neurosynth/NeuroQuery’s coordinates and metadata.

  • metadata_file (str) – TSV.GZ file with Neurosynth/NeuroQuery’s metadata.

  • annotations_files (dict, list of dict, or None, optional) – Optional file(s) with Neurosynth/NeuroQuery’s annotations. This should consist of a dictionary with two keys: “features” and “vocabulary”. “features” should have an NPZ file containing a sparse matrix of feature values. “vocabulary” should have a TXT file containing labels. The vocabulary corresponds to the columns of the feature matrix, while study IDs are inferred from the metadata file, which MUST be in the same order as the features matrix. Multiple sets of annotations may be provided, in which case “annotations_files” should be a list of dictionaries. The appropriate name of each annotation set will be inferred from the “features” filename, but this can be overwritten by using the “feature_groups” parameter. Default is None.

  • feature_groups (list of str, or None, optional) – An optional list of names of annotation sets defined in “annotations_files”. This should only be used if “annotations_files” is used and the users wants to override the automatically-extracted annotation set names. Default is None.

  • target ({'mni152_2mm', 'ale_2mm'}, optional) – Target template space for coordinates. Default is ‘mni152_2mm’.


Dataset object containing experiment information from text_file.

Return type



Starting in version 0.0.10, this function operates on the new Neurosynth/NeuroQuery file format. Old code using this function will not work with the new version.

Examples using