Skip to content

Commit 00bac3e

Browse files
authored
Merge pull request #134 from int-brain-lab/develop
Develop
2 parents e4fd8fb + 5b5a105 commit 00bac3e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

atlaselectrophysiology/load_data_local.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
class LoadDataLocal:
2020
def __init__(self):
21-
ONE(silent=True, password='international')
21+
ONE(base_url='https://openalyx.internationalbrainlab.org', silent=True, password='international')
2222
self.brain_atlas = atlas.AllenAtlas(25)
2323
self.franklin_atlas = None
2424
self.folder_path = None
@@ -99,8 +99,11 @@ def get_data(self):
9999

100100
shank_chns = np.bitwise_and(self.chn_coords_all[:, 0] >= shanks[self.shank_idx][0],
101101
self.chn_coords_all[:, 0] <= shanks[self.shank_idx][1])
102+
self.orig_idx = np.where(shank_chns)[0]
102103
self.chn_coords = self.chn_coords_all[shank_chns, :]
104+
103105
else:
106+
self.orig_idx = None
104107
self.chn_coords = self.chn_coords_all
105108

106109
chn_depths = self.chn_coords[:, 1]
@@ -261,8 +264,7 @@ def upload_data(self, feature, track, xyz_channels):
261264
with open(self.folder_path.joinpath(prev_align_filename), "w") as f:
262265
json.dump(original_json, f, indent=2, separators=(',', ': '))
263266

264-
@staticmethod
265-
def create_channel_dict(brain_regions):
267+
def create_channel_dict(self, brain_regions):
266268
"""
267269
Create channel dictionary in form to write to json file
268270
:param brain_regions: information about location of electrode channels in brain atlas
@@ -281,6 +283,9 @@ def create_channel_dict(brain_regions):
281283
'brain_region_id': int(brain_regions.id[i]),
282284
'brain_region': brain_regions.acronym[i]
283285
}
286+
if self.orig_idx is not None:
287+
channel['original_channel_idx'] = int(self.orig_idx[i])
288+
284289
data = {'channel_' + str(i): channel}
285290
channel_dict.update(data)
286291

0 commit comments

Comments
 (0)