flatironinstitute / NoRMCorre

Matlab routines for online non-rigid motion correction of calcium imaging data
GNU General Public License v2.0
142 stars 88 forks source link

problem when the first input of normcorre.m is a pointer to .mat file #10

Closed smile347 closed 7 years ago

smile347 commented 7 years ago

line 35-38 in function normcorre.m

elseif strcmpi(ext,'mat') filetype = 'mem'; Y = matfile(Y,'Writable',true); sizY = size(Y);

This would not return the size of the data, it should be sizY = size(Y.Varname)

epnev commented 7 years ago

Hi @smile347 thanks for bringing this into my attention. I'll need to modify the code to accept an arbitrary variable name in the mat file. In the meantime, you can load the data in memory (if not too large), and pass it as an array, or read the data directly from the hard drive using a different file format.

epnev commented 7 years ago

@smile347 I believe the bug is now fixed. The function will scan the mat file and consider the variable with the largest size as the data to be corrected. Let me know if problems persist.