NeurodataWithoutBorders / nwb-schema

Data format specification schema for the NWB neurophysiology data format
http://nwb-schema.readthedocs.io
Other
52 stars 16 forks source link

OpticalChannel for TwoPhotonSeries #338

Open luiztauffer opened 4 years ago

luiztauffer commented 4 years ago

For an Ophys dataset, I have: 2 OpticalChannels (Yellow and Red wavelenghts) 2 TwoPhotonSeries to be stored in acquisitions (Yellow and Red wavelenghts) 1 DfOverF signal to be stored in processing, that’s composed out of a ratio between the two channels raw signals

How many ImagingPlane objects should I have?

As I understand it, only one ImagingPlane would be necessary, since it accepts a list of OpticalChannels. Also, that would be the ImagingPlane associated with the ROIs in the processing modules. TwoPhotonSeries, however, do not specify which OpticalChannel was used to record the data, so if the 2 TwoPhotonSeries above would have the same ImagingPlane, it would not be possible to tell which comes from Red and which comes from Yellow.

Should TwoPhotonSeries have a field linking it to a specific OpticalChannel?

ageorgou commented 4 years ago

I have a similar question.

Using pynwb, it is possible to create an ImagingPlane with multiple OpticalChannels (this is also explicitly mentioned in the documentation and type checks). However, reading this with matnwb fails -- as far as I could tell from debugging it, this is because it does not expect the extra OpticalChannel. Looking at the schema, it also seems to me that an ImagingPlane should have exactly one associated OpticalChannel, as there is no quantity specified.

It seems that there is a discrepancy between the schema and what the two APIs allow.

If only one channel is allowed, then the TwoPhotonSeries also doesn't need a direct link to the OpticalChannel.

bendichter commented 4 years ago

@ageorgou and @luiztauffer are right. The API documentation allows you to enter a list of OpticalChannel objects:

https://pynwb.readthedocs.io/en/stable/pynwb.ophys.html#pynwb.ophys.ImagingPlane

but the nwb-schema only allows one:

https://github.com/NeurodataWithoutBorders/nwb-schema/blob/5d6160eccc6e4c786fc328c8f1d227420f933bda/core/nwb.ophys.yaml#L276-L286

We should allow more than one. That would be a non-breaking schema change.