Helper Module for Deep Learning.
Module provides functions to prepare different datasets from EUAIMS.
-
class
pynet.datasets.euaims.Item(train_input_path, test_input_path, train_metadata_path, test_metadata_path)¶ -
property
test_input_path¶ Alias for field number 1
-
property
test_metadata_path¶ Alias for field number 3
-
property
train_input_path¶ Alias for field number 0
-
property
train_metadata_path¶ Alias for field number 2
-
property
-
pynet.datasets.euaims.apply_qc(data, prefix, qc)[source]¶ applies quality control to the data
- Parameters
data: pandas DataFrame
data for which we control the quality
prefix: string
prefix of the column names
qc: dict
quality control dict. keys are the name of the columns to control on, and values dict containing an order relationsip and a value as items
- Returns
data: pandas DataFrame
selected data by the quality control
-
pynet.datasets.euaims.fetch_clinical_wrapper(datasetdir='/tmp/EUAIMS', files={'rois_mapper': '/neurospin/brainomics/2020_deepint/data/EUAIMS_rois.tsv', 'stratification': '/neurospin/brainomics/2020_deepint/data/EUAIMS_stratification.tsv', 'surf_stratification': '/neurospin/brainomics/2020_deepint/data/EUAIMS_surf_stratification.tsv'}, cohort='EUAIMS', defaults={'drop_cols': ['t1:site', 't1:ageyrs', 't1:sex', 't1:fsiq', 't1:group', 't1:diagnosis', 'mri', 't1:group:name', 'qc', 'labels', 'subgroups'], 'qc': {'mri': {'eq': 1}, 'qc': {'eq': 'include'}, 't1:fsiq': {'gte': 70}}, 'return_data': False, 'seed': 42, 'test_size': 0.2, 'z_score': True})[source]¶ Fetcher wrapper for clinical data
- Parameters
datasetdir: string, default SAVING_FOLDER
path to the folder in which to save the data
files: dict, default FILES
contains the paths to the different files
cohort: string, default COHORT_NAME,
name of the cohort
subject_columns_name: string, default ‘subjects’
name of the column containing the subjects id
defaults: dict, default DEFAULTS
default values for the wrapped function
- Returns
fetcher: function
corresponding fetcher.
-
pynet.datasets.euaims.fetch_genetic_wrapper(datasetdir='/tmp/EUAIMS', files={'rois_mapper': '/neurospin/brainomics/2020_deepint/data/EUAIMS_rois.tsv', 'stratification': '/neurospin/brainomics/2020_deepint/data/EUAIMS_stratification.tsv', 'surf_stratification': '/neurospin/brainomics/2020_deepint/data/EUAIMS_surf_stratification.tsv'}, cohort='EUAIMS', defaults={'qc': {'mri': {'eq': 1}, 'qc': {'eq': 'include'}, 't1:fsiq': {'gte': 70}}, 'return_data': False, 'scores': None, 'seed': 42, 'test_size': 0.2, 'z_score': True})[source]¶ Fetcher wrapper for genetic data
- Parameters
datasetdir: string, default SAVING_FOLDER
path to the folder in which to save the data
files: dict, default FILES
contains the paths to the different files
cohort: string, default COHORT_NAME,
name of the cohort
defaults: dict, default DEFAULTS
default values for the wrapped function
- Returns
fetcher: function
corresponding fetcher
-
pynet.datasets.euaims.fetch_multiblock_euaims(datasetdir='/tmp/EUAIMS', fetchers=<function make_fetchers>, surface=False)[source]¶
-
pynet.datasets.euaims.fetch_multiblock_wrapper(datasetdir='/tmp/EUAIMS', files={'rois_mapper': '/neurospin/brainomics/2020_deepint/data/EUAIMS_rois.tsv', 'stratification': '/neurospin/brainomics/2020_deepint/data/EUAIMS_stratification.tsv', 'surf_stratification': '/neurospin/brainomics/2020_deepint/data/EUAIMS_surf_stratification.tsv'}, cohort='EUAIMS', subject_column_name='subjects', defaults={'blocks': ['clinical', 'surface-lh', 'surface-rh', 'genetic'], 'qc': {'mri': {'eq': 1}, 'qc': {'eq': 'include'}, 't1:fsiq': {'gte': 70}}, 'seed': 42, 'test_size': 0.2}, make_fetchers_func=<function make_fetchers>)[source]¶ Fetcher wrapper for multiblock data
- Parameters
datasetdir: string, default SAVING_FOLDER
path to the folder in which to save the data
files: dict, default FILES
contains the paths to the different files
cohort: string, default COHORT_NAME,
name of the cohort
subject_columns_name: string, default “subjects”
name of the column containing the subjects id
defaults: dict, default DEFAULTS
default values for the wrapped function
make_fetchers_func: function, default make_fetchers
function to build the fetchers from their wrappers. Must return a dict containing as keys the name of the channels, and values the corresponding fetcher
- Returns
fetcher: function
corresponding fetcher
-
pynet.datasets.euaims.fetch_rois_wrapper(datasetdir='/tmp/EUAIMS', files={'rois_mapper': '/neurospin/brainomics/2020_deepint/data/EUAIMS_rois.tsv', 'stratification': '/neurospin/brainomics/2020_deepint/data/EUAIMS_stratification.tsv', 'surf_stratification': '/neurospin/brainomics/2020_deepint/data/EUAIMS_surf_stratification.tsv'}, cohort='EUAIMS', site_column_name='t1:site', defaults={'adjust_sites': True, 'metrics': ['lgi:avg', 'thick:avg', 'surf:area'], 'qc': {'mri': {'eq': 1}, 'qc': {'eq': 'include'}, 't1:fsiq': {'gte': 70}}, 'residualize_by': {'continuous': ['t1:ageyrs', 't1:fsiq'], 'discrete': ['t1:sex']}, 'return_data': False, 'roi_types': ['cortical'], 'seed': 42, 'test_size': 0.2, 'z_score': True})[source]¶ Fetcher wrapper for rois data
- Parameters
datasetdir: string, default SAVING_FOLDER
path to the folder in which to save the data
files: dict, default FILES
contains the paths to the different files
cohort: string, default COHORT_NAME,
name of the cohort
site_columns_name: string, default “t1:site”
name of the column containing the site of MRI acquisition
defaults: dict, default DEFAULTS
default values for the wrapped function
- Returns
fetcher: function
corresponding fetcher
-
pynet.datasets.euaims.fetch_surface_wrapper(hemisphere, datasetdir='/tmp/EUAIMS', files={'rois_mapper': '/neurospin/brainomics/2020_deepint/data/EUAIMS_rois.tsv', 'stratification': '/neurospin/brainomics/2020_deepint/data/EUAIMS_stratification.tsv', 'surf_stratification': '/neurospin/brainomics/2020_deepint/data/EUAIMS_surf_stratification.tsv'}, cohort='EUAIMS', site_column_name='t1:site', defaults={'adjust_sites': True, 'metrics': ['pial_lgi', 'thickness'], 'qc': {'mri': {'eq': 1}, 'qc': {'eq': 'include'}, 't1:fsiq': {'gte': 70}}, 'residualize_by': {'continuous': ['t1:ageyrs', 't1:fsiq'], 'discrete': ['t1:sex']}, 'return_data': False, 'seed': 42, 'test_size': 0.2, 'z_score': True})[source]¶ Fetcher wrapper for surface data
- Parameters
hemisphere: string
name of the hemisphere data fetcher, one of “rh” or “lh”
datasetdir: string, default SAVING_FOLDER
path to the folder in which to save the data
files: dict, default FILES
contains the paths to the different files
cohort: string, default COHORT_NAME,
name of the cohort
site_columns_name: string, default “t1:site”
name of the column containing the site of MRI acquisition
defaults: dict, default DEFAULTS
default values for the wrapped function
- Returns
fetcher: function
corresponding fetcher
Follow us
Inspired by AZMIND template.