OpenMS  2.6.0
Spectrum2DWidget.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2020.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Timo Sachsenberg$
32 // $Authors: Marc Sturm $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
37 // OpenMS_GUI config
38 #include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
39 
40 // OpenMS
43 
44 class QGroupBox;
45 class QLabel;
46 class QCheckBox;
47 
48 namespace OpenMS
49 {
50  class Spectrum1DWidget;
51 
63  class OPENMS_GUI_DLLAPI Spectrum2DWidget :
64  public SpectrumWidget
65  {
66  Q_OBJECT
67 public:
70 
72  Spectrum2DWidget(const Param & preferences, QWidget * parent = nullptr);
74  ~Spectrum2DWidget() override;
75 
78  {
79  return static_cast<Spectrum2DCanvas *>(canvas_);
80  }
81 
83  const Spectrum1DWidget * getHorizontalProjection() const;
85  const Spectrum1DWidget * getVerticalProjection() const;
86 
88  bool projectionsVisible() const;
89 
90 
91 public slots:
92  // Docu in base class
93  void recalculateAxes_() override;
95  void toggleProjections();
97  void updateProjections();
98  // Docu in base class
99  void showGoToDialog() override;
100 
101 signals:
107  void visibleAreaChanged(DRange<2> area);
109  void showSpectrumAs1D(int index);
110  void showSpectrumAs1D(std::vector<int, std::allocator<int> > indices);
112  void showCurrentPeaksAs3D();
113 
114 protected:
115  // Docu in base class
116  Math::Histogram<> createIntensityDistribution_() const override;
117  // Docu in base class
118  Math::Histogram<> createMetaDistribution_(const String & name) const override;
119 
125  QGroupBox * projection_box_;
129  QLabel * projection_sum_;
131  QLabel * projection_max_;
133  QCheckBox * projections_auto_;
136 
137 private slots:
139  void horizontalProjection(ExperimentSharedPtrType exp);
141  void verticalProjection(ExperimentSharedPtrType exp);
143  void projectionInfo(int peaks, double intensity, double max);
145  void autoUpdateProjections();
146  };
147 }
148 
SpectrumWidget.h
OpenMS::LayerData::ExperimentSharedPtrType
boost::shared_ptr< ExperimentType > ExperimentSharedPtrType
SharedPtr on MSExperiment.
Definition: LayerData.h:149
OpenMS::Spectrum1DWidget
Widget for visualization of several spectra.
Definition: Spectrum1DWidget.h:65
OpenMS::String
A more convenient string class.
Definition: String.h:59
OpenMS::DRange< 2 >
OpenMS::Spectrum2DWidget::projection_horz_
Spectrum1DWidget * projection_horz_
Horizontal projection widget.
Definition: Spectrum2DWidget.h:123
OpenMS::Spectrum2DWidget::canvas
Spectrum2DCanvas * canvas()
This method is overwritten to make the class specific members accessible.
Definition: Spectrum2DWidget.h:77
OpenMS::Spectrum2DWidget::projection_sum_
QLabel * projection_sum_
Intensity sum of the projection.
Definition: Spectrum2DWidget.h:129
OpenMS::SpectrumWidget
Base class for spectrum widgets.
Definition: SpectrumWidget.h:80
QWidget
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
OpenMS::Math::Histogram
Representation of a histogram.
Definition: Histogram.h:63
OpenMS::Spectrum2DWidget::projections_timer_
QTimer * projections_timer_
Timer that triggers auto-update of projections.
Definition: Spectrum2DWidget.h:135
OpenMS::Spectrum2DWidget::projection_vert_
Spectrum1DWidget * projection_vert_
Vertical projection widget.
Definition: Spectrum2DWidget.h:121
OpenMS::Spectrum2DWidget::ExperimentSharedPtrType
LayerData::ExperimentSharedPtrType ExperimentSharedPtrType
Main managed data type (experiment)
Definition: Spectrum2DWidget.h:69
OpenMS::Spectrum2DWidget
Widget for 2D-visualization of peak map and feature map data.
Definition: Spectrum2DWidget.h:63
OpenMS::Spectrum2DCanvas
Canvas for 2D-visualization of peak map, feature map and consensus map data.
Definition: Spectrum2DCanvas.h:70
OpenMS::Spectrum2DWidget::projection_peaks_
QLabel * projection_peaks_
Number of peaks of the projection.
Definition: Spectrum2DWidget.h:127
OpenMS::Param
Management and storage of parameters / INI files.
Definition: Param.h:73
Spectrum2DCanvas.h
OpenMS::Spectrum2DWidget::projection_box_
QGroupBox * projection_box_
Group box that shows information about the projections.
Definition: Spectrum2DWidget.h:125
OpenMS::Spectrum2DWidget::projections_auto_
QCheckBox * projections_auto_
Checkbox that indicates that projections should be automatically updated (with a slight delay)
Definition: Spectrum2DWidget.h:133
OpenMS::Spectrum2DWidget::projection_max_
QLabel * projection_max_
Intensity maximum of the projection.
Definition: Spectrum2DWidget.h:131