cortex-lab / Suite2P

Tools for processing 2P recordings
Other
121 stars 66 forks source link

Exceeding matrix dimensions in rigidRegFrames #107

Closed carlyrosewilling closed 6 years ago

carlyrosewilling commented 6 years ago

Hello, I am now using a SCC to run larger tiff files. They get through the first step of registration and produce a plane image, however, I then get the following error message. I tried running the pipeline with your provided example data, make_db, and master_file, and got a similar error message. Is there an option in the master_file which needs to be adjusted, or does the problem lie in the looping index for rigidRegFrames? If the latter is the case, what is the best way to approach solving the looping error?

Thank you in advance! I really appreciate the assistance.

Index exceeds matrix dimensions. Error in rigidMovie (line 12) rigidRegFrames(data(yFOVs(:,l), xFOVs(:,l), indxr), ops1{1,l}, dsall(indxr,:,l)); Error in reg2P (line 212) dreg = rigidMovie(data, ops1, dsall, yFOVs, xFOVs); Error in run_pipeline (line 38) ops1 = reg2P(ops0); % do registration Error in master_file (line 94) run_pipeline(db, ops0);`

carsen-stringer commented 6 years ago

I'm running the example data and not getting this error. Is your path to the toolbox correct? Also, make sure you have the latest repository. Do you see the mean target image pop up?

Did you change any of the default settings in the example master_file2 or in master_file_example?

carlyrosewilling commented 6 years ago

The path to the toolbox is correct, and I do see the mean target image pop up. I downloaded the latest repository and am having the same issue.

I changed some of the default settings in the master_file_example to run my data because we have a red channel, but other than that and file names, everything is the same. I just made sure to look at the example file in the latest repository and made sure all of the settings are there.

carsen-stringer commented 6 years ago

there is no red channel in the example data, so the example data fails with this error too?

carlyrosewilling commented 6 years ago

No, but it fails with a similar type indexing in rigidMovie,

carsen-stringer commented 6 years ago

so is it only failing in the red channel recording? our tiffs have interleaved red and green (1-green, 2-red, 3-green, ...). Also if your tiffs are larger than 4gb matlab may give you errors.

carlyrosewilling commented 6 years ago

Our tiffs are also interleaved-- I was under the impression that you had to specify that there was a red channel regardless. The tiffs are all around 1.9gb

carsen-stringer commented 6 years ago

Ah, no by default suite2p assumes one channel recordings. You may have to specify more things if your tiff headers aren't being processed. For green and red recordings: db.nchannels = 2; db.ichannel = ?; % 1 if green is first, 2 if red is first db.expts = [1 2]; %<-- your experiments db.expred = db.expts; % to get the mean image, etc you have to specify this for now

Sorry this stuff isn't clear in the documentation, let me know if it still fails

carlyrosewilling commented 6 years ago

Hello sorry about the delay. I played around with the code now that I understood more about the set up of the channels and what not. Unfortunately, I still cannot get it to run. Is there anyway you could look at my master_script/make_db and see if there is a problem in my settings as a whole?

carsen-stringer commented 6 years ago

Happy to troubleshoot this, still busy for the next couple days, but can get to this on tuesday. Please send me the scripts and an example tiff, my email is carsen.stringer@gmail.com

have you also tried setting db.nchannels_red=2? sorry it's confusing because I've added functionality for recordings where not all blocks have two channels.

msarvestani commented 6 years ago

Was this resolved? I'm having the same issue, only when trying to use the red channel for registration.

carsen-stringer commented 6 years ago

I'm sorry for the confusion, I changed the code to support datasets in which different expts have different numbers of channels. I will change the code to assume that if you say nchannels=2 and no other variables, then all experiments have the same number of channels. But for now, if you have 3 experiments and each one has a red channel, then the structure that works is:

db.expts = [1 2 3]; db.nchannels = 2; db.expred = db.expts; db.nchannels_red = 2;

See if this solves your problem.

msarvestani commented 6 years ago

That worked. I didn't have the db.nchannels_red = 2 option set. Thanks a lot.