Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

setup(
name="utils2p",
version="1.0.0",
version="1.0.1",
packages=["utils2p", "utils2p.external", "utils2p.external.tifffile"],
author="Florian Aymanns",
author_email="florian.aymanns@epfl.ch",
Expand Down
4 changes: 2 additions & 2 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,8 +567,8 @@ def test_find_raw_file(default_exp_dir):

def test_load_optical_flow(tmpdir):
n_timepoints = 10
opt_flow_data = np.zeros((n_timepoints, 5), dtype=np.int)
opt_flow_data[:, 4] = np.arange(n_timepoints, dtype=np.int)
opt_flow_data = np.zeros((n_timepoints, 5), dtype=int)
opt_flow_data[:, 4] = np.arange(n_timepoints, dtype=int)
opt_flow_data[1, 0] = -1
opt_flow_data[3, 1] = 1
opt_flow_data[6, 2] = 2
Expand Down
14 changes: 7 additions & 7 deletions utils2p/synchronization.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ def process_cam_line(line, seven_camera_metadata):
1)] <= i:
current_frame += 1
processed_line[start:stop] = current_frame
return processed_line.astype(np.int)
return processed_line.astype(int)


def process_frame_counter(line, metadata=None, steps_per_frame=None):
Expand Down Expand Up @@ -514,7 +514,7 @@ def process_frame_counter(line, metadata=None, steps_per_frame=None):
# Case of one frame/volume only
if len(rising_edges) <= steps_per_frame:
processed_frame_counter[rising_edges[0]:] = 0
return processed_frame_counter.astype(np.int)
return processed_frame_counter.astype(int)

for i, index in enumerate(
range(0,
Expand All @@ -523,7 +523,7 @@ def process_frame_counter(line, metadata=None, steps_per_frame=None):
rising_edges[index]:rising_edges[index + steps_per_frame]] = i
processed_frame_counter[rising_edges[-1 * steps_per_frame]:] = (
processed_frame_counter[rising_edges[-1 * steps_per_frame] - 1] + 1)
return processed_frame_counter.astype(np.int)
return processed_frame_counter.astype(int)


def process_stimulus_line(line):
Expand Down Expand Up @@ -559,7 +559,7 @@ def process_stimulus_line(line):
processed_stimulus_line = np.zeros_like(line)
indices = np.where(line > 0)
processed_stimulus_line[indices] = 1
return processed_stimulus_line.astype(np.int)
return processed_stimulus_line.astype(int)


def process_optical_flow_line(line):
Expand Down Expand Up @@ -610,7 +610,7 @@ def process_optical_flow_line(line):
processed_optical_flow_line[rising_edges[i]:rising_edges[i + 1]] = i
processed_optical_flow_line[rising_edges[-1]:] = (
processed_optical_flow_line[rising_edges[-1] - 1] + 1)
return processed_optical_flow_line.astype(np.int)
return processed_optical_flow_line.astype(int)


def crop_lines(mask, lines):
Expand Down Expand Up @@ -714,7 +714,7 @@ def beh_idx_to_2p_idx(beh_indices, cam_line, frame_counter):
if not cam_line[0] < 0:
thor_sync_indices = np.append(np.array([0]), thor_sync_indices)

indices_2p = np.ones(len(beh_indices), dtype=np.int) * np.nan
indices_2p = np.ones(len(beh_indices), dtype=int) * np.nan

first_frame_of_cam_line = np.min(cam_line[np.where(cam_line >= 0)])

Expand All @@ -728,7 +728,7 @@ def beh_idx_to_2p_idx(beh_indices, cam_line, frame_counter):
thor_sync_index = thor_sync_indices[frame_num]
indices_2p[i] = frame_counter[thor_sync_index]

return indices_2p.astype(np.int)
return indices_2p.astype(int)


def reduce_during_2p_frame(frame_counter, values, function):
Expand Down