MouseLand / suite2p

cell detection in calcium imaging recordings
http://www.suite2p.org
GNU General Public License v3.0
360 stars 244 forks source link

ROI detection wrapper modifies the input images and consequently, can't detect ROIs #1145

Open harinisuri opened 2 months ago

harinisuri commented 2 months ago

I am interested in using suite2p to run only ROI detection, cell classification and fluorescene extraction on my dataset. I have been trying to independently run each of these through their respective modules (detection_wrapper, extraction_wrapper and classify) in jupyter notebook. I am testing this for only one plane with 447 frames of 256x256 images. I convert my tiff file to binary format and then run these modules. The code doesn't run into errors but I notice two problems with the outputs -

  1. It seems like the after I run the detection wrapper, the data is no longer 447 frames long but has only 432 frames now and this is carried forward to the extraction phase as well. Hence, the output F traces are also 432 frames long. I have tried giving just the raw data as input to the detection wrapper without converting it into binary format and it still shows me the same difference in the number of frames. Is this because of bad frames being removed?
  2. I don't know where exactly this discrepancy is coming from but my image stack becomes completely noisy (see image output below) once it runs through the detection wrapper. I extracted the images prior to running them and they look fine but once they run through the detection wrapper, it becomes all noisy with no resemblence to my original image.

I have tried processing the same dataset through the GUI as well and get the same distorted images as outputs.

Any thoughts or suggestions to fix this?

Thank you!

Here is my code and the output images one frame before and after it's run through the detection wrapper Code Output_1 Code Output_2