cortex-lab / Suite2P

Tools for processing 2P recordings
Other
120 stars 65 forks source link

Error while loading proc files in registers2p #148

Open suyashh94 opened 5 years ago

suyashh94 commented 5 years ago

Hi, I am getting "Warning: Import error - .mat file is not of the correct format, cannot load " warning when I am trying to load a Suite2p processed file in registers2p. Because of this, I am unable to register across two days. Please guide me on how to resolve it.

carsen-stringer commented 5 years ago

@hwpdalgleish we've added a few more fields to the "proc" files, not sure what field is potentially missing.

@suyashh94 if you load your "F_proc.mat" file into matlab, does it have all of the fields listed in this part of the code (https://github.com/cortex-lab/Suite2P/blob/master/registers2p/registers2p.m#L742)? Note that Henry's GUI expects that you've loaded the "F.mat" file in the Suite2P GUI ("new_main.m") and saved it as an "F*_proc.mat" file.

hwpdalgleish commented 5 years ago

@suyashh94 The problem is most likely due to what Carsen mentions at the end - you need to first import the .mat file into the new_main GUI and curate cells (or not, you can simply import and save out), then you can import the _proc.mat file into registers2p.

@carsen-stringer I've tested registers2p on Suite2P versions downloaded ~a month ago and it still seemed to work fine so hopefully no required fields are missing!

suyashh94 commented 5 years ago

Hi,

I checked and I have all the required fields in my proc files. This thing was working fine about a month ago and I see this error all of a sudden

hwpdalgleish commented 5 years ago

Ah ok. Could you send me an example proc file that is causing problems so that I can diagnose? Feel from to set the Fcell and FcellNeu fields to empty if the files are too big to email. My email address is hwpdalgleish@gmail.com.

suyashh94 commented 5 years ago

Hey! I emailed the proc files to you @hwpdalgleish

hwpdalgleish commented 5 years ago

Hi @suyashh94, I downloaded the proc files and successfully imported/registered them. Which version of MATLAB are you using?

Could you download this version of registers2p: registers2p_debug.zip

then could you temporarily add this folder to your path. Ensure that this is the version of registers2p that MATLAB is using ("which registers2p" - make sure path is wherever you unzipped that folder). Then could you try importing your proc files and paste the error that MATLAB returns on here?

suyashh94 commented 5 years ago

Issue solved with the registers2p_debug folder. Thank you so much!!!!

Regards, Suyash

hwpdalgleish commented 5 years ago

Great to hear! What was the problem for future reference?

suyashh94 commented 5 years ago

Warning: Import error - .mat file is not of the correct format, cannot load

In registers2p>load_s2p_struct (line 751) In registers2p>load_fixed_button_Callback (line 236) In gui_mainfcn (line 95) In registers2p (line 42) In matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)registers2p('load_fixed_button_Callback',hObject,eventdata,guidata(hObject))

hwpdalgleish commented 5 years ago

Hey @suyashh94, did you try importing your data using the registers2p_debug version I sent you? Also could you email me the data you're trying to register?

suyashh94 commented 5 years ago

It worked perfectly well with registers2p_debug. I was just answering about the error it showed.