datajoint / element-interface

Common functions for the DataJoint Elements
https://datajoint.com/docs
MIT License
3 stars 17 forks source link

Multiple z devices (PrairieView metadata reader) #77

Closed juremaj closed 1 year ago

juremaj commented 1 year ago

I've been trying to set up datajoint for a calcium imaging pipeline and I ran into issues importing PrairieView metadata from the .xml file. Essentially I get an assertion error, from prairieviewreader.py/get_pv_metadata (part of element_interface) because z_fields.size == n_depths. I think the issue is that our microscope is using 2 different devices for adjusting Z (Z Focus and Optotune ETL 10-30), but prairieviewreader.py hardcodes the zeroth index as the preferred z device (see below - [@subindex='0']):

image

But since I have two devices, this restricts the reading to only the first one. Heres what my metadata (.xml) looks like:

image

In my data the other device was used (Optotune ETL 10-30, index=1) and the .xml logs this under 'zDevice':

image

For now I just did a hacky fix of hardcoding [@subindex='1'] instead of 0, since all my data is using the second device. I am not sure how many people are using a second z device, but I was thinking it could be good to add the handling of this specific case.

kushalbakshi commented 1 year ago

Hi @juremaj, we haven't come across instances where the PrairieView system uses multiple z-devices. At this time, implementing this feature is not on our roadmap but we welcome community contributions. Our documentation provides contribution guidelines if you want to explore that option.

kabilar commented 1 year ago

Thanks for the report, @juremaj. Would you be able to send us an example dataset so that we can scope out the issue? If so, feel free to email me the data at kabilar@datajoint.com.

juremaj commented 1 year ago

Hi @kabilar! Thanks for the reply. I sent you the example metadata (the same as the one in the screenshots above). Running element_interface.prairieviewreader.get_pv_metadata() on that file should replicate the issue.

kabilar commented 1 year ago

Thank you, @juremaj. We are looking into the issue and exploring possible solutions.

kushalbakshi commented 1 year ago

Hi @juremaj we've determined the issue - the .xml settings files vary significantly amongst users for indicating ZAxis. Based on the examples we have, we will develop a more adaptable solution that will work for you as well as others. This fix will be implemented shortly.

kabilar commented 1 year ago

@juremaj, PyPI releases for element-interface 0.5.1 and element-calcium-imaging 0.5.5 have been made to address this issue. Please let us know if you run into any further issues. Thank you.