casacore
Loading...
Searching...
No Matches
LCPixelSet.h
Go to the documentation of this file.
1// # LCPixelSet.h: Class to define a rectangular set of pixels as a region
2// # Copyright (C) 1998,1999
3// # Associated Universities, Inc. Washington DC, USA.
4// #
5// # This library is free software; you can redistribute it and/or modify it
6// # under the terms of the GNU Library General Public License as published by
7// # the Free Software Foundation; either version 2 of the License, or (at your
8// # option) any later version.
9// #
10// # This library is distributed in the hope that it will be useful, but WITHOUT
11// # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12// # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13// # License for more details.
14// #
15// # You should have received a copy of the GNU Library General Public License
16// # along with this library; if not, write to the Free Software Foundation,
17// # Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18// #
19// # Correspondence concerning AIPS++ should be addressed as follows:
20// # Internet email: casa-feedback@nrao.edu.
21// # Postal address: AIPS++ Project Office
22// # National Radio Astronomy Observatory
23// # 520 Edgemont Road
24// # Charlottesville, VA 22903-2475 USA
25
26#ifndef LATTICES_LCPIXELSET_H
27#define LATTICES_LCPIXELSET_H
28
29// # Includes
30#include <casacore/casa/aips.h>
31#include <casacore/lattices/LRegions/LCBox.h>
32#include <casacore/casa/Arrays/Slicer.h>
33
34namespace casacore { // # NAMESPACE CASACORE - BEGIN
35
36// <summary>
37// Class to define a rectangular mask as a region
38// </summary>
39
40// <use visibility=export>
41
42// <reviewed reviewer="" date="" tests="">
43// </reviewed>
44
45// <prerequisite>
46// <li> <linkto class=LCRegion>LCRegion</linkto>
47// </prerequisite>
48
49// <synopsis>
50// The LCPixelSet class is a specialization of class
51// <linkto class=LCRegion>LCRegion</linkto>.
52// It makes it possible to define a rectangular region of interest.
53// </synopsis>
54
55// <example>
56// <srcblock>
57// </srcblock>
58// </example>
59
60// <todo asof="1997/11/11">
61// </todo>
62
63class LCPixelSet : public LCRegionFixed {
64 public:
66
67 // Construct from the box defining the position of the mask.
68 // The shape of the region and mask must be the same.
69 LCPixelSet(const Array<Bool>& mask, const LCBox& region);
70
71 // Copy constructor (copy semantics).
72 LCPixelSet(const LCPixelSet& other);
73
74 virtual ~LCPixelSet();
75
76 // Assignment (copy semantics).
78
79 // Make a copy of the derived object.
80 LCRegion* cloneRegion() const override;
81
82 // Get the class name (to store in the record).
83 static String className();
84
85 // Get the region type. Returns className().
86 String type() const override;
87
88 // Convert the (derived) object to a record.
89 TableRecord toRecord(const String& tableName) const override;
90
91 // Convert correct object from a record.
92 static LCPixelSet* fromRecord(const TableRecord&, const String& tablename);
93
94 protected:
95 // Comparison
96 Bool equals(const LCRegion& other) const override;
97
98 // Construct another LCPixelSet (for e.g. another lattice) by moving
99 // this one. It recalculates the bounding mask.
100 // A positive translation value indicates "to right".
101 LCRegion* doTranslate(const Vector<Float>& translateVector,
102 const IPosition& newLatticeShape) const override;
103
104 private:
106};
107
108} // namespace casacore
109
110#endif
String type() const override
Get the region type.
static String className()
Get the class name (to store in the record).
LCPixelSet & operator=(const LCPixelSet &other)
Assignment (copy semantics).
LCPixelSet(const Array< Bool > &mask, const LCBox &region)
Construct from the box defining the position of the mask.
TableRecord toRecord(const String &tableName) const override
Convert the (derived) object to a record.
LCRegion * cloneRegion() const override
Make a copy of the derived object.
LCPixelSet(const LCPixelSet &other)
Copy constructor (copy semantics).
Bool equals(const LCRegion &other) const override
Comparison.
LCRegion * doTranslate(const Vector< Float > &translateVector, const IPosition &newLatticeShape) const override
Construct another LCPixelSet (for e.g.
static LCPixelSet * fromRecord(const TableRecord &, const String &tablename)
Convert correct object from a record.
String: the storage and methods of handling collections of characters.
Definition String.h:355
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40