Build a DataInterface#
Building a new DataInterface
for a specific file format is as simple as creating a new
subclass based on the predefined base classes provided in the
NeuroConv package.
To enable standardization among subclasses, the BaseDataInterface
is an abstract base class which require a new
subclass to override all methods which are decorated with @abstractmethod. The BaseDataInterface
class has several abstract methods: get_source_schema()
, get_metadata_schema()
, get_metadata()
, and most importantly run_conversion()
. So all you need to do is create a class that inherits from :code:`BaseDataInterface`
and implements these two methods.
Along with these two methods, you can also optionally override the __init__()
function as needed to instantiate additional data.
The contributed extractors are in the neuroconv/datainterfaces folder. You can fork the repo and create a new file myformatdatainterface there. In the folder, create a new file named myformatdatainterface.py.
When you are done we recommend you write a test in the tests/test_interfaces.py to ensure it works as expected.
Finally, make a pull request to the NeuroConv repo, so we can review the code prior to merge!