Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix subidx to enable computing the NoRMCorre template frame from subset of movie frames #1133

Open
wants to merge 9 commits into
base: dev
Choose a base branch
from
16 changes: 16 additions & 0 deletions caiman/base/movies.py
Original file line number Diff line number Diff line change
Expand Up @@ -1604,6 +1604,22 @@ def rgb2gray(rgb):
elif extension == '.sima':
raise Exception("movies.py:load(): FATAL: sima support was removed in 1.9.8")

elif extension == '.isxd':
import isx
kushalkolar marked this conversation as resolved.
Show resolved Hide resolved
mov = isx.Movie.read(file_name)
T = mov.timing.num_samples
dims = mov.spacing.num_pixels
fr = 1e6 / mov.timing.period.to_usecs()

idx_frames = np.arange(T)
if subindices is not None:
idx_frames = idx_frames[subindices]
T = len(idx_frames)

input_arr = np.zeros([T] + list(dims), dtype=outtype)
for idx in range(T):
input_arr[idx, :, :] = mov.get_frame_data(idx)

else:
raise Exception('Unknown file type')
else:
Expand Down
1 change: 1 addition & 0 deletions caiman/motion_correction.py
Original file line number Diff line number Diff line change
Expand Up @@ -2101,6 +2101,7 @@ def high_pass_filter_space(img_orig, gSig_filt=None, freq=None, order=None):
return cm.movie(np.array([cv2.idft(cv2.dft(img, flags=cv2.DFT_COMPLEX_OUTPUT) *
H[..., None])[..., 0] for img in img_orig]) / (rows*cols))


def tile_and_correct(img, template, strides, overlaps, max_shifts, newoverlaps=None, newstrides=None, upsample_factor_grid=4,
upsample_factor_fft=10, show_movie=False, max_deviation_rigid=2, add_to_movie=0, shifts_opencv=False, gSig_filt=None,
use_cuda=False, border_nan=True):
Expand Down
Loading