NWBConverter#

class NWBConverter(source_data: Dict[str, dict], verbose: bool = True)[source]#

Bases: object

Primary class for all NWB conversion classes.

Validate source_data against source_schema and initialize all data interfaces.

classmethod get_source_schema() dict[source]#

Compile input schemas from each of the data interface classes.

get_conversion_options_schema() dict[source]#

Compile conversion option schemas from each of the data interface classes.

classmethod validate_source(source_data: Dict[str, dict], verbose: bool = True)[source]#

Validate source_data against Converter source_schema.

get_metadata_schema() dict[source]#

Compile metadata schemas from each of the data interface objects.

get_metadata() DeepDict[source]#

Auto-fill as much of the metadata as possible. Must comply with metadata schema.

validate_metadata(metadata: Dict[str, dict])[source]#

Validate metadata against Converter metadata_schema.

validate_conversion_options(conversion_options: Dict[str, dict])[source]#

Validate conversion_options against Converter conversion_options_schema.

run_conversion(nwbfile_path: Optional[str] = None, nwbfile: Optional[NWBFile] = None, metadata: Optional[dict] = None, overwrite: bool = False, conversion_options: Optional[dict] = None) None[source]#

Run the NWB conversion over all the instantiated data interfaces. :Parameters: * nwbfile_path (FilePathType) – Path for where to write or load (if overwrite=False) the NWBFile.

If specified, the context will always write to this location.

  • nwbfile (NWBFile, optional) – An in-memory NWBFile object to write to the location.

  • metadata (dict, optional) – Metadata dictionary with information used to create the NWBFile when one does not exist or overwrite=True.

  • overwrite (bool, default: False) – Whether to overwrite the NWBFile if one exists at the nwbfile_path. The default is False (append mode).

  • conversion_options (dict, optional) – Similar to source_data, a dictionary containing keywords for each interface for which non-default conversion specification is requested.

temporally_align_data_interfaces()[source]#

Override this method to implement custom alignment

class ConverterPipe(data_interfaces: Union[List[neuroconv.basedatainterface.BaseDataInterface], Dict[str, neuroconv.basedatainterface.BaseDataInterface]], verbose=True)[source]#

Bases: NWBConverter

Takes a list or dict of pre-initialized interfaces as arguments to build an NWBConverter class

Validate source_data against source_schema and initialize all data interfaces.

get_conversion_options_schema() dict[source]#

Compile conversion option schemas from each of the data interface classes.

get_source_schema() dict[source]#

Compile input schemas from each of the data interface classes.

validate_source()[source]#

Validate source_data against Converter source_schema.