Skip to content

Commit

Permalink
fixed bugs associated with scaling and overwriting
Browse files Browse the repository at this point in the history
  • Loading branch information
lolaBerkowitz committed Dec 3, 2024
1 parent 0b4e6b2 commit 06af54e
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions preprocessing/behavior/process_behavior_folder.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@ function process_behavior_folder(basepath,varargin)
% input parser
p = inputParser;
p.addParameter('metadata_path','Y:\laura_berkowitz\behavior_validation\appps1_cpp\metadata.csv',@ischar)
p.addParameter('overwrite',false,@islogical)
p.addParameter('overwrite',true,@islogical)
p.addParameter('redo_rescale',true,@islogical)


p.parse(varargin{:});
metadata_path = p.Results.metadata_path;
overwrite = p.Results.overwrite;
redo_rescale = p.Results.redo_rescale;

basename = basenameFromBasepath(basepath);

Expand All @@ -57,18 +60,23 @@ function process_behavior_folder(basepath,varargin)

% update epochs from digitalIn.events.mat
update_epochs('basepath',basepath,...
'annotate',true,...
'overwrite',true,...
'annotate',false,...
'overwrite',false,...
'ttl_method',[])

% general behavior file
general_behavior_file_SNlab('basepath',basepath,'force_overwrite',true,'smooth_factor',.2,'primary_coords_dlc',5);
general_behavior_file_SNlab('basepath',basepath,'force_overwrite',overwrite,'smooth_factor',.2,'primary_coords_dlc',5);

% update behavior file from metadata csv
update_behavior_from_metadata(metadata_path,'basepath',basepath);

get_maze_XY('basepath',basepath,'config_path', 'C:\Users\schafferlab\github\SNLab_ephys\behavior\behavior_configs\');
get_maze_XY('basepath',basepath,'config_path', 'C:\Users\schafferlab\github\SNLab_ephys\behavior\behavior_configs\','redo_rescale',redo_rescale,'overwrite',overwrite);

% sacle coordinates to cm
tracking.scale_coords(basepath,overwrite);

restrict_and_transform(basepath,'overwrite',true);
% restrict coordintes to remove extramaze tracking points
tracking.restrict(basepath,overwrite);


end

0 comments on commit 06af54e

Please sign in to comment.