18
18
19
19
class LoadDataLocal :
20
20
def __init__ (self ):
21
- ONE (silent = True , password = 'international' )
21
+ ONE (base_url = 'https://openalyx.internationalbrainlab.org' , silent = True , password = 'international' )
22
22
self .brain_atlas = atlas .AllenAtlas (25 )
23
23
self .franklin_atlas = None
24
24
self .folder_path = None
@@ -99,8 +99,11 @@ def get_data(self):
99
99
100
100
shank_chns = np .bitwise_and (self .chn_coords_all [:, 0 ] >= shanks [self .shank_idx ][0 ],
101
101
self .chn_coords_all [:, 0 ] <= shanks [self .shank_idx ][1 ])
102
+ self .orig_idx = np .where (shank_chns )[0 ]
102
103
self .chn_coords = self .chn_coords_all [shank_chns , :]
104
+
103
105
else :
106
+ self .orig_idx = None
104
107
self .chn_coords = self .chn_coords_all
105
108
106
109
chn_depths = self .chn_coords [:, 1 ]
@@ -261,8 +264,7 @@ def upload_data(self, feature, track, xyz_channels):
261
264
with open (self .folder_path .joinpath (prev_align_filename ), "w" ) as f :
262
265
json .dump (original_json , f , indent = 2 , separators = (',' , ': ' ))
263
266
264
- @staticmethod
265
- def create_channel_dict (brain_regions ):
267
+ def create_channel_dict (self , brain_regions ):
266
268
"""
267
269
Create channel dictionary in form to write to json file
268
270
:param brain_regions: information about location of electrode channels in brain atlas
@@ -281,6 +283,9 @@ def create_channel_dict(brain_regions):
281
283
'brain_region_id' : int (brain_regions .id [i ]),
282
284
'brain_region' : brain_regions .acronym [i ]
283
285
}
286
+ if self .orig_idx is not None :
287
+ channel ['original_channel_idx' ] = int (self .orig_idx [i ])
288
+
284
289
data = {'channel_' + str (i ): channel }
285
290
channel_dict .update (data )
286
291
0 commit comments