neuroscout/populate/setup.py
def ingest_from_json(config_file, reingest=False, auto_fetch=False):
    """ Adds a dataset from a JSON configuration file
        Args:
            config_file - a path to a json file
            reingest - force reingest tasks
            auto_fetch - Automatically fetch and then drop nifti files
        Output:
            list of dataset model ids
    """

    with open(config_file, 'r') as f:
        config = json.load(f)

    dataset_name = config['name']
    local_path = config['path']        

    # Add dataset
    dataset_id = add_dataset(
        dataset_name=dataset_name,
        dataset_address=config.get('dataset_address'),
        dataset_summary=config.get('summary'),
        preproc_address=config['preproc_address'],
        dataset_long_description=config.get('long_description'),
        local_path=local_path,
        url=config.get('url'),
        reingest=reingest
    )

    layout = BIDSLayout(str(local_path), derivatives=True,
                        suffix='bold', extension='nii.gz')

    task_ids = []
    for task_name, params in config['tasks'].items():
        """ Add task to database"""
        task_id = add_task(
            task_name,
            dataset_name,
            local_path,
            reingest=reingest,
            layout=layout,
            auto_fetch=auto_fetch,
            **params)
        task_ids.append(task_id)  

    # Add bibliography entry
    add_to_bibliography(dataset_name, config['bib_entries'])

    return dataset_id
 Adds a dataset from a JSON configuration file
        Args:
            config_file - a path to a json file
            reingest - force reingest tasks
            auto_fetch - Automatically fetch and then drop nifti files
        Output:
            list of dataset model ids
    
Adds a dataset from a JSON configuration file
Args:
config_file - a path to a json file
reingest - force reingest tasks
auto_fetch - Automatically fetch and then drop nifti files
Output:
list of dataset model ids
Adds a dataset from a JSON configuration file Args : config_file - a path to a json file reingest - force reingest tasks auto_fetch - Automatically fetch and then drop nifti files Output : list of dataset model ids
def ingest_from_json(config_file, reingest=False, auto_fetch=False):
    with open(config_file, 'r') as f:
        config = json.load(f)
    dataset_name = config['name']
    local_path = config['path']        
    dataset_id = add_dataset(
        dataset_name=dataset_name,
        dataset_address=config.get('dataset_address'),
        dataset_summary=config.get('summary'),
        preproc_address=config['preproc_address'],
        dataset_long_description=config.get('long_description'),
        local_path=local_path,
        url=config.get('url'),
        reingest=reingest
    )
    layout = BIDSLayout(str(local_path), derivatives=True,
                        suffix='bold', extension='nii.gz')
    task_ids = []
    for task_name, params in config['tasks'].items():
        task_id = add_task(
            task_name,
            dataset_name,
            local_path,
            reingest=reingest,
            layout=layout,
            auto_fetch=auto_fetch,
            **params)
        task_ids.append(task_id)  
    add_to_bibliography(dataset_name, config['bib_entries'])
    return dataset_id
def ingest_from_json ( config_file , reingest = False , auto_fetch = False ) : with open ( config_file , 'r' ) as f : config = json . load ( f ) dataset_name = config [ 'name' ] local_path = config [ 'path' ] dataset_id = add_dataset ( dataset_name = dataset_name , dataset_address = config . get ( 'dataset_address' ) , dataset_summary = config . get ( 'summary' ) , preproc_address = config [ 'preproc_address' ] , dataset_long_description = config . get ( 'long_description' ) , local_path = local_path , url = config . get ( 'url' ) , reingest = reingest ) layout = BIDSLayout ( str ( local_path ) , derivatives = True , suffix = 'bold' , extension = 'nii.gz' ) task_ids = [ ] for task_name , params in config [ 'tasks' ] . items ( ) : """ Add task to database""" task_id = add_task ( task_name , dataset_name , local_path , reingest = reingest , layout = layout , auto_fetch = auto_fetch , ** params ) task_ids . append ( task_id ) add_to_bibliography ( dataset_name , config [ 'bib_entries' ] ) return dataset_id
Adds a dataset from a JSON configuration file
Args:
config_file - a path to a json file
reingest - force reingest tasks
auto_fetch - Automatically fetch and then drop nifti files
Output:
list of dataset model ids
Adds a dataset from a JSON configuration file Args : config_file - a path to a json file reingest - force reingest tasks auto_fetch - Automatically fetch and then drop nifti files Output : list of dataset model ids
""" Adds a dataset from a JSON configuration file
        Args:
            config_file - a path to a json file
            reingest - force reingest tasks
            auto_fetch - Automatically fetch and then drop nifti files
        Output:
            list of dataset model ids
    """ # Add dataset """ Add task to database""" # Add bibliography entry
config_file
reingest
auto_fetch