Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Visualization

Visualization in OpenMS is based on Qt.

1D view

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

Visual editing of parameters

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;
param.load("data/Tutorial_ParamEditor.ini");
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();
param.store("output/Tutorial_ParamEditor_out.ini");
return 0;
} //end of main


OpenMS / TOPP release 1.9.0 Documentation generated on Sun Oct 27 2013 01:11:37 using doxygen 1.8.4