@@ -52,17 +52,13 @@ def run(self):
5252 try :
5353 logger .info (f"Kilosort version { kilosort .__version__ } " )
5454 logger .info (f"Sorting { self .data_path } " )
55+ clear_cache = settings ['clear_cache' ]
56+ if clear_cache :
57+ logger .info ('clear_cache=True' )
5558 logger .info ('-' * 40 )
5659
5760 tic0 = time .time ()
5861
59- # TODO: make these options in GUI
60- do_CAR = True
61- invert_sign = False
62-
63- if not do_CAR :
64- logger .info ("Skipping common average reference." )
65-
6662 if probe ['chanMap' ].max () >= settings ['n_chan_bin' ]:
6763 raise ValueError (
6864 f'Largest value of chanMap exceeds channel count of data, '
@@ -74,9 +70,13 @@ def run(self):
7470 data_dtype = settings ['data_dtype' ]
7571 device = self .device
7672 save_preprocessed_copy = settings ['save_preprocessed_copy' ]
73+ do_CAR = settings ['do_CAR' ]
74+ invert_sign = settings ['invert_sign' ]
75+ if not do_CAR :
76+ logger .info ("Skipping common average reference." )
7777
7878 ops = initialize_ops (settings , probe , data_dtype , do_CAR ,
79- invert_sign , device , save_preprocessed_copy )
79+ invert_sign , device , save_preprocessed_copy )
8080 # Remove some stuff that doesn't need to be printed twice,
8181 # then pretty-print format for log file.
8282 ops_copy = ops .copy ()
@@ -94,7 +94,7 @@ def run(self):
9494 torch .random .manual_seed (1 )
9595 ops , bfile , st0 = compute_drift_correction (
9696 ops , self .device , tic0 = tic0 , progress_bar = self .progress_bar ,
97- file_object = self .file_object
97+ file_object = self .file_object , clear_cache = clear_cache
9898 )
9999
100100 # Check scale of data for log file
@@ -113,7 +113,7 @@ def run(self):
113113 # Sort spikes and save results
114114 st , tF , Wall0 , clu0 = detect_spikes (
115115 ops , self .device , bfile , tic0 = tic0 ,
116- progress_bar = self .progress_bar
116+ progress_bar = self .progress_bar , clear_cache = clear_cache
117117 )
118118
119119 self .Wall0 = Wall0
@@ -123,7 +123,7 @@ def run(self):
123123
124124 clu , Wall = cluster_spikes (
125125 st , tF , ops , self .device , bfile , tic0 = tic0 ,
126- progress_bar = self .progress_bar
126+ progress_bar = self .progress_bar , clear_cache = clear_cache
127127 )
128128 ops , similar_templates , is_ref , est_contam_rate , kept_spikes = \
129129 save_sorting (ops , results_dir , st , clu , tF , Wall , bfile .imin , tic0 )
0 commit comments