catalystneuro / cai-lab-to-nwb

NWB Conversion project for the Cai lab
MIT License
0 stars 0 forks source link

Add conversion script for conditioning sessions #11

Closed alessandratrapani closed 3 weeks ago

alessandratrapani commented 1 month ago

Stub NWBfile: https://catalystneuro-processing.s3.us-east-2.amazonaws.com/cai-lab-to-nwb/Ca_EEG3-4_NeutralExposure.nwb

Add conversion script for conditioning sessions

extras

h-mayorquin commented 4 weeks ago

I could not run this on my side. I am getting this error:

  File "/home/heberto/development/cai-lab-to-nwb/.venv/lib/python3.11/site-packages/neuroconv/tools/roiextractors/roiextractors.py", line 1754, in add_segmentation_to_nwbfile
    add_background_plane_segmentation_to_nwbfile(
  File "/home/heberto/development/cai-lab-to-nwb/.venv/lib/python3.11/site-packages/neuroconv/tools/roiextractors/roiextractors.py", line 1175, in add_background_plane_segmentation_to_nwbfile
    background_ids = segmentation_extractor.get_background_ids()
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/heberto/development/roiextractors/src/roiextractors/segmentationextractor.py", line 177, in get_background_ids
    return list(range(self.get_num_background_components()))
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object cannot be interpreted as an integer

It seems that there is a method missing on minian? Any ideas?

alessandratrapani commented 4 weeks ago

I could not run this on my side. I am getting this error:

  File "/home/heberto/development/cai-lab-to-nwb/.venv/lib/python3.11/site-packages/neuroconv/tools/roiextractors/roiextractors.py", line 1754, in add_segmentation_to_nwbfile
    add_background_plane_segmentation_to_nwbfile(
  File "/home/heberto/development/cai-lab-to-nwb/.venv/lib/python3.11/site-packages/neuroconv/tools/roiextractors/roiextractors.py", line 1175, in add_background_plane_segmentation_to_nwbfile
    background_ids = segmentation_extractor.get_background_ids()
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/heberto/development/roiextractors/src/roiextractors/segmentationextractor.py", line 177, in get_background_ids
    return list(range(self.get_num_background_components()))
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object cannot be interpreted as an integer

It seems that there is a method missing on minian? Any ideas?

Yeah, unfortunately it's on roiextractor side, I solved this small bug here: https://github.com/catalystneuro/roiextractors/pull/378 But I forgot to pin to the roiextractor main

h-mayorquin commented 3 weeks ago

OK, this ran well and the file looks reasonable.

I would use f-strings instead of "".format() but that's me. Any reason you prefer format? I am merging this so we can focus on the next one.