API

cubids.cubids: Main Module

cubids.cubids.CuBIDS(data_root[, ...])

The main CuBIDS class.

cubids.workflows: Workflow Functions

workflows.validate(bids_dir, output_prefix, ...)

Run the bids validator.

workflows.bids_sidecar_merge(from_json, to_json)

Merge critical keys from one sidecar to another.

workflows.group(bids_dir, acq_group_level, ...)

Find key and param groups.

workflows.apply(bids_dir, use_datalad, ...)

Apply the tsv changes.

workflows.datalad_save(bids_dir, m[, n_cpus])

Perform datalad save.

workflows.undo(bids_dir)

Revert the most recent commit.

workflows.copy_exemplars(bids_dir, ...)

Create and save a directory with one subject from each acquisition group.

workflows.add_nifti_info(bids_dir, ...[, n_cpus])

Add information from nifti files to the dataset's sidecars.

workflows.add_file_collections(bids_dir, ...)

Add file collection metadata to the sidecars of each NIfTI file in the BIDS dataset.

workflows.purge(bids_dir, use_datalad, scans)

Purge scan associations.

workflows.remove_metadata_fields(bids_dir, ...)

Delete fields from metadata.

workflows.print_metadata_fields(bids_dir)

Print unique metadata fields from a BIDS dataset.

cubids.entity_sets: Scripted Entity Set Changes

entity_sets.parse_entity_set(value)

Validate an entity set copied from the summary and return it.

entity_sets.load_entity_set_changes(...)

Load exact entity set substitutions from CLI strings or mapping tables.

entity_sets.load_entity_set_removals(...)

Load exact entity sets to delete from CLI strings or table files.

entity_sets.apply_entity_set_changes(...)

Apply exact entity set substitutions to a summary dataframe in memory.

entity_sets.apply_entity_set_removals(...)

Mark parameter groups with exact planned entity sets for deletion.

cubids.file_collections: File Collections

file_collections.get_collection_rules(schema)

Build the file collection rules that apply to a dataset from the BIDS schema.

file_collections.get_collection_rule(rules, ...)

Return the rule for the collection a file can belong to.

file_collections.collection_context(...)

Build a key shared by exactly the files in one collection.

file_collections.collect_file_collections(...)

Build a list of files in a file collection for a given base file.

file_collections.analyze_collection_variant_consistency(...)

Inspect file collections and propose aligned variants.

file_collections.apply_collection_variant_proposals(...)

Write globally unambiguous file-collection rename suggestions into a summary.

file_collections.validate_collection_deletions(...)

Fail before mutation when deletions would split a file collection.

file_collections.validate_collection_renames(...)

Ensure every file collection being renamed has compatible planned entities.

cubids.metadata_merge: Merging Metadata

metadata_merge.check_merging_operations(...)

Check that the merges in an action tsv are possible.

metadata_merge.merge_without_overwrite(...)

Perform a safe metadata copy.

metadata_merge.merge_json_into_json(...[, ...])

Merge imaging metadata into JSON.

metadata_merge.get_acq_dictionary([...])

Create a BIDS data dictionary from dataframe columns.

metadata_merge.group_by_acquisition_sets(...)

Find unique sets of Key/Param groups across subjects.

cubids.validator: Validation

validator.build_validator_call(path[, ...])

Build a subprocess command to the bids validator.

validator.build_subject_paths(bids_dir)

Build a dictionary of BIDS directories with one subject each.

validator.run_validator(call)

Run the validator with subprocess.

validator.parse_validator_output(output)

Parse the JSON output of the BIDS validator into a pandas dataframe.

validator.get_val_dictionary()

Get value dictionary.