Skip to content

Commit a015e1e

Browse files
authored
Merge pull request #37 from int-brain-lab/develop
Develop
2 parents a08e8be + 514ea80 commit a015e1e

File tree

10 files changed

+1135
-49
lines changed

10 files changed

+1135
-49
lines changed

atlaselectrophysiology/ephys_gui_setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import numpy as np
55
from random import randrange
66
from atlaselectrophysiology.AdaptedAxisItem import replace_axis
7+
from ibllib.qc.critical_reasons import REASONS_INS_CRIT_GUI
8+
79
pg.setConfigOption('background', 'w')
810
pg.setConfigOption('foreground', 'k')
911

@@ -490,7 +492,7 @@ def init_interaction_features(self):
490492
self.desc_layout = QtWidgets.QVBoxLayout()
491493
self.desc_layout.setSpacing(5)
492494
self.desc_buttons.setExclusive(False)
493-
options = ["Noise and artifact", "Drift", "Poor neural yield", "Brain Damage", "Other"]
495+
options = REASONS_INS_CRIT_GUI
494496
for i, val in enumerate(options):
495497

496498
button = QtWidgets.QCheckBox(val)

atlaselectrophysiology/extract_files.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ def rmsmap(fbin, spectra=True):
2727
:return: a dictionary with amplitudes in channeltime space, channelfrequency space, time
2828
and frequency scales
2929
"""
30-
if not isinstance(fbin, spikeglx.Reader):
31-
sglx = spikeglx.Reader(fbin)
30+
sglx = spikeglx.Reader(fbin, open=True)
3231
rms_win_length_samples = 2 ** np.ceil(np.log2(sglx.fs * RMS_WIN_LENGTH_SECS))
3332
# the window generator will generates window indices
3433
wingen = dsp.WindowGenerator(ns=sglx.ns, nswin=rms_win_length_samples, overlap=0)
@@ -58,6 +57,7 @@ def rmsmap(fbin, spectra=True):
5857
# print at least every 20 windows
5958
if (iw % min(20, max(int(np.floor(wingen.nwin / 75)), 1))) == 0:
6059
print_progress(iw, wingen.nwin)
60+
sglx.close()
6161
return win
6262

6363

atlaselectrophysiology/load_data.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import glob
1111
import os
1212
from atlaselectrophysiology.load_histology import download_histology_data, tif2nrrd
13+
import ibllib.qc.critical_reasons as usrpmt
1314

1415
ONE_BASE_URL = "https://alyx.internationalbrainlab.org"
1516

@@ -430,6 +431,9 @@ def upload_dj(self, align_qc, ephys_qc, ephys_desc):
430431
allow_direct_insert=True, replace=True)
431432
self.alyx_str = ephys_qc.upper() + ': ' + ephys_desc_str
432433

434+
if ephys_qc.upper() == 'CRITICAL':
435+
usrpmt.main_gui(eid=self.probe_id, reasons_selected=ephys_desc, one=self.one)
436+
433437
def update_qc(self, upload_alyx=True, upload_flatiron=True):
434438
# if resolved just update the alignment_number
435439
align_qc = AlignmentQC(self.probe_id, one=self.one, brain_atlas=self.brain_atlas)

0 commit comments

Comments
 (0)