Skip to content

Commit

Permalink
...fix??
Browse files Browse the repository at this point in the history
  • Loading branch information
calderast committed Jan 27, 2025
1 parent 353222b commit 0487e8c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/jdb_to_nwb/convert_dlc.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,11 @@ def read_dlc(deeplabcut_file_path, pixels_per_cm, likelihood_cutoff=0.9, cam_fps
f"Expected DLC file columns x, y, and likelihood, got {dlc_position.columns}"
)

# Replace x, y coordinates where DLC has low confidence with NaN
position = dlc_position[['x', 'y', 'likelihood']].copy()
# Fix split column names if needed
position.columns = [''.join(col) if isinstance(col, tuple) else col for col in position.columns]

# Replace x, y coordinates where DLC has low confidence with NaN
position.loc[position['likelihood'] < likelihood_cutoff, ['x', 'y']] = np.nan

# Remove abrupt jumps of position bigger than a body of rat (30cm)
Expand Down

0 comments on commit 0487e8c

Please sign in to comment.