Visualization in OpenMS is based on Qt.
All types of peak or feature visualization share a common interface. So here only an example how to visualize a single spectrum is given (Tutorial_Spectrum1D.C).
First we need to create a QApplication in order to be able to use Qt widgets in out application.
Int main(int argc, const char ** argv) { QApplication app(argc, const_cast<char **>(argv));
Then we load a DTA file (the first command line argument of our application).
PeakMap exp;
exp.resize(1);
DTAFile().load("data/Tutorial_Spectrum1D.dta", exp[0]);
Then we create a widget for 1D visualization and hand over the data.
LayerData::ExperimentSharedPtrType exp_sptr(new PeakMap(exp)); Spectrum1DWidget * widget = new Spectrum1DWidget(Param(), 0); widget->canvas()->addLayer(exp_sptr); widget->show();
Finally we start the application.
return app.exec(); } //end of main
Param objects are used to set algorithm parameters in OpenMS. In order to be able to visually edit them, the ParamEditor class can be used. The following example (Tutorial_ParamEditor.C) show how to use it.
We need to create a QApplication, load the data from a file (e.g. the parameters file of any TOPP tool), create the ParamEditor and execute the application:
Int main(int argc, const char** argv) { QApplication app(argc, const_cast<char**>(argv)); Param param; ParamXMLFile paramFile; paramFile.load("data/Tutorial_ParamEditor.ini", param); ParamEditor* editor = new ParamEditor(0); editor->load(param); editor->show(); app.exec();
When it is closed, we store the result back to the Param object and then to the file.
editor->store(); paramFile.store("output/Tutorial_ParamEditor_out.ini", param); return 0; } //end of main
| OpenMS / TOPP release 1.10.0 | Documentation generated on Thu Mar 7 2013 09:42:47 using doxygen 1.7.1 |