diff --git a/spike_redetection/DataProvider.py b/spike_redetection/DataProvider.py deleted file mode 100644 index 6971475..0000000 --- a/spike_redetection/DataProvider.py +++ /dev/null @@ -1,20 +0,0 @@ - -from parser.CellData import CellData -from parser.DataParserFactory import DatParser - -class DataProvider: - - def __init__(self, data_path): - self.data_path = data_path - # self.cell = CellData(data_path) - self.parser = DatParser(data_path) - - def get_repros(self): - pass - - def get_stim_values(self, repro): - pass - - def get_trials(self, repro, stimulus_value): - pass - diff --git a/spike_redetection/SpikeRedetectGui.py b/spike_redetection/SpikeRedetectGui.py deleted file mode 100644 index 3de5fcd..0000000 --- a/spike_redetection/SpikeRedetectGui.py +++ /dev/null @@ -1,97 +0,0 @@ - -from PyQt5.QtWidgets import QWidget, QPushButton, QSizePolicy, QLineEdit,\ - QMessageBox, QVBoxLayout, QHBoxLayout, QGridLayout, QLabel, QFrame,\ - QDoubleSpinBox -from PyQt5.QtCore import pyqtSlot - -import numpy as np -from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas -from matplotlib.figure import Figure - - -class SpikeRedetectGui(QWidget): - - def __init__(self, data_provider): - super().__init__() - self.data_provider = data_provider - self.title = 'Spike Redetection' - self.left = 10 - self.top = 10 - self.width = 640 - self.height = 400 - self.initUI() - - def initUI(self): - self.setWindowTitle(self.title) - self.setGeometry(self.left, self.top, self.width, self.height) - - # Middle: - middle = QHBoxLayout() - - # Canvas for matplotlib figure - m = PlotCanvas(self, width=5, height=4) - m.move(0, 0) - middle.addWidget(m) - middle.addWidget(QVLine()) - - # Side (options) panel - panel = QFrame() - panel_layout = QVBoxLayout() - button = QPushButton('Button!', self) - button.setToolTip('A nice button!') - button.clicked.connect(m.plot) - panel_layout.addWidget(button) - - threshold_label = QLabel("Threshold:") - panel_layout.addWidget(threshold_label) - threshold_spinbox = QDoubleSpinBox(self) - threshold_spinbox.setValue(2) - threshold_spinbox.setSingleStep(0.5) - threshold_spinbox.valueChanged.connect(lambda: m.plot(threshold_spinbox.value())) - panel_layout.addWidget(threshold_spinbox) - - panel.setLayout(panel_layout) - middle.addWidget(panel) - - self.setLayout(middle) - self.show() - - -class PlotCanvas(FigureCanvas): - - def __init__(self, parent=None, width=5, height=4, dpi=100): - fig = Figure(figsize=(width, height), dpi=dpi) - self.axes = fig.add_subplot(111) - - FigureCanvas.__init__(self, fig) - self.setParent(parent) - - FigureCanvas.setSizePolicy(self, - QSizePolicy.Expanding, - QSizePolicy.Expanding) - FigureCanvas.updateGeometry(self) - self.plot() - - @pyqtSlot() - def plot(self, mean=1): - x = np.arange(0, 1, 0.0001) - data = np.sin(x*np.pi*2*mean) - ax = self.axes - ax.clear() - ax.plot(data, 'r-') - ax.set_title('Sinus Example') - self.draw() - - -class QHLine(QFrame): - def __init__(self): - super(QHLine, self).__init__() - self.setFrameShape(QFrame.HLine) - self.setFrameShadow(QFrame.Sunken) - - -class QVLine(QFrame): - def __init__(self): - super(QVLine, self).__init__() - self.setFrameShape(QFrame.VLine) - self.setFrameShadow(QFrame.Sunken) diff --git a/spike_redetection/__init__.py b/spike_redetection/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/spike_redetection/main.py b/spike_redetection/main.py deleted file mode 100644 index 2d18526..0000000 --- a/spike_redetection/main.py +++ /dev/null @@ -1,17 +0,0 @@ - -import sys -from PyQt5.QtWidgets import QApplication, QWidget, QPushButton - -from spike_redetection.DataProvider import DataProvider -from spike_redetection.SpikeRedetectGui import SpikeRedetectGui - - -def main(): - app = QApplication(sys.argv) - data_provider = DataProvider("../data/final_sam/2010-11-08-al-invivo-1") - ex = SpikeRedetectGui(data_provider) - sys.exit(app.exec_()) - - -if __name__ == '__main__': - main()