datahipy.handlers.dataset module

Manage BIDS dataset using BIDS Manager.

class datahipy.handlers.dataset.DatasetHandler(dataset_path=None)[source]

Bases: object

Class to represent the handler of a dataset with utility functions.

static add_keys_requirements(ds_obj=None, clin_keys=None)[source]

Update the requirements.json with new keys.

static check_converters(ds_obj=None)[source]

Check if the converters are specified and (re)write the requirements.json if necessary.

dataset_create(input_data=None)[source]

Create a new BIDS dataset.

dataset_get_content(input_data=None, output_file=None)[source]

Extract dataset information indexed by the HIP platform.

static dump_output_file(output_data=None, output_file=None)[source]

Dump output_data dict in a JSON file.

static get_run(root_dir: str, bids_entities: dict, bids_modality: str)[source]

Parse the BIDS dataset to get the max run for a set of BIDS entities.

static load_input_data(input_data)[source]

Return input_data JSON file in a dict.

static make_safe_filename(s)[source]

Return a modified version of the string that contains only alphanumeric characters (letters and numbers).

Any other character in the original string is replaced by an underscore (_). The function also removes any trailing underscores from the end of the modified string.

Parameters

s: str

Input string

Return

String that contains only alphanumeric characters.