Handler for datasets following the openfmri.org layout specifications
At present, this handler provides functions to query and access a number of dataset properties, BOLD images of individual acquisition runs, build datasets from individual BOLD images, and load stimulation design specifications for individual runs.
Methods
get_anatomy_image(subj[, path, fname]) | Return a NiBabel image instance for a structural image of a subject. |
get_bold_run_dataset(subj, task, run[, ...]) | Return a dataset instance for the BOLD data of a particular subject/task/run combination. |
get_bold_run_ids(subj, task) | Return (sorted) list of run IDs for a given subject and task |
get_bold_run_image(subj, task, run[, flavor]) | Return a NiBabel image instance for the BOLD data of a particular subject/task/run combination. |
get_bold_run_model(model, subj, run) | Return the stimulation design for a particular subject/task/run. |
get_bold_run_motion_estimates(subj, task, run) | Return the volume-wise motion estimates for a particular BOLD run |
get_model_bold_dataset(model_id, subj_id[, ...]) | Build a PyMVPA dataset for a model defined in the OpenFMRI dataset |
get_model_conditions(model) | Return a description of all conditions for a given model |
get_model_contrasts(model) | Return a defined contrasts for a model |
get_model_descriptions() | Return a dictionary with the models described in the dataset |
get_model_ids() | Return a sorted list of integer IDs for all available models |
get_scan_properties() | Return a dictionary with the scan properties listed in scan_key.txt |
get_subj_ids() | Return a (sorted) list of IDs for all subjects in the dataset |
get_task_bold_attributes(task, fname, loadfx) | Return data attributes for all BOLD data from a specific task. |
get_task_bold_run_ids(task) | Return a dictionary with run IDs by subjects for a given task |
get_task_descriptions() | Return a dictionary with the tasks defined in the dataset |
Parameters: | basedir : path
|
---|
Methods
get_anatomy_image(subj[, path, fname]) | Return a NiBabel image instance for a structural image of a subject. |
get_bold_run_dataset(subj, task, run[, ...]) | Return a dataset instance for the BOLD data of a particular subject/task/run combination. |
get_bold_run_ids(subj, task) | Return (sorted) list of run IDs for a given subject and task |
get_bold_run_image(subj, task, run[, flavor]) | Return a NiBabel image instance for the BOLD data of a particular subject/task/run combination. |
get_bold_run_model(model, subj, run) | Return the stimulation design for a particular subject/task/run. |
get_bold_run_motion_estimates(subj, task, run) | Return the volume-wise motion estimates for a particular BOLD run |
get_model_bold_dataset(model_id, subj_id[, ...]) | Build a PyMVPA dataset for a model defined in the OpenFMRI dataset |
get_model_conditions(model) | Return a description of all conditions for a given model |
get_model_contrasts(model) | Return a defined contrasts for a model |
get_model_descriptions() | Return a dictionary with the models described in the dataset |
get_model_ids() | Return a sorted list of integer IDs for all available models |
get_scan_properties() | Return a dictionary with the scan properties listed in scan_key.txt |
get_subj_ids() | Return a (sorted) list of IDs for all subjects in the dataset |
get_task_bold_attributes(task, fname, loadfx) | Return data attributes for all BOLD data from a specific task. |
get_task_bold_run_ids(task) | Return a dictionary with run IDs by subjects for a given task |
get_task_descriptions() | Return a dictionary with the tasks defined in the dataset |
Return a NiBabel image instance for a structural image of a subject.
Parameters: | subj : int
path : list or None
fname : str
|
---|---|
Returns: | NiBabel Nifti1Image : |
Return a dataset instance for the BOLD data of a particular subject/task/run combination.
This method support the same functionality as fmri_dataset(), while wrapping get_bold_run_image() to access the input fMRI data. Additional attributes, such as subject ID, task ID, and run ID are automatically stored as dataset sample attributes.
Parameters: | subj : int
task : int
run : int
flavor : None or str
preproc_img : callable or None
add_sa: str or tuple(str) :
**kwargs: :
|
---|---|
Returns: | Dataset : |
Return (sorted) list of run IDs for a given subject and task
Typically, run IDs are integer values, but string IDs are supported as well.
Parameters: | subj : int or str
task : int or str
|
---|
Return a NiBabel image instance for the BOLD data of a particular subject/task/run combination.
Parameters: | subj : int
task : int
run : int
flavor : None or str
|
---|
Return the stimulation design for a particular subject/task/run.
Parameters: | model : int
subj : int
run : int
|
---|---|
Returns: | list :
|
Return the volume-wise motion estimates for a particular BOLD run
Parameters: | subj : int
task : int
run : int
fname : str
|
---|---|
Returns: | array :
|
Build a PyMVPA dataset for a model defined in the OpenFMRI dataset
Parameters: | model_id : int
subj_id : int or str or list
run_ids : list, optional
preproc_img : callable or None
preproc_ds : callable or None
modelfx : callable or None
stack : boolean
flavor :
mask :
add_fa :
add_sa :
|
---|---|
Returns: | Dataset or list :
|
Return a description of all conditions for a given model
Parameters: | model : int
|
---|---|
Returns: | list(dict) :
|
Return a defined contrasts for a model
Parameters: | model : int
|
---|---|
Returns: | dict(dict) :
|
Return a dictionary with the models described in the dataset
Dictionary keys are integer model IDs, values are description strings.
Note that the return dictionary is not necessarily comprehensive. It only reflects the models described in model_key.txt. If a dataset is inconsistently described, get_model_ids() actually may discover more or less models in comparison to the avauilable model descriptions.
Return a sorted list of integer IDs for all available models
Return a dictionary with the scan properties listed in scan_key.txt
Return a (sorted) list of IDs for all subjects in the dataset
Standard numerical subject IDs a returned as integer values. All other types of IDs are returned as strings with the ‘sub’ prefix stripped.
Return data attributes for all BOLD data from a specific task.
This function can load arbitrary data from the directories where the relevant BOLD image files are stored. Data sources are described by specifying the file name containing the data in the BOLD directory, and by providing a function that returns the file content in array form. Optionally, data from specific subjects can be skipped.
For example, this function can be used to access motion estimates.
Parameters: | task : int
fname : str
loadfx : functor
exclude_subjs : list or None
|
---|---|
Returns: | list(dict(array)) :
|
Return a dictionary with run IDs by subjects for a given task
Dictionary keys are subject IDs, values are lists of run IDs.
Return a dictionary with the tasks defined in the dataset
Dictionary keys are integer task IDs, values are task description strings.