Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lolaBerkowitz committed Nov 26, 2024
1 parent 24b4705 commit 6d1dec7
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions behavior/update_metadata_pixel_distance.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
function update_metadata_pixel_distance(data_path)

df = readtable(data_path,'Delimiter','comma');

for i = 1:length(df.basepath)

if ~isnan(df.pixel_distance(i))
continue
end

if ismember(df.vidname{i},{'na','MISSING'})
df.pixel_distance(i) = nan;
else
video_path = fullfile(df.basepath{i},[df.vidname{i},'.avi']);
maze_size = df.maze_width_cm(i);

pixel_distance = tracking.maze_distance_gui(video_path,maze_size,300);

df.pixel_distance(i) = pixel_distance;

writetable(df,df_path)
end

end

end

0 comments on commit 6d1dec7

Please sign in to comment.