7.11. Creating a Data Registry

7.11.1. What is a data registry

Data Registry is an object which manages pipeline data (like parcellations, coordinates and masks) based on the scope. junifer comes with the following in-built data registries:

You interact with them indirectly via get_data(), load_data(), list_data(), register_data() and deregister_data(). The kind parameter in them directs which data registry to interact with. These in turn supply preprocessors and markers with their necessary data for computation.

7.11.2. How to make a data registry

Ideally you would not need to create a custom data registry if you work with fMRI data. In case you work with other modalities like EEG, you might want to create a data registry for montages. Here is how you would go about it:

  1. Check extending junifer on how to create a junifer extension if you have not done so.

  2. Create the data registry in the extension script like so:

    from junifer.api.decorators import register_data_registry
    from junifer.data import BasePipelineDataRegistry
    
    
    @register_data_registry("montage")
    class MontageDataRegistry(BasePipelineDataRegistry):
        def __init__(self):
            super().__init__()
    
        def register(self):
            pass
    
        def deregister(self):
            pass
    
        def load(self):
            pass
    
        def get(self):
            pass
    
  3. Pass kind="montage" in *_data functions to verify if your data registry is set up properly.