JinghaoLu / MIN1PIPE

A MINiscope 1-photon-based Calcium Imaging Signal Extraction PIPEline.
GNU General Public License v3.0
56 stars 25 forks source link

matrix dimension problem in noise suppression function #38

Closed martinjendryka closed 3 years ago

martinjendryka commented 4 years ago

Hi Jinghao, I normally use the min1pipe_HPC on my local PC for my processing which works fine, but does not have the noise suppression feature from the latest min1pipe version. So I just tried out the latest min1pipe version using demo_min1pipe. With your demo.tiff it works without problems. But for a single msCam file (50 sec, 20 Hz) from one of my sessions (which was processed with min1pipe_HPC wo problems before) I get an error in normalize_batch in the noise_suppress function. The reason is that num2str(idbatch(i + 1) - 1) is 752 but the size of m.reg is 250 , so I get the error 'Index exceeds matrix dimensions.' ( see below)

eval(['tmp = m.', var, '(:, :, ', num2str(idbatch(i)), ': ', num2str(idbatch(i + 1) - 1), ');']) here I get the error 'Index exceeds matrix dimensions.' because

eval('tmp = m.reg(:, :, 1: 752);') but

size(m.reg) ans = 480 752 250

Do you have any idea how I can fix that?

Below the set parameters: Fsi = 20; Fsi_new = 5; spatialr = 1; se = 5; ismc = true; flag = 1; ifpost = false;

Best regards, Martin

JinghaoLu commented 4 years ago

Yes good catch. Just fixed this bug.