diff --git a/PythonGUI_apps/DataBrowser.py b/PythonGUI_apps/DataBrowser.py
index 250e42a..3dea4ec 100644
--- a/PythonGUI_apps/DataBrowser.py
+++ b/PythonGUI_apps/DataBrowser.py
@@ -19,6 +19,9 @@
from PLQE_analysis import plqe_analysis
from H5_Pkl import h5_pkl_view, h5_view_and_plot
from Image_analysis import Image_analysis
+from Table import Table_widget
+from Export_Windows import Multi_Trace_Exporter
+
pg.mkQApp()
#pg.setConfigOption('background', 'w')
@@ -38,7 +41,8 @@ def __init__(self):
self.ui = WindowTemplate()
self.ui.setupUi(self)
self.ui.select_comboBox.addItems(["Lifetime Analysis", "Spectrum Analysis", "FLIM Analysis",
- "UV-Vis Analysis", "PLQE Analysis", "H5 View/Plot", "H5/PKL Viewer", "Image Analysis"])
+ "UV-Vis Analysis", "PLQE Analysis", "H5 View/Plot", "H5/PKL Viewer", "Image Analysis", "Table View",
+ "Mulit-Trace Exporter"])
self.ui.load_pushButton.clicked.connect(self.load_app)
self.show()
@@ -72,7 +76,12 @@ def load_app(self):
elif analysis_software == "Image Analysis":
self.image_window = Image_analysis.MainWindow()
self.image_window.show()
-
+ elif analysis_software == "Table View":
+ self.table_widget = Table_widget.MainWindow()
+ self.table_widget.show()
+ elif analysis_software == "Mulit-Trace Exporter":
+ self.trace_exporter = Multi_Trace_Exporter.MainWindow()
+ self.trace_exporter.show()
def run():
diff --git a/PythonGUI_apps/DataBrowser.spec b/PythonGUI_apps/DataBrowser.spec
index 372f922..1c2b037 100644
--- a/PythonGUI_apps/DataBrowser.spec
+++ b/PythonGUI_apps/DataBrowser.spec
@@ -1,10 +1,10 @@
-# -*- mode: python -*-
+# -*- mode: python ; coding: utf-8 -*-
block_cipher = None
-a = Analysis(['C:\\Users\\lindat18\\Dropbox\\Ginger_Lab\\Data_Analysis\\PythonGUI_apps\\DataBrowser.py'],
- pathex=['C:\\Users\\lindat18\\Dropbox\\Ginger_Lab\\Data_Analysis\\PythonGUI_apps'],
+a = Analysis(['DataBrowser.py'],
+ pathex=['E:\\QT_projects\\Python_GUI_apps\\PythonGUI_apps'],
binaries=[],
datas=[],
hiddenimports=['ipykernel.datapub'],
@@ -33,4 +33,5 @@ coll = COLLECT(exe,
a.datas,
strip=False,
upx=True,
+ upx_exclude=[],
name='DataBrowser')
diff --git a/PythonGUI_apps/Export_Windows/Export_window.py b/PythonGUI_apps/Export_Windows/Export_window.py
new file mode 100644
index 0000000..0e5cc63
--- /dev/null
+++ b/PythonGUI_apps/Export_Windows/Export_window.py
@@ -0,0 +1,77 @@
+# -*- coding: utf-8 -*-
+"""
+Created on Sun Nov 3 20:43:12 2019
+
+@author: sarth
+"""
+from pathlib import Path
+import pyqtgraph as pg
+from pyqtgraph.Qt import QtCore, QtGui
+
+"""Export Images GUI"""
+base_path = Path(__file__).parent
+ui_file_path = (base_path / "export_fig_gui.ui").resolve()
+exportFig_WindowTemplate, exportFig_TemplateBaseClass = pg.Qt.loadUiType(ui_file_path)
+
+class ExportFigureWindow(exportFig_TemplateBaseClass):
+
+ export_fig_signal = QtCore.pyqtSignal()
+
+ def __init__(self):
+ exportFig_TemplateBaseClass.__init__(self)
+
+ self.ui = exportFig_WindowTemplate()
+ self.ui.setupUi(self)
+ self.ui.cmap_comboBox.addItems(['viridis', 'plasma', 'inferno', 'magma',
+ 'cividis','Greys', 'Purples', 'Blues',
+ 'Greens', 'Oranges', 'Reds', 'YlOrBr',
+ 'YlOrRd', 'OrRd', 'PuRd', 'RdPu', 'BuPu',
+ 'GnBu', 'PuBu', 'YlGnBu', 'PuBuGn', 'BuGn',
+ 'YlGn', 'binary', 'gist_yarg', 'gist_gray',
+ 'gray', 'bone', 'pink', 'spring', 'summer',
+ 'autumn', 'winter', 'cool', 'Wistia', 'hot',
+ 'afmhot', 'gist_heat', 'copper', 'rainbow', 'jet'])
+ self.ui.cbar_checkBox.stateChanged.connect(self.cbar_title_state)
+ self.ui.exportFig_pushButton.clicked.connect(self.export)
+ self.show()
+
+ def cbar_title_state(self):
+ if self.ui.cbar_checkBox.isChecked():
+ self.ui.cbar_label.setEnabled(True)
+ else:
+ self.ui.cbar_label.setEnabled(False)
+
+ def export(self):
+ self.export_fig_signal.emit()
+ self.close()
+
+"""Export plot GUI"""
+ui_file_path = (base_path / "export_plot.ui").resolve()
+export_WindowTemplate, export_TemplateBaseClass = pg.Qt.loadUiType(ui_file_path)
+
+class ExportPlotWindow(export_TemplateBaseClass):
+
+ export_fig_signal = QtCore.pyqtSignal()
+
+ def __init__(self):
+ export_TemplateBaseClass.__init__(self)
+
+ self.ui = export_WindowTemplate()
+ self.ui.setupUi(self)
+ #self.ui.traceColor_comboBox.addItems(["C0","C1","C2","C3","C4","C5","C6","C7", "r", "g", "b", "y", "k"])
+ #self.ui.fitColor_comboBox.addItems(["k", "r", "b", "y", "g","C0","C1","C2","C3","C4","C5","C6","C7"])
+ self.ui.export_pushButton.clicked.connect(self.export)
+ #self.ui.legend_checkBox.stateChanged.connect(self.legend_title)
+ self.show()
+
+ #def legend_title(self):
+ # if self.ui.legend_checkBox.isChecked():
+ # self.ui.legend1_lineEdit.setEnabled(True)
+ # self.ui.legend2_lineEdit.setEnabled(True)
+ # else:
+ # self.ui.legend1_lineEdit.setEnabled(False)
+ # self.ui.legend2_lineEdit.setEnabled(False)
+
+ def export(self):
+ self.export_fig_signal.emit()
+ self.close()
\ No newline at end of file
diff --git a/PythonGUI_apps/Export_Windows/Multi_Trace_Exporter.py b/PythonGUI_apps/Export_Windows/Multi_Trace_Exporter.py
new file mode 100644
index 0000000..5d5555d
--- /dev/null
+++ b/PythonGUI_apps/Export_Windows/Multi_Trace_Exporter.py
@@ -0,0 +1,147 @@
+import pyqtgraph as pg
+from pathlib import Path
+from pyqtgraph.Qt import QtCore, QtGui, QtWidgets
+try:
+ from Lifetime_analysis.read_ph_phd import read_picoharp_phd, get_x_y
+except Exception as e:
+ print(e)
+import matplotlib.pyplot as plt
+
+"""Recylce params for plotting"""
+plt.rc('xtick', labelsize = 20)
+plt.rc('xtick.major', pad = 3)
+plt.rc('ytick', labelsize = 20)
+plt.rc('lines', lw = 2.5, markersize = 7.5)
+plt.rc('legend', fontsize = 20)
+plt.rc('axes', linewidth=3.5)
+
+pg.mkQApp()
+
+base_path = Path(__file__).parent
+file_path = (base_path / "Multi_Trace_Exporter.ui").resolve()
+
+uiFile = file_path
+
+WindowTemplate, TemplateBaseClass = pg.Qt.loadUiType(uiFile)
+
+class MainWindow(TemplateBaseClass):
+
+ def __init__(self):
+ super(TemplateBaseClass, self).__init__()
+
+ # Create the main window
+ self.ui = WindowTemplate()
+ self.ui.setupUi(self)
+
+ self.temp_layout = pg.GraphicsLayoutWidget()
+
+ # file system tree
+ self.fs_model = QtWidgets.QFileSystemModel()
+ self.fs_model.setRootPath(QtCore.QDir.currentPath())
+ self.ui.treeView.setModel(self.fs_model)
+ self.ui.treeView.setIconSize(QtCore.QSize(25,25))
+ self.ui.treeView.setSortingEnabled(True)
+
+ self.tree_selectionModel = self.ui.treeView.selectionModel()
+ self.tree_selectionModel.selectionChanged.connect(self.on_treeview_selection_change)
+
+ self.ui.comboBox.currentIndexChanged.connect(self.add_trace_to_temp_plot)
+ self.ui.add_pushButton.clicked.connect(self.add_trace_to_mem)
+ self.ui.export_pushButton.clicked.connect(self.pub_ready_plot_export)
+
+ self.x_i = []
+ self.y_i = []
+ self.x_mem = []
+ self.y_mem = []
+ self.legend = []
+
+ self.show()
+
+ def on_treeview_selection_change(self):
+ try:
+ fname = self.fs_model.filePath(self.tree_selectionModel.currentIndex())
+ _ , ext = fname.rsplit('.',1)
+
+ self.ui.comboBox.clear()
+ self.ui.textBrowser.clear()
+ self.x_i = []
+ self.y_i = []
+
+ if ext in ['phd']:
+ self.parser = read_picoharp_phd(fname)
+ curve_list = []
+
+ for i in range(self.parser.no_of_curves()):
+ curve_list.append("Curve "+str(i))
+ x, y = get_x_y(i, self.parser, smooth_trace=self.ui.smooth_checkBox.isChecked(), boxwidth=self.ui.smooth_spinBox.value())
+ self.x_i.append(x)
+ self.y_i.append(y)
+
+ self.ui.comboBox.addItems(curve_list)
+ self.ui.textBrowser.setText(str(self.parser.info()))
+
+ else:
+ self.ui.textBrowser.setText(str("Select a PicoHarp File"))
+ except Exception as e:
+ print(e)
+
+ def add_trace_to_temp_plot(self):
+ try:
+ #self.temp_layout = pg.GraphicsLayoutWidget()
+ self.temp_layout.clear()
+ self.temp_plot = self.temp_layout.addPlot(title = "Current Selection")
+ self.temp_plot.plot(self.x_i[self.ui.comboBox.currentIndex()], self.y_i[self.ui.comboBox.currentIndex()], pen='r')
+ self.temp_plot.setLogMode(False, True)
+ self.temp_layout.show()
+ except Exception as e:
+ print(e)
+
+ def add_trace_to_mem(self):
+ try:
+ self.x_mem.append(self.x_i[self.ui.comboBox.currentIndex()])
+ self.y_mem.append(self.y_i[self.ui.comboBox.currentIndex()])
+ self.legend.append(self.ui.lineEdit.text())
+ except Exception as e:
+ print(e)
+
+ def pub_ready_plot_export(self):
+ try:
+ filename = QtWidgets.QFileDialog.getSaveFileName(self,caption="Filename with EXTENSION")
+
+ plt.figure(figsize=(8,6))
+ plt.tick_params(direction='out', length=8, width=3.5)
+ for i in range(len(self.x_mem)):
+ if self.ui.Normalize_checkBox.isChecked():
+ plt.plot(self.x_mem[i], self.y_mem[i]/max(self.y_mem[i]), label=str(self.legend[i]))
+ else:
+ plt.plot(self.x_mem[i], self.y_mem[i], label=str(self.legend[i]))
+
+ plt.yscale('log')
+ plt.xlabel("Time (ns)", fontsize=20, fontweight='bold')
+ plt.ylabel("Intensity (norm.)", fontsize=20, fontweight='bold')
+ plt.legend()
+ plt.tight_layout()
+
+ plt.savefig(filename[0],bbox_inches='tight', dpi=300)
+ plt.close()
+
+ self.clear_memory()
+
+ except Exception as e:
+ print(e)
+ pass
+
+ def clear_memory(self):
+ self.x_mem = []
+ self.y_mem = []
+ self.legend = []
+
+
+
+
+def run():
+ win = MainWindow()
+ QtGui.QApplication.instance().exec_()
+ return win
+
+#run()
\ No newline at end of file
diff --git a/PythonGUI_apps/Export_Windows/Multi_Trace_Exporter.ui b/PythonGUI_apps/Export_Windows/Multi_Trace_Exporter.ui
new file mode 100644
index 0000000..7b59ef1
--- /dev/null
+++ b/PythonGUI_apps/Export_Windows/Multi_Trace_Exporter.ui
@@ -0,0 +1,85 @@
+
+
+ MainWindow
+
+
+
+ 0
+ 0
+ 1108
+ 1063
+
+
+
+ MainWindow
+
+
+
+ -
+
+
+ -
+
+
+ Smoothen Trace
+
+
+
+ -
+
+
+ Enter Trace Legend Here
+
+
+
+ -
+
+
+ Add
+
+
+
+ -
+
+
+ Normalize (for export)
+
+
+
+ -
+
+
+ 1
+
+
+
+ -
+
+
+ Export
+
+
+
+ -
+
+
+ -
+
+
+
+
+
+
+
+
+
+
diff --git a/PythonGUI_apps/Export_Windows/__init__.py b/PythonGUI_apps/Export_Windows/__init__.py
new file mode 100644
index 0000000..7c68785
--- /dev/null
+++ b/PythonGUI_apps/Export_Windows/__init__.py
@@ -0,0 +1 @@
+# -*- coding: utf-8 -*-
\ No newline at end of file
diff --git a/PythonGUI_apps/Export_Windows/export_fig_gui.ui b/PythonGUI_apps/Export_Windows/export_fig_gui.ui
new file mode 100644
index 0000000..e80e065
--- /dev/null
+++ b/PythonGUI_apps/Export_Windows/export_fig_gui.ui
@@ -0,0 +1,171 @@
+
+
+ ExportFigure
+
+
+
+ 0
+ 0
+ 420
+ 369
+
+
+
+ Form
+
+
+ -
+
+
+
+ 15
+
+
+
+ 1000000000
+
+
+
+ -
+
+
+
+ 15
+
+
+
+ Color Bar Label
+
+
+
+ -
+
+
+
+ 15
+
+
+
+ Data Channel to Save
+
+
+
+ -
+
+
+
+ 15
+
+
+
+
+ -
+
+
+
+ 15
+
+
+
+
+ -
+
+
+
+ 15
+
+
+
+ ColorMap
+
+
+
+ -
+
+
+
+ 15
+
+
+
+ 1000000000
+
+
+
+ -
+
+
+
+ 15
+
+
+
+ ColorBar Min
+
+
+
+ -
+
+
+
+ 15
+
+
+
+ ColorBar Max
+
+
+
+ -
+
+
+ false
+
+
+
+ 15
+
+
+
+
+ -
+
+
+
+ 15
+
+
+
+ Export Figure
+
+
+
+ -
+
+
+
+ 15
+
+
+
+ Reversed
+
+
+
+ -
+
+
+
+ 15
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PythonGUI_apps/Export_Windows/export_plot.ui b/PythonGUI_apps/Export_Windows/export_plot.ui
new file mode 100644
index 0000000..840264f
--- /dev/null
+++ b/PythonGUI_apps/Export_Windows/export_plot.ui
@@ -0,0 +1,186 @@
+
+
+ Form
+
+
+
+ 0
+ 0
+ 930
+ 435
+
+
+
+ Form
+
+
+ -
+
+
+
+ 10
+
+
+
+ 4
+
+
+ -100.000000000000000
+
+
+ 10000000000000000000000.000000000000000
+
+
+ 1.500000000000000
+
+
+
+ -
+
+
+
+ 10
+
+
+
+ Lower
+
+
+
+ -
+
+
+
+ 10
+
+
+
+ Lower
+
+
+
+ -
+
+
+
+ 10
+
+
+
+ Upper
+
+
+
+ -
+
+
+
+ 15
+
+
+
+ Export Graph
+
+
+
+ -
+
+
+
+ 12
+
+
+
+ Y limits
+
+
+
+ -
+
+
+
+ 10
+
+
+
+ Upper
+
+
+
+ -
+
+
+
+ 12
+
+
+
+ X limits
+
+
+
+ -
+
+
+
+ 10
+
+
+
+ 4
+
+
+ -10000.000000000000000
+
+
+ 1000000000000000000.000000000000000
+
+
+ 0.010000000000000
+
+
+
+ -
+
+
+
+ 10
+
+
+
+ 4
+
+
+ -10000000.000000000000000
+
+
+ 100000000000.000000000000000
+
+
+
+ -
+
+
+
+ 10
+
+
+
+ 4
+
+
+ -1000000000.000000000000000
+
+
+ 10000000000000.000000000000000
+
+
+ 10000.000000000000000
+
+
+
+
+
+
+
+
diff --git a/PythonGUI_apps/FLIM_analysis/FLIM_plot.py b/PythonGUI_apps/FLIM_analysis/FLIM_plot.py
index 8a0124f..5f5744f 100644
--- a/PythonGUI_apps/FLIM_analysis/FLIM_plot.py
+++ b/PythonGUI_apps/FLIM_analysis/FLIM_plot.py
@@ -13,8 +13,15 @@
sys.path.append(os.path.abspath('../Lifetime_analysis'))
sys.path.append(os.path.abspath('../Spectrum_analysis'))
+sys.path.append(os.path.abspath('../H5_Pkl'))
+sys.path.append(os.path.abspath('../Export_Windows'))
from Lifetime_analysis import Lifetime_plot_fit
from Spectrum_analysis import Spectra_plot_fit
+from H5_Pkl import h5_pkl_view
+try:
+ from Export_window import ExportFigureWindow
+except:
+ from Export_Windows.Export_window import ExportFigureWindow
# local modules
pg.mkQApp()
@@ -48,7 +55,7 @@ def __init__(self):
self.ui.load_scan_pushButton.clicked.connect(self.open_file)
self.ui.plot_intensity_sums_pushButton.clicked.connect(self.plot_intensity_sums)
self.ui.plot_raw_hist_data_pushButton.clicked.connect(self.plot_raw_scan)
- self.ui.save_intensities_image_pushButton.clicked.connect(self.save_intensities_image)
+ self.ui.save_intensities_image_pushButton.clicked.connect(self.export_window)
self.ui.save_intensities_array_pushButton.clicked.connect(self.save_intensities_array)
self.ui.compare_checkBox.stateChanged.connect(self.switch_compare)
self.ui.intensity_sums_viewBox.roi.sigRegionChanged.connect(self.line_profile_update_plot)
@@ -62,17 +69,30 @@ def __init__(self):
def open_file(self):
""" Open FLIM scan file """
try:
- self.filename = QtWidgets.QFileDialog.getOpenFileName(self, filter="Scan files (*.pkl *.h5)")
+ self.filename = QtWidgets.QFileDialog.getOpenFileName(self, filter="Scan files (*.pkl *.h5 *.txt)")
if ".pkl" in self.filename[0]:
self.flim_scan_file = pickle.load(open(self.filename[0], 'rb'))
self.scan_file_type = "pkl"
+ self.launch_h5_pkl_viewer()
+ self.get_data_params()
elif ".h5" in self.filename[0]:
self.flim_scan_file = h5py.File(self.filename[0], 'r')
self.scan_file_type = "h5"
- self.get_data_params()
+ self.launch_h5_pkl_viewer()
+ self.get_data_params()
+ elif ".txt" in self.filename[0]:
+ self.intensity_sums = np.loadtxt(self.filename[0]).T
+ self.stepsize_window = StepSizeWindow()
+ self.stepsize_window.stepsize_signal.connect(self.get_stepsize)
+ self.scan_file_type = "txt"
# self.pkl_file = pickle.load(open(self.filename[0], 'rb'))
except Exception as err:
print(format(err))
+
+ def launch_h5_pkl_viewer(self):
+ """ Launches H5/PKL viewer to give an insight into the data and its structure"""
+ viewer_window = h5_pkl_view.H5PklView(sys.argv)
+ viewer_window.settings['data_filename'] = self.filename[0]
def import_pkl_to_convert(self):
""" Open pkl file to convert to h5 """
@@ -81,6 +101,14 @@ def import_pkl_to_convert(self):
self.ui.result_textBrowser.append("Done Loading - .pkl to convert")
except:
pass
+
+ def get_stepsize(self):
+ """ Get step size from user input -- specfically written for loading
+ txt files from legacy labview code, but can also be run on txt file
+ saved using the new FLIM acquistion code """
+ self.stepsize = self.stepsize_window.ui.stepsize_doubleSpinBox.value()
+ self.x_step_size = self.stepsize
+ self.y_step_size = self.stepsize
def get_data_params(self):
@@ -106,14 +134,19 @@ def get_data_params(self):
def plot_intensity_sums(self):
try:
- self.hist_data = np.reshape(self.hist_data, newshape=(self.hist_data.shape[0], self.numb_x_pixels*self.numb_y_pixels))
- self.intensity_sums = np.sum(self.hist_data, axis=0) #sum intensities for each pixel
- self.intensity_sums = np.reshape(self.intensity_sums, newshape=(self.numb_x_pixels, self.numb_y_pixels))
+ if self.scan_file_type is "pkl" or self.scan_file_type is "h5":
+ pg.setConfigOption('imageAxisOrder', 'row-major')
+ self.hist_data = np.reshape(self.hist_data, newshape=(self.hist_data.shape[0], self.numb_x_pixels*self.numb_y_pixels))
+ self.intensity_sums = np.sum(self.hist_data, axis=0) #sum intensities for each pixel
+ self.intensity_sums = np.reshape(self.intensity_sums, newshape=(self.numb_x_pixels, self.numb_y_pixels))
+ else:
+ pg.setConfigOption('imageAxisOrder', 'col-major')
self.ui.intensity_sums_viewBox.view.invertY(False) # stop y axis invert
self.ui.intensity_sums_viewBox.setImage(self.intensity_sums, scale=
(self.x_step_size,
self.y_step_size))
- self.ui.intensity_sums_viewBox.roi.setSize([self.x_scan_size, self.y_step_size]) #line roi
+ if self.scan_file_type is "pkl" or self.scan_file_type is "h5":
+ self.ui.intensity_sums_viewBox.roi.setSize([self.x_scan_size, self.y_step_size]) #line roi
scale = pg.ScaleBar(size=1,suffix='um')
scale.setParentItem(self.ui.intensity_sums_viewBox.view)
scale.anchor((1, 1), (1, 1), offset=(-30, -30))
@@ -234,6 +267,12 @@ def on_analyze_lifetime(self):
self.lifetime_window.opened_from_flim = True
self.lifetime_window.hist_data_from_flim = np.asarray(self.get_raw_hist_curve(0))
self.lifetime_window.ui.Result_textBrowser.setText("Data successfully loaded from FLIM analysis.")
+
+ def export_window(self):
+ self.export_window = ExportFigureWindow()
+ self.export_window.ui.vmin_spinBox.setValue(np.min(self.intensity_sums))
+ self.export_window.ui.vmax_spinBox.setValue(np.max(self.intensity_sums))
+ self.export_window.export_fig_signal.connect(self.save_intensities_image)
def save_intensities_image(self):
try:
@@ -241,7 +280,18 @@ def save_intensities_image(self):
filename_ext = os.path.basename(self.filename[0])
filename = os.path.splitext(filename_ext)[0] #get filename without extension
save_to = folder + "\\" + filename + "_intensity_sums.png"
- cpm.plot_confocal(self.intensity_sums, FLIM_adjust=False, stepsize=np.abs(self.x_step_size))
+ if self.export_window.ui.reverse_checkBox.isChecked():
+ colormap = str(self.export_window.ui.cmap_comboBox.currentText())+"_r"
+ else:
+ colormap = str(self.export_window.ui.cmap_comboBox.currentText())
+ if self.export_window.ui.cbar_checkBox.isChecked():
+ label = str(self.export_window.ui.cbar_label.text())
+ else:
+ label = "PL Intensity (a.u.)"
+ cpm.plot_confocal(self.intensity_sums, FLIM_adjust=False,
+ stepsize=np.abs(self.x_step_size),cmap=colormap,
+ cbar_label=label, vmin=self.export_window.ui.vmin_spinBox.value(),
+ vmax=self.export_window.ui.vmax_spinBox.value())
plt.savefig(save_to, bbox_inches='tight', dpi=300)
except Exception as e:
print(format(e))
@@ -292,6 +342,28 @@ def close_application(self):
else:
pass
+"""Skip rows GUI"""
+ui_file_path = (base_path / "step_size_labview_files.ui").resolve()
+stepsize_WindowTemplate, stepsize_TemplateBaseClass = pg.Qt.loadUiType(ui_file_path)
+
+class StepSizeWindow(stepsize_TemplateBaseClass):
+
+ stepsize_signal = QtCore.pyqtSignal() #signal to help with pass info back to MainWindow
+
+ def __init__(self):
+ stepsize_TemplateBaseClass.__init__(self)
+
+ # Create the param window
+ self.ui = stepsize_WindowTemplate()
+ self.ui.setupUi(self)
+ self.ui.done_pushButton.clicked.connect(self.done)
+ self.setWindowFlag(QtCore.Qt.WindowCloseButtonHint, False)
+ self.show()
+
+ def done(self):
+ self.stepsize_signal.emit()
+ self.close()
+
"""Run the Main Window"""
def run():
win = MainWindow()
diff --git a/PythonGUI_apps/FLIM_analysis/step_size_labview_files.ui b/PythonGUI_apps/FLIM_analysis/step_size_labview_files.ui
new file mode 100644
index 0000000..2078fb7
--- /dev/null
+++ b/PythonGUI_apps/FLIM_analysis/step_size_labview_files.ui
@@ -0,0 +1,61 @@
+
+
+ Form
+
+
+
+ 0
+ 0
+ 255
+ 75
+
+
+
+ Form
+
+
+ -
+
+
+
+ 12
+
+
+
+ Step Size (um)
+
+
+
+ -
+
+
+ Done!
+
+
+
+ -
+
+
+
+ 12
+
+
+
+ 4
+
+
+ 100.000000000000000
+
+
+ 0.100000000000000
+
+
+ 0.100000000000000
+
+
+
+
+
+
+
+
diff --git a/PythonGUI_apps/H5_Pkl/h5_tree.py b/PythonGUI_apps/H5_Pkl/h5_tree.py
index c087f78..6d82566 100644
--- a/PythonGUI_apps/H5_Pkl/h5_tree.py
+++ b/PythonGUI_apps/H5_Pkl/h5_tree.py
@@ -40,6 +40,7 @@ def on_change_data_filename(self, fname=None):
self.f = h5py.File(fname, 'r')
self.on_new_search_text()
self.databrowser.ui.statusbar.showMessage("")
+ return self.f
except Exception as err:
msg = "Failed to load %s:\n%s" %(fname, err)
diff --git a/PythonGUI_apps/H5_Pkl/h5_view_and_plot.py b/PythonGUI_apps/H5_Pkl/h5_view_and_plot.py
index 760cd46..18f3635 100644
--- a/PythonGUI_apps/H5_Pkl/h5_view_and_plot.py
+++ b/PythonGUI_apps/H5_Pkl/h5_view_and_plot.py
@@ -73,7 +73,7 @@ def on_change_data_filename(self):
try:
fname = self.settings.data_filename.val
if os.path.isfile(fname):
- self.h5treeview.on_change_data_filename(fname)
+ self.f = self.h5treeview.on_change_data_filename(fname)
self.ui.dataview_placeholder.hide()
self.h5treeview.ui.show()
except:
@@ -96,8 +96,12 @@ def plot_dataset(self):
elif self.dataset_shape == 2 and self.ui.image_radioButton.isChecked():
self.data_img.setImage(data)
elif self.dataset_shape == 3:
- x_start = self.ui.imageView_x_start_spinBox.value()
- x_end = self.ui.imageView_x_end_spinBox.value()
+ if self.f['Cube/Info/Cube'].attrs['AcqMode'] == b'Hyperspectral Acquisition': # This works for our PhotonEtc. Hyperspectral Camera output
+ x_start = int(self.f['Cube/Info/Cube'].attrs['LowerWavelength'])
+ x_end = int(self.f['Cube/Info/Cube'].attrs['UpperWavelength'])
+ else:
+ x_start = self.ui.imageView_x_start_spinBox.value()
+ x_end = self.ui.imageView_x_end_spinBox.value()
num_points = self.dataset.shape[0]
x_values = np.linspace(x_start, x_end, num_points) #scale x axis
self.ui.data_imageView.setImage(data, xvals=x_values)
diff --git a/PythonGUI_apps/H5_Pkl/pkl_tree.py b/PythonGUI_apps/H5_Pkl/pkl_tree.py
index 3a24c76..e60a85e 100644
--- a/PythonGUI_apps/H5_Pkl/pkl_tree.py
+++ b/PythonGUI_apps/H5_Pkl/pkl_tree.py
@@ -3,6 +3,7 @@
import h5py
import pickle
import numpy as np
+import lmfit
class PklTreeSearchView(DataBrowserView):
@@ -85,11 +86,13 @@ def traverse_dict(self, dictionary, previous_dict, level):
self.tree_str += indent + "|> {}/
".format(print_string)
level += 1
previous_dict = dictionary[key]
- self.traverse_dict(dictionary[key], previous_dict, level)
+ self.traverse_dict(dictionary[key], previous_dict, level)
else:
value = dictionary[key]
if type(value) == np.ndarray or type(value)==np.memmap:
value = str(value.shape) + " " + str(value.dtype)
+ elif type(value) == lmfit.model.ModelResult:
+ value = "lmfit.model.ModelResult"
# if type(value) == list and len(value) > 5: ##account for data stored in lists
# value = str(np.asarray(value).shape) + " " + str(type(value[0]))
diff --git a/PythonGUI_apps/Lifetime_analysis/Lifetime_analysis_gui_layout.ui b/PythonGUI_apps/Lifetime_analysis/Lifetime_analysis_gui_layout.ui
index e80df57..24b97b0 100644
--- a/PythonGUI_apps/Lifetime_analysis/Lifetime_analysis_gui_layout.ui
+++ b/PythonGUI_apps/Lifetime_analysis/Lifetime_analysis_gui_layout.ui
@@ -6,8 +6,8 @@
0
0
- 1490
- 1201
+ 2620
+ 1676
@@ -925,6 +925,23 @@
+ -
+
+
+ 4
+
+
+ 9999999.000000000000000
+
+
+
+ -
+
+
+ 0
+
+
+
-
@@ -932,13 +949,23 @@
- -
+
-
SRV (cm/s)
+ -
+
+
+ 100000.000000000000000
+
+
+ 8000.000000000000000
+
+
+
-
@@ -946,58 +973,64 @@
- -
-
+
-
+
- SRV1 = SRV2
+ Surface Lifetime (ns)
- -
-
+
-
+
- Calculate
+ Average Lifetime (ns)
- -
-
-
- 100000.000000000000000
-
-
- 8000.000000000000000
+
-
+
+
+ Calculate
- -
-
+
-
+
- Surface Lifetime (ns)
+ SRV (cm/s)
- -
-
+
-
+
0
- -
-
+
-
+
+
+
+ 75
+ true
+
+
- Average Lifetime (ns)
+ SRV1 = SRV2
- -
-
-
- 4
+
-
+
+
+
+ 75
+ true
+
-
- 9999999.000000000000000
+
+ SRV1 = 0
@@ -1038,32 +1071,24 @@
Export Settings
- -
-
+
-
+
- Export data
+ For Figure:
- -
-
-
-
- 12
-
-
+
-
+
- Save with Fit
-
-
- true
+ Export Fit Data
- -
+
-
- Clear export data
+ Clear Export Memory
@@ -1081,6 +1106,27 @@
+ -
+
+
+ For Data:
+
+
+
+ -
+
+
+ Enter Legend Here...
+
+
+
+ -
+
+
+ Add trace to memory
+
+
+
@@ -1181,6 +1227,9 @@
-
+
+ false
+
12
@@ -1251,6 +1300,36 @@
+ -
+
+
+
+ 12
+
+
+
+ Smooth Data
+
+
+
+ -
+
+
+ false
+
+
+
+ 12
+
+
+
+ 1
+
+
+ 1000
+
+
+
@@ -1261,8 +1340,8 @@
0
0
- 1490
- 21
+ 2620
+ 38
- -
-
-
- Peak Center 1 (nm)
+
-
+
+
+ 9999.000000000000000
+
+
+ 780.000000000000000
@@ -144,13 +147,10 @@
- -
-
-
- 9999.000000000000000
-
-
- 780.000000000000000
+
-
+
+
+ Peak Center 1 (nm)
@@ -408,13 +408,10 @@
- -
-
-
- 9999.000000000000000
-
-
- 770.000000000000000
+
-
+
+
+ Sigma 1 (nm)
@@ -425,10 +422,13 @@
- -
-
-
- Sigma 1 (nm)
+
-
+
+
+ 9999.000000000000000
+
+
+ 770.000000000000000
@@ -612,6 +612,21 @@
+ -
+
+
+
+ 10
+
+
+
+ Fit/Plot in eV
+
+
+ true
+
+
+
-
@@ -624,8 +639,21 @@
+ -
+
+
+ false
+
+
+ Save Entire Fit Model (File will be large and will take longer)
+
+
+
-
+
+ false
+
10
@@ -759,43 +787,39 @@
Load Settings
-
-
-
+
-
+
10
- Background
-File
+ Spectrum File
- -
-
+
-
+
10
- Normalize
+ Export Figure
- -
-
+
-
+
10
- Clear Plots Everytime
-
-
- true
+ Clear Export Memory
@@ -811,28 +835,39 @@ File
- -
-
+
-
+
10
- For Single Spectrum
+ White Light Ref File
- -
-
+
-
+
+
+
+ 10
+
+
+
+ Enter Legend Here...
+
+
+
+ -
+
10
- White Light
-Ref File
+ For Single Spectrum
@@ -851,41 +886,43 @@ Ref File
- -
-
+
-
+
10
- Spectrum
-File
+ Export Fit Data
- -
-
+
-
+
10
- Export data
+ Add Trace to Memory
- -
-
+
-
+
10
+
+ Plot without Background
+
- -
+
-
@@ -899,53 +936,83 @@ File
- -
-
+
-
+
10
- Export Publication
-Ready Figure
+ Background File
- -
-
+
-
+
10
- Plot without Background
+ Clear Plots Everytime
+
+
+ true
- -
-
+
-
+
10
- false
- Clear Plot
+ Normalize
- -
-
+
-
+
10
+ false
- Clear export data
+ Clear Plot
+
+
+
+ -
+
+
+ Export Settings
+
+
+
+ -
+
+
+ For Data
+
+
+
+ -
+
+
+ For Figure
+
+
+
+ -
+
+
+ Plot Control
@@ -953,7 +1020,13 @@ Ready Figure
-
-
+
+
+
+ 10
+
+
+
@@ -962,61 +1035,178 @@ Ready Figure
Scan Spectra Data
- -
-
-
-
-
-
-
-
-
-
- 15
-
-
-
- For Raw Scan Data
-
-
-
- -
-
-
-
- 12
-
-
-
- Plot
-
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
+
-
+
+
-
+
+
- 0
- 300
+ 210
+ 16777215
+
+
+ 12
+
+
+
+ Load Settings
+
+
+
-
+
+
+
+ 12
+
+
+
+ Spectra Scan
+File
+
+
+
+ -
+
+
+
+ 12
+
+
+
+ Background
+File
+
+
+
+ -
+
+
+
+ 12
+
+
+
+ Load Only
+ Fit File
+
+
+
+ -
+
+
+
+ 12
+
+
+
+ For Scan Data
+
+
+
+
+
+
+ -
+
+
+
+ 12
+
+
+
+
+ -
+
+
+
+ 12
+
+
+
+ Export Fitted
+Scan
+
-
-
- -
-
-
+
+
+
+ 12
+
+
+
+ Launch Data Viewer
+
+
+
+ -
+
+
+
+ 12
+
+
+
+ After Fitting Scan Data
+
+
+
+ -
+
+
+
+ 12
+
+
+
+ Intensity Sums
+
+
+
+ -
+
+
+
+ 12
+
+
+
+ For Raw Scan Data
+
+
+
+ -
+
+
+
+ 12
+
+
+
+ Plot
+
+
+
+ -
+
+
+
+ 12
+
+
+
+ Plot
+
+
+
+ -
- 15
+ 12
-
@@ -1029,82 +1219,63 @@ Ready Figure
fwhm
- -
-
- sigma
-
-
- -
-
- height
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 0
- 300
-
-
-
-
- -
-
-
- 2000
-
-
- 100
+
-
+
+
+
+ 12
+
-
-
- -
-
- # X points
+ Plot
- -
-
+
-
+
+
+
+ 12
+
+
- # Y points
+ Export Settings
- -
-
+
-
+
12
- Plot
+ Analyze Spectra Fits
- -
-
-
- 2000
+
-
+
+
+
+ 12
+
-
- 100
+
+ For Fit Scale
- -
+
-
+
+
+ 12
+
+
Use Raw Scan Settings
@@ -1113,162 +1284,52 @@ Ready Figure
- -
-
+
-
+
- 15
+ 12
- After Fitting Scan Data
+ # X points
-
-
- -
-
-
-
-
-
-
-
-
-
- 15
-
-
-
- Intensity Sums
-
-
-
- -
-
-
-
- 12
-
-
-
- Plot
-
-
-
-
+ -
+
+
+
+ 12
+
+
+
+ # Y points
+
+
- -
-
-
-
- 0
- 0
-
+
-
+
+
+ 2000
-
-
- 0
- 300
-
+
+ 100
+
+
+
+ -
+
+
+ 2000
+
+
+ 100
- -
-
-
- Qt::Horizontal
-
-
-
- -
-
-
-
- 210
- 16777215
-
-
-
-
- 15
-
-
-
- Load Settings
-
-
-
-
-
-
-
- 12
-
-
-
- For Scan Data
-
-
-
- -
-
-
-
- 12
-
-
-
- Spectra Scan
-File
-
-
-
- -
-
-
-
- 12
-
-
-
- Background
-File
-
-
-
- -
-
-
-
- 12
-
-
-
- Load Only
- Fit File
-
-
-
- -
-
-
-
- 12
-
-
-
- Export Fitted
-Scan
-
-
-
- -
-
-
-
-
-
@@ -1363,6 +1424,24 @@ Scan
Import .pkl file
+
+
+
+ 390
+ 20
+ 327
+ 43
+
+
+
+
+ 12
+
+
+
+ Launch Data Viewer
+
+
@@ -1373,25 +1452,13 @@ Scan
0
0
- 1728
- 21
+ 2115
+ 38
-
-
- ImageView
- QGraphicsView
-
-
-
- PlotWidget
- QGraphicsView
-
-
-
diff --git a/PythonGUI_apps/Spectrum_analysis/analyze_fit_results.ui b/PythonGUI_apps/Spectrum_analysis/analyze_fit_results.ui
new file mode 100644
index 0000000..7669c5a
--- /dev/null
+++ b/PythonGUI_apps/Spectrum_analysis/analyze_fit_results.ui
@@ -0,0 +1,91 @@
+
+
+ Form
+
+
+
+ 0
+ 0
+ 664
+ 136
+
+
+
+ Analze Fit Results
+
+
+ -
+
+
-
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Raised
+
+
+
-
+
+
+
+ 12
+
+
+
+ Check!
+
+
+
+ -
+
+
+
+ 12
+
+
+
+ 1000000000
+
+
+
+ -
+
+
+
+ 12
+
+
+
+ Result number:
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+
+ 15
+
+
+
+ Analyze Fit Results
+
+
+ Qt::AlignCenter
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PythonGUI_apps/Spectrum_analysis/peak_bounds_input.ui b/PythonGUI_apps/Spectrum_analysis/peak_bounds_input.ui
deleted file mode 100644
index c532068..0000000
--- a/PythonGUI_apps/Spectrum_analysis/peak_bounds_input.ui
+++ /dev/null
@@ -1,122 +0,0 @@
-
-
- MainWindow
-
-
-
- 0
- 0
- 359
- 600
-
-
-
- MainWindow
-
-
-
- -
-
-
-
-
-
-
- 15
-
-
-
- Peak Center
-
-
-
- -
-
-
-
- 12
-
-
-
- Minimum (nm)
-
-
-
- -
-
-
-
- 12
-
-
-
- 300.000000000000000
-
-
- 1000.000000000000000
-
-
- 500.000000000000000
-
-
-
- -
-
-
-
- 12
-
-
-
- Maximum (nm)
-
-
-
- -
-
-
-
- 12
-
-
-
- 300.000000000000000
-
-
- 1000.000000000000000
-
-
- 600.000000000000000
-
-
-
-
-
- -
-
-
-
- 15
-
-
-
- Done!
-
-
-
-
-
-
-
-
-
-
-
diff --git a/PythonGUI_apps/Spectrum_analysis/pyqtgraph_MATPLOTLIBWIDGET.py b/PythonGUI_apps/Spectrum_analysis/pyqtgraph_MATPLOTLIBWIDGET.py
new file mode 100644
index 0000000..ba2f59c
--- /dev/null
+++ b/PythonGUI_apps/Spectrum_analysis/pyqtgraph_MATPLOTLIBWIDGET.py
@@ -0,0 +1,56 @@
+# -*- coding: utf-8 -*-
+"""
+Created on Mon Sep 2 13:02:50 2019
+
+@author: Sarthak
+"""
+
+from pyqtgraph.Qt import QtGui, QtCore, USE_PYSIDE, USE_PYQT5
+import matplotlib
+
+#if not USE_PYQT5:
+# if USE_PYSIDE:
+# matplotlib.rcParams['backend.qt4']='PySide'
+#
+# from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
+# from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg as NavigationToolbar
+#else:
+from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
+from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolbar
+
+from matplotlib.figure import Figure
+
+if matplotlib.get_backend() is not 'Qt5Agg':
+ matplotlib.use('Qt5Agg')
+
+class MatplotlibWidget(QtGui.QWidget):
+ """
+ Implements a Matplotlib figure inside a QWidget.
+ Use getFigure() and redraw() to interact with matplotlib.
+
+ Example::
+
+ mw = MatplotlibWidget()
+ subplot = mw.getFigure().add_subplot(111)
+ subplot.plot(x,y)
+ mw.draw()
+ """
+
+ def __init__(self, size=(5.0, 4.0), dpi=100):
+ QtGui.QWidget.__init__(self)
+ self.fig = Figure(size, dpi=dpi)
+ self.canvas = FigureCanvas(self.fig)
+ self.canvas.setParent(self)
+ self.toolbar = NavigationToolbar(self.canvas, self)
+
+ self.vbox = QtGui.QVBoxLayout()
+ self.vbox.addWidget(self.toolbar)
+ self.vbox.addWidget(self.canvas)
+
+ self.setLayout(self.vbox)
+
+ def getFigure(self):
+ return self.fig
+
+ def draw(self):
+ self.canvas.draw()
\ No newline at end of file
diff --git a/PythonGUI_apps/Table/Table_widget.py b/PythonGUI_apps/Table/Table_widget.py
new file mode 100644
index 0000000..4c7b447
--- /dev/null
+++ b/PythonGUI_apps/Table/Table_widget.py
@@ -0,0 +1,145 @@
+# -*- coding: utf-8 -*-
+"""
+Created on Mon Sep 2 17:04:49 2019
+
+@author: Sarthak
+"""
+
+from pathlib import Path
+import pyqtgraph as pg
+from pyqtgraph.python2_3 import asUnicode
+from pyqtgraph.Qt import QtCore, QtGui
+
+
+pg.mkQApp()
+pg.setConfigOption('background', 'w')
+
+
+base_path = Path(__file__).parent
+file_path = (base_path / "Table_widget_gui.ui").resolve()
+
+uiFile = file_path
+
+WindowTemplate, TemplateBaseClass = pg.Qt.loadUiType(uiFile)
+
+class MainWindow(TemplateBaseClass):
+
+ def __init__(self):
+ super(TemplateBaseClass, self).__init__()
+
+ # Create the main window
+ self.ui = WindowTemplate()
+ self.ui.setupUi(self)
+
+ self.clear()
+
+ self.ui.clear_pushButton.clicked.connect(self.clear)
+ self.ui.add_row_pushButton.clicked.connect(self.add_row)
+ self.ui.add_column_pushButton.clicked.connect(self.add_column)
+
+ """Saving and Copying --- implemented from pyqtgraph TableWidget"""
+ self.contextMenu = QtGui.QMenu()
+ self.contextMenu.addAction('Copy Selection').triggered.connect(self.copySel)
+ self.contextMenu.addAction('Copy All').triggered.connect(self.copyAll)
+ self.contextMenu.addAction('Save Selection').triggered.connect(self.saveSel)
+ self.contextMenu.addAction('Save All').triggered.connect(self.saveAll)
+
+ self.show()
+
+ def clear(self):
+ self.ui.tableWidget.clear()
+ self.verticalHeadersSet = False
+ self.horizontalHeadersSet = False
+
+ def add_row(self):
+ row_position = self.ui.tableWidget.rowCount()
+ self.ui.tableWidget.insertRow(row_position)
+
+ def add_column(self):
+ column_position = self.ui.tableWidget.columnCount()
+ self.ui.tableWidget.insertColumn(column_position)
+
+ def save_table(self):# Needs to be implemented
+ print(self.ui.tableWidget.currentItem().text())
+
+ def serialize(self, useSelection=False):
+ """Convert entire table (or just selected area) into tab-separated text values"""
+ if useSelection:
+ selection = self.ui.tableWidget.selectedRanges()[0]
+ rows = list(range(selection.topRow(),
+ selection.bottomRow() + 1))
+ columns = list(range(selection.leftColumn(),
+ selection.rightColumn() + 1))
+ else:
+ rows = list(range(self.ui.tableWidget.rowCount()))
+ columns = list(range(self.ui.tableWidget.columnCount()))
+
+ data = []
+ if self.horizontalHeadersSet:
+ row = []
+ if self.verticalHeadersSet:
+ row.append(asUnicode(''))
+
+ for c in columns:
+ row.append(asUnicode(self.ui.tableWidget.horizontalHeaderItem(c).text()))
+ data.append(row)
+
+ for r in rows:
+ row = []
+ if self.verticalHeadersSet:
+ row.append(asUnicode(self.ui.tableWidget.verticalHeaderItem(r).text()))
+ for c in columns:
+ item = self.ui.tableWidget.item(r, c)
+ if item is not None:
+ row.append(asUnicode(item.text()))
+ else:
+ row.append(asUnicode(''))
+ data.append(row)
+
+ s = ''
+ for row in data:
+ s += ('\t'.join(row) + '\n')
+ return s
+
+
+ def copySel(self):
+ """Copy selected data to clipboard."""
+ QtGui.QApplication.clipboard().setText(self.serialize(useSelection=True))
+
+ def copyAll(self):
+ """Copy all data to clipboard."""
+ QtGui.QApplication.clipboard().setText(self.serialize(useSelection=False))
+
+
+ def saveSel(self):
+ """Save selected data to file."""
+ self.save(self.serialize(useSelection=True))
+
+
+ def saveAll(self):
+ """Save all data to file."""
+ self.save(self.serialize(useSelection=False))
+
+
+ def save(self, data):
+ fileName = QtGui.QFileDialog.getSaveFileName(self, "Save As..", "", "Tab-separated values (*.tsv)")
+ if fileName == '':
+ return
+ open(fileName[0], 'w').write(data)
+
+ def contextMenuEvent(self, ev):
+ self.contextMenu.popup(ev.globalPos())
+
+ def keyPressEvent(self, ev):
+ if ev.key() == QtCore.Qt.Key_C and ev.modifiers() == QtCore.Qt.ControlModifier:
+ ev.accept()
+ self.copySel()
+# else:
+# QtGui.QTableWidget.keyPressEvent(self, ev)
+"""Run the Main Window"""
+def run():
+ win = MainWindow()
+ QtGui.QApplication.instance().exec_()
+ return win
+
+#run()
\ No newline at end of file
diff --git a/PythonGUI_apps/Table/Table_widget_gui.ui b/PythonGUI_apps/Table/Table_widget_gui.ui
new file mode 100644
index 0000000..d5fae7e
--- /dev/null
+++ b/PythonGUI_apps/Table/Table_widget_gui.ui
@@ -0,0 +1,70 @@
+
+
+ Form
+
+
+
+ 0
+ 0
+ 658
+ 438
+
+
+
+ TableWidget
+
+
+ -
+
+
+ Add Row
+
+
+
+ -
+
+
+ Add Column
+
+
+
+ -
+
+
+ Clear
+
+
+
+ -
+
+
+ 12
+
+
+ 6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PythonGUI_apps/Table/__init__.py b/PythonGUI_apps/Table/__init__.py
new file mode 100644
index 0000000..1a21e72
--- /dev/null
+++ b/PythonGUI_apps/Table/__init__.py
@@ -0,0 +1,7 @@
+# -*- coding: utf-8 -*-
+"""
+Created on Mon Sep 2 17:52:35 2019
+
+@author: Sarthak
+"""
+
diff --git a/PythonGUI_apps/UV_Vis_analysis/uv_vis_analysis.py b/PythonGUI_apps/UV_Vis_analysis/uv_vis_analysis.py
index 44e2ffb..6302a40 100644
--- a/PythonGUI_apps/UV_Vis_analysis/uv_vis_analysis.py
+++ b/PythonGUI_apps/UV_Vis_analysis/uv_vis_analysis.py
@@ -52,6 +52,8 @@ def __init__(self):
self.correction_region.setRegion((self.correction_region_min, self.correction_region_max))
#setup uv vis ui signals
+ self.ui.correct_for_scattering_checkBox.stateChanged.connect(self.scattering_checkBox_state)
+ self.scatter_corrected = False
self.ui.actionLoad_data.triggered.connect(self.open_data_file)
self.ui.plot_absorbance_pushButton.clicked.connect(self.plot_absorbance)
self.ui.clear_uvvis_pushButton.clicked.connect(self.clear_uvvis)
@@ -76,7 +78,7 @@ def __init__(self):
def open_data_file(self):
try:
self.filename = QtWidgets.QFileDialog.getOpenFileName(self)
- self.data = np.loadtxt(self.filename[0], delimiter = ',', skiprows = 1)
+ self.data = np.loadtxt(self.filename[0], delimiter = ',', skiprows = 2)
self.Wavelength = self.data[:,0] # in nm
self.Absorbance = self.data[:,1]
except Exception as err:
@@ -85,14 +87,28 @@ def open_data_file(self):
def update_correction_region(self):
""" Update correction region variables from region """
self.correction_region_min, self.correction_region_max = self.correction_region.getRegion()
+
+ def scattering_checkBox_state(self):
+ if self.ui.correct_for_scattering_checkBox.isChecked():
+ self.scatter_corrected = True
+ self.ui.mean_radioButton.setEnabled(True)
+ self.ui.fourth_orderpoly_radioButton.setEnabled(True)
+ else:
+ self.scatter_corrected = False
+ self.ui.mean_radioButton.setEnabled(False)
+ self.ui.fourth_orderpoly_radioButton.setEnabled(False)
def plot_absorbance(self):
try:
- self.scatter_corrected = False
self.plotted_absorbance = self.Absorbance #by default set to original absorbance data
- if self.ui.correct_for_scattering_checkBox.isChecked(): #if checked, correct absorbance data
- self.scatter_corrected = True
- self.plotted_absorbance = self.Absorbance - np.mean(self.Absorbance[(self.Wavelength>self.correction_region_min) & (self.Wavelengthself.correction_region_min) & (self.Wavelengthself.correction_region_min) & (self.Wavelengthself.correction_region_min) & (self.Wavelengthself.correction_region_min) & (self.Wavelengthself.correction_region_min) & (self.Wavelengthself.correction_region_min) & (self.Wavelength self.hv_min) & (self.hv < self.hv_max)
model = np.polyfit(self.hv[self.index], self.Alpha_hv[self.index], 1)
self.Alpha_hv_fit = self.hv * model[0] + model[1] #This is the linear fit
diff --git a/PythonGUI_apps/UV_Vis_analysis/uv_vis_analysis_gui.ui b/PythonGUI_apps/UV_Vis_analysis/uv_vis_analysis_gui.ui
index c3289df..85bd935 100644
--- a/PythonGUI_apps/UV_Vis_analysis/uv_vis_analysis_gui.ui
+++ b/PythonGUI_apps/UV_Vis_analysis/uv_vis_analysis_gui.ui
@@ -23,27 +23,57 @@
-
-
-
+
-
+
+
+ Scattering Correction
+
+
+
+ -
Plot
- -
-
+
-
+
+
+ false
+
- Correct for scattering
+ 4th Order Polynomial
+
+
+ true
- -
+
-
Clear
+ -
+
+
+ Correct for scattering
+
+
+
+ -
+
+
+ false
+
+
+ Simple Mean
+
+
+
-
diff --git a/README.md b/README.md
index a1cea03..a000a87 100644
--- a/README.md
+++ b/README.md
@@ -8,12 +8,14 @@ _**Python is not required to use GLabViz**_ (see **How to use?**)
The primary users for this Python package application are Ginger Lab members at the University of Washington, Seattle but is licensed under MIT License and open for everyone to use.
## Includes
+
* **Fluorescence Lifetime Analysis**
* Analyze lifetime
* Fit data with or without IRF
* Fit with stretched, single, or double exponential functions by diff_ev or fmin_tnc
* Calculate surface recombination velocity
* Export graph and fit results
+
* **Spectra Analysis**
* Analyze single spectrum
* Fit with or without background and white light
@@ -26,26 +28,32 @@ The primary users for this Python package application are Ginger Lab members at
* Plot fitted scan by pk_pos, fwhm, sigma, or height
* Export fitted scan
* .pkl to .txt, .pkl to .h5 converters
+
* **Fluorescence Lifetime Imaging Microscopy (FLIM) Data Analysis**
* Load lifetime scans in .h5 or .pkl files
* Plot histogram intensity sums and analyze PSF
* Export intensities array and intensities image
* Plot raw histogram data and analyze lifetime
* Compare lifetime in two different regions
+
* **Photluminescence Quantum Efficiency (PLQE) Analysis**
* Plot PLQE data
* Calculate PLQE
+
* **UV-Vis Data Analysis**
* Plot UV-Vis data
* Correct UV-Vis data for scattering
* Plot Tauc data
* Calculate bandgap
* Export UV-Vis and Tauc plots
+
* **General *H5* View and Plot**
* Load .h5 file to view file structure
* Plot datasets as a graph or an image
+
* **H5 and PKL File Viewer**
* Load .h5 or .pkl file to view file structure
+
* **Image Analysis**
* Load image on SPOT or Pixera settings, or specify pixel size
* Handle RGB and greyscale images