Skip to content

Commit

Permalink
fixing indentation bug - thanks to @dominic-Evans
Browse files Browse the repository at this point in the history
  • Loading branch information
epnev committed Jul 11, 2019
1 parent fa9cc5e commit 78ec2ff
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions caiman/motion_correction.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,18 +427,18 @@ def apply_shifts_movie(self, fname, rigid_shifts=True, save_memmap=False,
-cv2.resize(shiftX, dims[::-1]) + y_grid,
cv2.INTER_CUBIC, borderMode=cv2.BORDER_REPLICATE)
for img, shiftX, shiftY in zip(Y, shifts_x, shifts_y)]
if save_memmap:
Y = np.array(Y)
dims = Y.shape
fname_tot = memmap_frames_filename(save_base_name, dims[1:], dims[0], order)
big_mov = np.memmap(fname_tot, mode='w+', dtype=np.float32,
shape=prepare_shape((np.prod(dims[1:]), dims[0])), order=order)
big_mov[:] = np.reshape(Y.transpose(1, 2, 0), (np.prod(dims[1:]), dims[0]), order=order)
big_mov.flush()
del big_mov
return fname_tot
else:
return cm.movie(np.stack(m_reg, axis=0))
m_reg = np.stack(m_reg, axis=0)
if save_memmap:
dims = m_reg.shape
fname_tot = memmap_frames_filename(save_base_name, dims[1:], dims[0], order)
big_mov = np.memmap(fname_tot, mode='w+', dtype=np.float32,
shape=prepare_shape((np.prod(dims[1:]), dims[0])), order=order)
big_mov[:] = np.reshape(m_reg.transpose(1, 2, 0), (np.prod(dims[1:]), dims[0]), order=order)
big_mov.flush()
del big_mov
return fname_tot
else:
return cm.movie(m_reg)


#%%
Expand Down

0 comments on commit 78ec2ff

Please sign in to comment.