nimare.parcellate.mapbot.MAPBOT

class MAPBOT(tfidf_df, coordinates_df, mask)[source]

Meta-analytic parcellation based on text (MAPBOT).

Parameters
  • tfidf_df (pandas.DataFrame) – A DataFrame with feature counts for the model. The index is ‘id’, used for identifying studies. Other columns are features (e.g., unigrams and bigrams from Neurosynth), where each value is the number of times the feature is found in a given article.

  • coordinates_df (pandas.DataFrame) – A DataFrame with a list of foci in the dataset. The index is ‘id’, used for identifying studies. Additional columns include ‘i’, ‘j’ and ‘k’ (the matrix indices of the foci in standard space).

  • mask (str or nibabel.Nifti1.Nifti1Image) – Mask file or image.

Notes

MAPBOT uses both the reported foci for studies, as well as associated term weights. Here are the steps:

  1. For each voxel in the mask, identify studies in dataset corresponding to that voxel. Selection criteria can be either based on a distance threshold (e.g., all studies with foci within 5mm of voxel) or based on a minimum number of studies (e.g., the 50 studies reporting foci closest to the voxel).

  2. For each voxel, compute average frequency of each term across selected studies. This results in an n_voxels X n_terms frequency matrix F.

  3. Compute n_voxels X n_voxels value matrix V: - D = (F.T * F) * ones(F) - V = F * D^-.5

  4. Perform non-negative matrix factorization on value matrix.

Warning

This method is not yet implemented.

References

fit(target_mask, method='min_distance', r=5, n_exps=50, n_parcels=2)[source]

Run MAPBOT parcellation.

Parameters
  • region_name (str) – Name of region for parcellation.

  • n_parcels (int, optional) – Number of parcels to generate for ROI. If array_like, each parcel number will be evaluated and results for all will be returned. Default is 2.

get_params(deep=True)[source]

Get parameters for this estimator.

Parameters

deep (boolean, optional) – If True, will return the parameters for this estimator and contained subobjects that are estimators.

Returns

params (mapping of string to any) – Parameter names mapped to their values.

classmethod load(filename, compressed=True)[source]

Load a pickled class instance from file.

Parameters
  • filename (str) – Name of file containing object.

  • compressed (bool, optional) – If True, the file is assumed to be compressed and gzip will be used to load it. Otherwise, it will assume that the file is not compressed. Default = True.

Returns

obj (class object) – Loaded class object.

save(filename, compress=True)[source]

Pickle the class instance to the provided file.

Parameters
  • filename (str) – File to which object will be saved.

  • compress (bool, optional) – If True, the file will be compressed with gzip. Otherwise, the uncompressed version will be saved. Default = True.

set_params(**params)[source]

Set the parameters of this estimator.

The method works on simple estimators as well as on nested objects (such as pipelines). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object.

Returns

self