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

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

Open
GergelyTuri opened this issue Mar 24, 2022 · 3 comments
Open

Comments

@GergelyTuri
Copy link

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
Copy link
Member

  • It looks like there might have been an error with saving your signal in the results array. Can you try to see what is in this array before line 327 runs? That might give you an idea as to where the error is coming from.

@EmrickLab
Copy link

EmrickLab commented Nov 6, 2023

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
Copy link
Member

dear @EmrickLab
was it solved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants