Closed alessandratrapani closed 1 year ago
OK, writing it here:
Within the metadata of the converter (that collects the metadata from all the interfaces) you have now two entries for the photon series:
metadata["Ophys"]["TwoPhotonSeries"]
[{'name': 'FunctionalGreenTwoPhotonSeries', 'description': 'Imaging data acquire...ng readout', 'unit': 'px', 'imaging_plane': 'ImagingPlane', 'dimension': [...], 'format': '.nii', 'scan_line_rate': 15833.056254848874, 'field_of_view': [...]}, {'name': 'FunctionalRedTwoPhotonSeries', 'description': 'Imaging data acquire...istration.', 'unit': 'px', 'imaging_plane': 'ImagingPlane', 'dimension': [...], 'format': '.nii', 'scan_line_rate': 15833.056254848874, 'field_of_view': [...]}]
len(metadata["Ophys"]["TwoPhotonSeries"])
2
When you add the specific interface to the nwb file, you need to say from which of those two entries the metada will be used:
Check the photon_series_index
value there whose default is 0. This is the reason that you series is written with the same name twice. I modified this in the last commit so it should be fixed.
Now, this behavior is not very discoverably and in my opinion not well documented. The problem stems from the fact that while our metadata and data extraction methods flow through two different pipelines (the data goes through the extractor whereas the metadata is handled with the get_metadata
function) they are very coupled at the implementation level. I don't know how to solve this but at least we should document it.
The only thing left to do here is to fix the convert script so it correctly fetches all the data from one session.
This PR now is about adding the session start times correctly for the interfaces.
Add 4 different interfaces: one for each modality (functional or anatomical) + channel (Green and Red) combination