Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
60 lines (53 sloc) 1.58 KB
def loadData(subj):
"""Load data for one subject and return
subj: str
ID of the subject who's data should be
NiftiDataset instance.
verbose(1, "Loading fMRI data from basepath"
" %s" % datapath)
# load labels and chunk information from
# file layout: one line per voxel, two rows
# (label(str), chunk(int) chunk corresponds
# to the experimental run where the volume
# was recorded
attr = SampleAttributes(
os.path.join(datapath, subj,
# load fMRI data from a NIfTI file, the data
# was previously detrended using PyMVPA's
# detrend() function.
dataset = \
datapath, subj,
# define fixed mapping of literal to
# numerical labels
'rest': 0, 'face': 1, 'house': 2,
'shoe': 3, 'cat': 4, 'scissors': 5,
'scrambledpix': 6, 'bottle': 7,
'chair': 8},
# load brain mask image to automatically
# remove non-brain voxels
datapath, subj,
# go with just four classes to speed up
# things -- still multiclass enough only
# faces, houses, shoes, cats
dataset = dataset['labels', [1,2,3,4]]
# speed up even more by just using 6 instead
# of 12 chunks, this will put two
# successive chunks into one.
coarsenChunks(dataset, 6)
# done
return dataset
Something went wrong with that request. Please try again.