Skip to content

Commit

Permalink
isxd reading ability
Browse files Browse the repository at this point in the history
  • Loading branch information
ludovicbellier committed Oct 11, 2023
1 parent a08a067 commit 88d1b48
Show file tree
Hide file tree
Showing 5 changed files with 28,940 additions and 4 deletions.
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
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

0 comments on commit 88d1b48

Please sign in to comment.