src.utils.util.prepare_fmri_data

prepare_fmri_data(all_data, data_subset, class_ignore_list, label_level, roi_select_list)[source]

Prepare data for modelling.

First filters data by class. Then rescales the image to [0-255] scale.

Parameters
  • all_data – Dictionary of numpy arrays which contains all data.

  • data_subset – A string value that denotes the train/test subset. Can only be “train” or “test”.

  • class_ignore_list – A list of class labels to ignore.

  • label_level – An integer that denotes the label hierarchy level. Lies between [0,3].

  • roi_select_list – List of integers between [1, 7] that contain the roi id to use.

Returns

A tuple of numpy arrays which contains image and output class labels.

Return type

tuple

Raises
  • ValueError – If label_level does not lie between [0, 3].

  • ValueError – If data_subset does not contain either “train” or “test”.

  • ValueError – If class_ignore_list is empty.

Return type

tuple