Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MicroManagerTiffImagingInterface #399

Merged
merged 9 commits into from
Sep 29, 2023

Conversation

garrettmflynn
Copy link
Member

This PR adds the MicroManagerTiffImagingInterface. The first pass through this interface, however, reveals an issue where JavaScript does not maintain float values with trailing zeros so the value of imaging_rate in JSON is 20.0 (float), which gets converted to 20 in JS (number) and passed back to Python as 20 (int).

Do we need to correct for int-like floats like we do for expected NaN values?

Error


[2023-09-28 13:17:03,870] ERROR in app: Exception on /neuroconv/convert [POST]
Traceback (most recent call last):
  File "/Users/garrettflynn/Documents/Github/nwb-guide/pyflask/apis/neuroconv.py", line 82, in post
    return convert_to_nwb(neuroconv_api.payload)
  File "/Users/garrettflynn/Documents/Github/nwb-guide/pyflask/manageNeuroconv/manage_neuroconv.py", line 383, in convert_to_nwb
    converter.run_conversion(
  File "/opt/anaconda3/envs/nwb-guide/lib/python3.9/site-packages/neuroconv/nwbconverter.py", line 160, in run_conversion
    self.add_to_nwbfile(nwbfile_out, metadata, conversion_options)
  File "/opt/anaconda3/envs/nwb-guide/lib/python3.9/site-packages/neuroconv/nwbconverter.py", line 114, in add_to_nwbfile
    data_interface.add_to_nwbfile(
  File "/opt/anaconda3/envs/nwb-guide/lib/python3.9/site-packages/neuroconv/datainterfaces/ophys/baseimagingextractorinterface.py", line 118, in add_to_nwbfile
    add_imaging(
  File "/opt/anaconda3/envs/nwb-guide/lib/python3.9/site-packages/neuroconv/tools/roiextractors/roiextractors.py", line 492, in add_imaging
    add_photon_series(
  File "/opt/anaconda3/envs/nwb-guide/lib/python3.9/site-packages/neuroconv/tools/roiextractors/roiextractors.py", line 364, in add_photon_series
    nwbfile = add_imaging_plane(nwbfile=nwbfile, metadata=metadata_copy, imaging_plane_index=photon_series_index)
  File "/opt/anaconda3/envs/nwb-guide/lib/python3.9/site-packages/neuroconv/tools/roiextractors/roiextractors.py", line 251, in add_imaging_plane
    imaging_plane = _create_imaging_plane_from_metadata(
  File "/opt/anaconda3/envs/nwb-guide/lib/python3.9/site-packages/neuroconv/tools/roiextractors/roiextractors.py", line 214, in _create_imaging_plane_from_metadata
    imaging_plane = ImagingPlane(**imaging_plane_metadata)
  File "/opt/anaconda3/envs/nwb-guide/lib/python3.9/site-packages/hdmf/utils.py", line 643, in func_call
    pargs = _check_args(args, kwargs)
  File "/opt/anaconda3/envs/nwb-guide/lib/python3.9/site-packages/hdmf/utils.py", line 636, in _check_args
    raise ExceptionType(msg)
TypeError: ImagingPlane.__init__: incorrect type for 'imaging_rate' (got 'int', expected 'float')

@CodyCBakerPhD
Copy link
Collaborator

Do we need to correct for int-like floats like we do for expected NaN values?

Yep, looks like; we def need them to be floats after rehydrating

@garrettmflynn garrettmflynn marked this pull request as ready for review September 28, 2023 20:59
@garrettmflynn
Copy link
Member Author

@CodyCBakerPhD Just published that PR. Looks like it works!

@garrettmflynn garrettmflynn added the interface Add support for a specific NeuroConv interface / converter label Sep 28, 2023
Base automatically changed from coerce-numbers-to-floats to main September 29, 2023 15:31
@CodyCBakerPhD
Copy link
Collaborator

@garrettmflynn Oh no 😆 putting fix PR # in the header of the base PR caused this to auto close lol

@CodyCBakerPhD CodyCBakerPhD reopened this Sep 29, 2023
@CodyCBakerPhD CodyCBakerPhD merged commit 703d069 into main Sep 29, 2023
6 checks passed
@CodyCBakerPhD CodyCBakerPhD deleted the MicroManagerTiffImagingInterface branch September 29, 2023 15:33
@CodyCBakerPhD
Copy link
Collaborator

Indeed works great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interface Add support for a specific NeuroConv interface / converter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants