Skip to content

[Feature]: Change implementation of containers types to simplify API #625

@ehennestad

Description

@ehennestad

What would you like to see added to MatNWB?

Many NWB types are containers for other types, with two examples being ProcessingModule and Fluorescence.

The syntax for setting/getting data for these containers is cumbersome:

ophys_module = types.core.ProcessingModule('description', 'contains optical physiology data')

ophys_module.nwbdatainterface.set('ImageSegmentation', img_seg);

and

fluorescence = types.core.Fluorescence();

fluorescence.roiresponseseries.set('RoiResponseSeries', roi_response_series);
ophys_module.nwbdatainterface.set('Fluorescence', fluorescence);

A simpler way of doing this would be:

ophys_module = types.core.ProcessingModule('description', 'contains optical physiology data')

ophys_module('ImageSegmentation') = img_seg;

and

fluorescence = types.core.Fluorescence();

fluorescence('RoiResponseSeries') = roi_response_series;
ophys_module('Fluorescence') = fluorescence;

A similar suggestion was raised in pynwb (issue #1993) and it would be great to mirror this on the matnwb side.

Edge cases to consider:

Is your feature request related to a problem?

No response

What solution would you like?

Redefine container classes to have dictionary/Set like behavior, while also restricting the types it is allowed to hold

Do you have any interest in helping implement the feature?

Yes.

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    category: proposaldiscussion of proposed enhancements or new featurespriority: lowalternative solution already working and/or relevant to only specific user(s)topic: matnwb-apirelated to improving the matnwb api

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions