Skip to content

Commit

Permalink
Merge pull request #117 from int-brain-lab/trajectory_fix
Browse files Browse the repository at this point in the history
Trajectory fix
  • Loading branch information
mayofaulkner authored Mar 27, 2024
2 parents 4677f01 + d19986c commit cf3cacf
Show file tree
Hide file tree
Showing 9 changed files with 407 additions and 888 deletions.
11 changes: 5 additions & 6 deletions atlaselectrophysiology/load_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ def __init__(self, one=None, brain_atlas=None, testing=False, probe_id=None,
self.brain_regions = self.one.alyx.rest('brain-regions', 'list')
self.chn_coords = None
self.chn_depths = None
# Download bwm aggregate tables for for ephys feature gui
table_path = self.one.cache_dir.joinpath('bwm_features')
s3, bucket_name = aws.get_s3_from_alyx(alyx=self.one.alyx)
aws.s3_download_folder("aggregates/bwm/latest", table_path, s3=s3, bucket_name=bucket_name)

# Initialise all variables that get assigned
self.sess_with_hist = None
Expand All @@ -65,11 +69,6 @@ def __init__(self, one=None, brain_atlas=None, testing=False, probe_id=None,
self.alyx_str = None
self.sr = None

# Download bwm aggregate tables for for ephys feature gui
table_path = self.one.cache_dir.joinpath('bwm_features')
s3, bucket_name = aws.get_s3_from_alyx(alyx=self.one.alyx)
aws.s3_download_folder("aggregates/bwm/latest", table_path, s3=s3, bucket_name=bucket_name)

if probe_id is not None:
self.sess = self.one.alyx.rest('insertions', 'list', id=probe_id)

Expand Down Expand Up @@ -578,7 +577,7 @@ def update_json(self, json_data):
# Get the new trajectory
ephys_traj = self.one.alyx.rest('trajectories', 'list', probe_insertion=self.probe_id,
provenance='Ephys aligned histology track', no_cache=True)
patch_dict = {'json': json_data}
patch_dict = {'probe_insertion': self.probe_id, 'json': json_data}
self.one.alyx.rest('trajectories', 'partial_update', id=ephys_traj[0]['id'],
data=patch_dict)

Expand Down
Loading

0 comments on commit cf3cacf

Please sign in to comment.