casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImageSlice.qo.h
Go to the documentation of this file.
1 //# Copyright (C) 1994,1995,1996,1997,1998,1999,2000
2 //# Associated Universities, Inc. Washington DC, USA.
3 //#
4 //# This library is free software; you can redistribute it and/or modify it
5 //# under the terms of the GNU Library General Public License as published by
6 //# the Free Software Foundation; either version 2 of the License, or (at your
7 //# option) any later version.
8 //#
9 //# This library is distributed in the hope that it will be useful, but WITHOUT
10 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 //# License for more details.
13 //#
14 //# You should have received a copy of the GNU Library General Public License
15 //# along with this library; if not, write to the Free Software Foundation,
16 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
17 //#
18 //# Correspondence concerning AIPS++ should be addressed as follows:
19 //# Internet email: aips2-request@nrao.edu.
20 //# Postal address: AIPS++ Project Office
21 //# National Radio Astronomy Observatory
22 //# 520 Edgemont Road
23 //# Charlottesville, VA 22903-2475 USA
24 //#
25 
26 #ifndef IMAGE_SLICE_QO_H_
27 #define IMAGE_SLICE_QO_H_
28 
29 #include <display/Slicer/ImageSlice.ui.h>
34 #include <casa/Arrays/Vector.h>
35 #include <QFrame>
36 #include <QColor>
37 #include <QString>
38 #include <QList>
39 #include <QTextStream>
40 
41 class QwtPlotCurve;
42 class QwtPlotMarker;
43 class QwtPlot;
44 
45 namespace casa {
46 
47  class ImageAnalysis;
48  class SliceSegment;
49  class ImageSliceColorBar;
50  class SliceStatistics;
51 
57  class ImageSlice : public QFrame {
58 
59  Q_OBJECT
60 
61  public:
62  ImageSlice( int id, QWidget* parent=NULL );
63  QColor getCurveColor( int index) const;
64  int getColorCount() const;
65  void setShowCorners( bool show );
66  void setSampleCount( int count );
67  void setAxes( const casacore::Vector<int>& axes );
68  void setCoords( const casacore::Vector<int>& coords );
69  void setCurveColor( QList<QColor> colors );
70  bool isSelected() const;
71  void setSelected( bool selected );
72  void setInterpolationMethod( const casacore::String& method );
73  void setImage( std::shared_ptr<casacore::ImageInterface<float> > img );
75  void setPolylineColorUnit( bool polyline );
76  void setPlotPreferences( int curveWidth, int markerSize );
77  void setViewerCurveColor( const QString& colorName );
78  void updatePolyLine( const QList<int> &pixelX, const QList<int> & pixelY,
79  const QList<double>& worldX, const QList<double>& worldY );
81  void toAscii( QTextStream& );
82  void clearCurve();
83  void addPlotCurve( QwtPlot* plot);
84 
85  virtual ~ImageSlice();
86 
87  //X-Axis
89 
90  private slots:
91  void openCloseDisplay();
92 
93  private:
94  void minimizeDisplay();
95  void maximizeDisplay();
96  void resetPlotCurve();
97  void updateSliceStatistics();
98  void clearCorners();
99  void addCorner( double xValue, double yValue, QwtPlot* plot );
100  void addSegment( SliceSegment* segment );
101  void removeSegment( SliceSegment* segment );
102  void resetSegmentColors();
103  void runSliceWorker();
104 
106  ImageSlice( const ImageSlice& other );
107  ImageSlice operator=( const ImageSlice& other );
108 
111  int regionId;
112  bool selected;
116  bool minimized;
117  QColor viewerColor;
118  QList<QColor> segmentColors;
120  QList<SliceSegment*> segments;
121  QList<QwtPlotMarker*> segmentCorners;
123  Ui::ImageSliceClass ui;
124  };
125 
126 } /* namespace casa */
127 #endif /* IMAGE_SLICE_H_ */
QColor getCurveColor(int index) const
SliceWorker * sliceWorker
void updateSliceStatistics()
ImageSlice(int id, QWidget *parent=NULL)
void minimizeDisplay()
Draws a colored rectangular bar across the top of the image slice statistics as an identifier when th...
void setInterpolationMethod(const casacore::String &method)
void setImage(std::shared_ptr< casacore::ImageInterface< float > > img)
Responsible for computing the (x,y)-values that represent a slice cut.
Definition: SliceWorker.h:49
void setSampleCount(int count)
void addCorner(double xValue, double yValue, QwtPlot *plot)
ImageSlice operator=(const ImageSlice &other)
Specialization for Quantum&lt;Vector&lt;T&gt; &gt;
Definition: QVector.h:37
void setSelected(bool selected)
void show(const variant &v)
QList< QwtPlotMarker * > segmentCorners
int getColorCount() const
void removeSegment(SliceSegment *segment)
void setPolylineColorUnit(bool polyline)
void setCurveColor(QList< QColor > colors)
void openCloseDisplay()
void setAxes(const casacore::Vector< int > &axes)
virtual ~ImageSlice()
QList< QColor > segmentColors
SliceStatistics * statistics
void updatePolyLine(const QList< int > &pixelX, const QList< int > &pixelY, const QList< double > &worldX, const QList< double > &worldY)
QList< SliceSegment * > segments
Represents a slice cut of an image.
Definition: ImageSlice.qo.h:57
void resetSegmentColors()
void setUseViewerColors(bool useViewerColors)
void toAscii(QTextStream &)
void setPlotPreferences(int curveWidth, int markerSize)
void addPlotCurve(QwtPlot *plot)
Computes the angle and distance for a single line segment in the slice.
Ui::ImageSliceClass ui
void setShowCorners(bool show)
void maximizeDisplay()
void setStatistics(SliceStatistics *statistics)
X-Axis.
String: the storage and methods of handling collections of characters.
Definition: String.h:223
bool isSelected() const
ImageSliceColorBar * colorBar
void setViewerCurveColor(const QString &colorName)
void addSegment(SliceSegment *segment)
void setCoords(const casacore::Vector< int > &coords)
void updatePositionInformation(const QVector< casacore::String > &info)