Skip to content

Commit

Permalink
another dimension flip
Browse files Browse the repository at this point in the history
appears to be working now
  • Loading branch information
epnev authored Aug 15, 2019
1 parent f568310 commit d30385f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions caiman/motion_correction.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# -*- coding: utf-8 -*-

"""
@author Andrea Giovannucci,
The functions apply_shifts_dft, register_translation, _compute_error, _compute_phasediff, and _upsampled_dft are from
SIMA (https://github.com/losonczylab/sima), licensed under the GNU GENERAL PUBLIC LICENSE, Version 2, 1991.
Expand Down Expand Up @@ -2368,13 +2367,13 @@ def tile_and_correct_3d(img, template, strides, overlaps, max_shifts, newoverlap
x_grid, y_grid, z_grid = np.meshgrid(np.arange(0., dims[1]).astype(
np.float32), np.arange(0., dims[0]).astype(np.float32),
np.arange(0., dims[2]).astype(np.float32))
m_reg = warp_sk(img, np.stack((resize_sk(shift_img_y.astype(np.float32), dims) + y_grid,
resize_sk(shift_img_x.astype(np.float32), dims) + x_grid,
m_reg = warp_sk(img, np.stack((resize_sk(shift_img_x.astype(np.float32), dims) + y_grid,
resize_sk(shift_img_y.astype(np.float32), dims) + x_grid,
resize_sk(shift_img_z.astype(np.float32), dims) + z_grid),axis=0),
order=3, mode='constant')
# borderValue=add_to_movie)
total_shifts = [
(-x, -y, -z) for x, y, z in zip(shift_img_x.reshape(num_tiles), shift_img_y.reshape(num_tiles), shift_img_z.reshape(num_tiles))]
(-x, -y, z) for x, y, z in zip(shift_img_x.reshape(num_tiles), shift_img_y.reshape(num_tiles), shift_img_z.reshape(num_tiles))]
return m_reg - add_to_movie, total_shifts, None, None

# create automatically upsample parameters if not passed
Expand Down

0 comments on commit d30385f

Please sign in to comment.