Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
PyDVT A Python package for data displaying Jorg Klora Gilles Berruyer Emmanuel Papillon Nicolas Pascal Alexandre Gobbo What’s PyDVT? Package containing Python base classes for data visualization applications. Objective Easy remake of existing ESRF graphical tools in Python. Easy creation of simple graphic applications in beamlines (on-line acquisition) Standarize graphical application development Attempt to share model with Scisoft (off-line analysis). Requirements Tk or Qt? GUI toolkit independent. Generic data abstraction layer. Independent and extensible modules. Performance. Multi-Platform. Easy of use. Simple and complex cases. … SELECTION MULTIPLE SELECTION RECT SELECTION LINE SELECTION LINE HLINE VIEW SELECTION VLINE DATA EDF FILE DATA Info SPEC SHARED MEMORY DATA PAGE RECT Info SPEC FILE DATA Array JPG FILE DATA … * DATA SELECTION * 1 … DATA * GRAPH 1 IMAGE TOOLS VIEW CONTOUR MESH * * * BINDING OBJECTS RELATION FILTER COLORMAP EDITOR … EXTENDED VIEWS INHERITANCE GUI BINDING` COLORMAP AUXILIARY DIALOGS QT Binding FUNCTION TK Binding … FIT IMPORTATION APPLICATION - Simple interface: SetSource LoadSource - Direct low-level calls Polls for changes DATA SOURCE Initialization parameters Sends DataChange Event DATA OBJECT Sends DataChange Event DATA SELECTION Reads selection by calling data's methods DATA SOURCE DATA SOURCE Initialization parameters DATA OBJECT Sends DataChange Event FILTER Reads data by calling GetOutput DATA SELECTION APPLICATION View interface VIEW Reads data by calling GetOutput FILTER Connects to View(s) Draws connected windows VIEW VIEW SELECT Generates callback on selection FILTER Sends mouse/keyboard/ ImageChange events Tkinter x Pyqt Simple Example Tk Qt import Tkinter from SPSData import * from ImageView import * import qt from SPSData import * from ImageView import * root = Tkinter.Tk () root = qt.Qapplication (sys.argv) data=SPSData (RefreshInterval=100) view = ImageView (root) view.SetSource ( ColormapFilter (None, RectSelection(data))) data.SetSource (sys.argv[1]) data.LoadSource (sys.argv[2]) view.Show () data=SPSData (RefreshInterval=100) view = ImageView (None) view.SetSource ( ColormapFilter (None, RectSelection(data))) data.SetSource (sys.argv[1]) data.LoadSource (sys.argv[2]) view.Show () root.mainloop () root.setMainWidget (View) root.exec_loop () LINE HLINE VIEW SELECTION VLINE RECT … * * GRAPH VIEW SPECIFIC NUMPY FILTER IMAGE VIEW HISTO 3D VIEW … GUI BINDING` QT Binding TK Binding * 1 * 1 NUMPY ARRAY Even Simpler Example (NumPy) Tk Qt import Tkinter from ImageView import * from Numeric import * import qt from ImageView import * from Numeric import * root = Tkinter.Tk () root = qt.Qapplication (sys.argv) view = ImageView (root) arr = Numeric.ones ((500,500)) view.SetData(Image(arr)) view.Show () view = ImageView (None) arr = Numeric.ones ((500,500)) view.SetData(Image(arr)) view.Show () root.mainloop () root.setMainWidget (View) root.exec_loop () Examples... More Information... www.esrf.fr/computing/bliss/python/PyDVT