casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SliceWorker.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 SLICER_WORKER_H_
27 #define SLICER_WORKER_H_
28 
30 #include <casa/Arrays/Vector.h>
31 #include <QVector>
32 #include <QTextStream>
33 
34 namespace casacore{
35 
36  class Record;
37 }
38 
39 namespace casa {
40 
41  class ImageAnalysis;
42  class SliceStatistics;
43 
49  class SliceWorker {
50 
51  public:
52  SliceWorker( int id );
53  void setImage( std::shared_ptr<casacore::ImageInterface<float> > img );
54  void setVertices( const QList<int>& xValues, const QList<int>& yValues,
55  const QList<double>& xValuesWorld, const QList<double>& yValuesWorld);
58  void setSampleCount( int count );
59 
60  void setMethod( const casacore::String& method );
61 
62  void toAscii( QTextStream& stream, SliceStatistics* statistics ) const;
63  void compute();
64  int getSegmentCount() const;
65  QVector<double> getPixels(int index) const;
66  QVector<double> getData( int index, SliceStatistics* statistics ) const;
67  virtual ~SliceWorker();
68 
69  private:
70  SliceWorker( const SliceWorker& other );
71  SliceWorker& operator=( const SliceWorker other );
72 
73  double getDistance( double x, double y ) const;
74  QVector<double> interpolate( double start, double end,
75  const QVector<double>& values ) const;
76  void clearResults();
77 
78  QVector<double> getValues( int index, const QVector<double>& pixels, SliceStatistics* statistic ) const;
79  void computeSlice( const casacore::Vector<double>& xValues,
80  const casacore::Vector<double>& yValues );
81  std::shared_ptr<casacore::ImageInterface<float> > image;
82  QList<casacore::Record*> sliceResults;
87 
90 
92  int id;
94  };
95 
96 } // end namespace casa
97 
98 #endif /* SLICER_H_ */
casacore::Vector< casacore::Double > verticesYWorld
Definition: SliceWorker.h:86
SliceWorker & operator=(const SliceWorker other)
casacore::Vector< casacore::Double > verticesXWorld
Definition: SliceWorker.h:85
casacore::String method
Definition: SliceWorker.h:93
virtual ~SliceWorker()
QVector< double > getValues(int index, const QVector< double > &pixels, SliceStatistics *statistic) const
casacore::Vector< casacore::Int > coords
Definition: SliceWorker.h:89
Responsible for computing the (x,y)-values that represent a slice cut.
Definition: SliceWorker.h:49
const_iterator end() const
void setAxes(const casacore::Vector< casacore::Int > &axes)
std::shared_ptr< casacore::ImageInterface< float > > image
Definition: SliceWorker.h:81
QVector< double > getData(int index, SliceStatistics *statistics) const
QVector< double > interpolate(double start, double end, const QVector< double > &values) const
void toAscii(QTextStream &stream, SliceStatistics *statistics) const
double getDistance(double x, double y) const
QList< casacore::Record * > sliceResults
Definition: SliceWorker.h:82
QVector< double > getPixels(int index) const
Computes the angle and distance for a single line segment in the slice.
void setImage(std::shared_ptr< casacore::ImageInterface< float > > img)
casacore::Vector< casacore::Double > verticesY
Definition: SliceWorker.h:84
void computeSlice(const casacore::Vector< double > &xValues, const casacore::Vector< double > &yValues)
void setMethod(const casacore::String &method)
casacore::Vector< casacore::Int > axes
Definition: SliceWorker.h:88
String: the storage and methods of handling collections of characters.
Definition: String.h:223
void setVertices(const QList< int > &xValues, const QList< int > &yValues, const QList< double > &xValuesWorld, const QList< double > &yValuesWorld)
int getSegmentCount() const
casacore::Vector< casacore::Double > verticesX
Definition: SliceWorker.h:83
void setSampleCount(int count)
void setCoords(const casacore::Vector< casacore::Int > &coords)
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42