rochefort-lab / fissa

A Python toolbox for Fast Image Signal Separation Analysis, designed for Calcium Imaging data.
GNU General Public License v3.0
30 stars 28 forks source link

`IndexError: list index out of range` while doing experiment.separate() #276

Open GergelyTuri opened 2 years ago

GergelyTuri commented 2 years ago

Hi, I try to process some of my own data based on the example notebook and I get a the following error when i get to the experiment.separate() line:

Doing region growing and data extraction....

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
/tmp/ipykernel_25883/3755209102.py in <module>
      1 output_folder = join(sima_path, 'fissa_suite2p_example')
      2 experiment = fissa.Experiment(images, [rois[:ncells]], output_folder)
----> 3 experiment.separate()

~/anaconda3/envs/fissa/lib/python3.7/site-packages/fissa/core.py in separate(self, redo_prep, redo_sep)
    387         """
    388         # Do data preparation
--> 389         self.separation_prep(redo_prep)
    390         if redo_prep:
    391             redo_sep = True

~/anaconda3/envs/fissa/lib/python3.7/site-packages/fissa/core.py in separation_prep(self, redo)
    325 
    326             # get number of cells
--> 327             nCell = len(results[0][1])
    328 
    329             # predefine data structures

IndexError: list index out of range

This is a freshly installed Fissa (0.7.2) through pip in a new conda environment on Ubuntu. Python = 3.7.12. The version for suite2p is 0.10.3, although the processing was done with an earlier version. The input is fairly standard, 1 plane (512x512) with 148 rois in the iscell group. The parameters seem to check out: num_rois: 148, len(rois): 148, len(cell_ids): 148

Can you provide a few pointers how i can troubleshoot this?

nathalierochefort commented 2 years ago
EmrickLab commented 1 year ago

I've encountered the same exact issue with a simple 300 frame tiff & 158 ROI zip file from ImageJ. If I run fissa.Experiments() with maximum verbosity, what I see is:

Images: 
ROI sets:
nRegions: 8
expansion: 1

clearly there is an issue with reading the data in. After looking at the example.ipynb more closely, it appears that the images and roi paths should be sent as a list. Once I did that, the script correctly recognized my items.

For example, here's sample code that got past the error you described:

tiff_path = './GCaMP_AD.tif'
rois_path = './GC_AD_ROI.zip' 
experiment = fissa.Experiment([tiff_path], [rois_path], verbosity=6, nRegions=8)
experiment.separate()

Unfortunately, once we get past this error, we immediately arrive to another one ~ ValueError: linearrings: Input operand 0 does not have enough dimensions (has 1, gufunc core with signature (i,d)->() requires 2)

Welp, we keep grinding at it.

nathalierochefort commented 9 months ago

dear @EmrickLab was it solved?