LSSTApplications
10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
home
lsstsw
stack
Linux64
afw
11.0-2-g04d2804
include
lsst
afw
detection
FootprintSet.h
Go to the documentation of this file.
1
// -*- lsst-c++ -*-
2
/*
3
* LSST Data Management System
4
* Copyright 2008, 2009, 2010 LSST Corporation.
5
*
6
* This product includes software developed by the
7
* LSST Project (http://www.lsst.org/).
8
*
9
* This program is free software: you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation, either version 3 of the License, or
12
* (at your option) any later version.
13
*
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU General Public License for more details.
18
*
19
* You should have received a copy of the LSST License Statement and
20
* the GNU General Public License along with this program. If not,
21
* see <http://www.lsstcorp.org/LegalNotices/>.
22
*/
23
24
#if !defined(LSST_DETECTION_FOOTPRINT_SET_H)
25
#define LSST_DETECTION_FOOTPRINT_SET_H
26
30
#include "
lsst/afw/geom.h
"
31
#include "
lsst/afw/detection/Threshold.h
"
32
#include "
lsst/afw/detection/Footprint.h
"
33
#include "
lsst/afw/detection/FootprintCtrl.h
"
34
#include "
lsst/afw/image/MaskedImage.h
"
35
#include "
lsst/afw/table/Source.h
"
36
37
namespace
lsst {
38
namespace
afw {
39
namespace
detection {
40
46
typedef
boost::uint64_t
FootprintIdPixel
;
47
48
/************************************************************************************************************/
53
class
FootprintSet
:
public
lsst::daf::base::Citizen
{
54
public
:
55
57
typedef
std::vector<Footprint::Ptr>
FootprintList
;
58
59
#ifndef SWIG
60
template
<
typename
ImagePixelT>
61
FootprintSet
(
image::Image<ImagePixelT>
const
& img,
62
Threshold
const
& threshold,
63
int
const
npixMin
=1,
bool
const
setPeaks=
true
);
64
65
template
<
typename
MaskPixelT>
66
FootprintSet
(
image::Mask<MaskPixelT>
const
& img,
67
Threshold
const
& threshold,
68
int
const
npixMin
=1);
69
70
template
<
typename
ImagePixelT,
typename
MaskPixelT>
71
FootprintSet
(
image::MaskedImage<ImagePixelT, MaskPixelT>
const
& img,
72
Threshold
const
& threshold,
73
std::string
const
& planeName =
""
,
74
int
const
npixMin
=1,
bool
const
setPeaks=
true
);
75
76
#else // workaround for https://github.com/swig/swig/issues/245
77
// if that bug is fixed then you may update footprintset.i by uncommenting two lines
78
// and removing this section. However, you must continue to provide SWIG
79
// the alternate version of the template <typename MaskPixelT> constructor, because
80
// SWIG cannot disambiguate that from the template <typename ImagePixelT> constructor.
81
82
FootprintSet
(
image::Mask<image::MaskPixel>
const
& img,
83
Threshold
const
& threshold,
84
int
const
npixMin
=1);
85
86
FootprintSet
(
image::Image<boost::uint16_t>
const
& img,
87
Threshold
const
& threshold,
88
int
const
npixMin
=1,
bool
const
setPeaks=
true
);
89
FootprintSet
(
image::MaskedImage<boost::uint16_t, image::MaskPixel>
const
& img,
90
Threshold
const
& threshold,
91
std::string
const
& planeName =
""
,
92
int
const
npixMin
=1,
bool
const
setPeaks=
true
);
93
94
FootprintSet
(
image::Image<int>
const
& img,
95
Threshold
const
& threshold,
96
int
const
npixMin
=1,
bool
const
setPeaks=
true
);
97
FootprintSet
(
image::MaskedImage<int, image::MaskPixel>
const
& img,
98
Threshold
const
& threshold,
99
std::string
const
& planeName =
""
,
100
int
const
npixMin
=1,
bool
const
setPeaks=
true
);
101
102
FootprintSet
(
image::Image<float>
const
& img,
103
Threshold
const
& threshold,
104
int
const
npixMin
=1,
bool
const
setPeaks=
true
);
105
FootprintSet
(
image::MaskedImage<float, image::MaskPixel>
const
& img,
106
Threshold
const
& threshold,
107
std::string
const
& planeName =
""
,
108
int
const
npixMin
=1,
bool
const
setPeaks=
true
);
109
110
FootprintSet
(
image::Image<double>
const
& img,
111
Threshold
const
& threshold,
112
int
const
npixMin
=1,
bool
const
setPeaks=
true
);
113
FootprintSet
(
image::MaskedImage<double, image::MaskPixel>
const
& img,
114
Threshold
const
& threshold,
115
std::string
const
& planeName =
""
,
116
int
const
npixMin
=1,
bool
const
setPeaks=
true
);
117
118
#endif
119
120
FootprintSet
(
geom::Box2I
region);
121
FootprintSet
(
FootprintSet
const
&);
122
FootprintSet
(
FootprintSet
const
& set,
int
rGrow,
FootprintControl
const
& ctrl);
123
FootprintSet
(
FootprintSet
const
& set,
int
rGrow,
bool
isotropic=
true
);
124
FootprintSet
(
FootprintSet
const
& footprints1,
125
FootprintSet
const
& footprints2,
126
bool
const
includePeaks);
127
128
FootprintSet
&
operator=
(
FootprintSet
const
& rhs);
129
130
void
swap
(
FootprintSet
& rhs) {
131
using
std::swap
;
// See Meyers, Effective C++, Item 25
132
swap
(*
_footprints
, *rhs.
getFootprints
());
133
geom::Box2I
rhsRegion = rhs.
getRegion
();
134
rhs.
setRegion
(
getRegion
());
135
setRegion
(rhsRegion);
136
}
137
138
void
swapFootprintList
(
FootprintList
& rhs) {
139
using
std::swap
;
140
swap
(*
_footprints
, rhs);
141
}
142
146
PTR
(
FootprintList
)
getFootprints
() {
return
_footprints
; }
147
151
void
setFootprints
(
PTR
(
FootprintList
) footprints) {
_footprints
= footprints; }
152
156
CONST_PTR
(
FootprintList
) const
getFootprints
()
const
{
return
_footprints
; }
157
166
void
makeSources
(
afw::table::SourceCatalog
& catalog)
const
;
167
168
void
setRegion
(
geom::Box2I
const
& region);
169
173
geom::Box2I
const
getRegion
()
const
{
return
_region
; }
174
175
PTR
(
image::Image<FootprintIdPixel>
)
insertIntoImage
(
176
const
bool
relativeIDs
177
) const;
178
179
template <typename MaskPixelT>
180
void
setMask
(
181
image
::Mask<MaskPixelT> *mask,
182
std::
string
const& planeName
183
) {
184
setMaskFromFootprintList
(
185
mask,
186
_footprints
,
// calling getFootprints() confuses clang++ 3.0 and leaks memory
187
image::Mask<MaskPixelT>::getPlaneBitMask
(planeName)
188
);
189
}
190
191
template
<
typename
MaskPixelT>
192
void
setMask
(
193
PTR
(
image::Mask<MaskPixelT>
) mask,
194
std::string
const
& planeName
195
) {
196
setMask
(mask.get(), planeName);
197
}
198
199
void
merge
(
FootprintSet
const
& rhs,
int
tGrow=0,
int
rGrow=0,
bool
isotropic=
true
);
200
201
template
<
typename
ImagePixelT,
typename
MaskPixelT>
202
void
makeHeavy
(
image::MaskedImage<ImagePixelT, MaskPixelT>
const
& mimg,
203
HeavyFootprintCtrl
const
* ctrl=NULL
204
);
205
private
:
206
boost::shared_ptr<FootprintList>
_footprints
;
207
geom::Box2I
_region
;
208
};
209
210
}}}
211
212
#endif
geom.h
An include file to include the header files for lsst::afw::geom.
lsst::afw::detection::FootprintControl
A Control Object for Footprints, controlling e.g. how they are grown.
Definition:
FootprintCtrl.h:36
lsst::afw::detection::FootprintSet::setRegion
void setRegion(geom::Box2I const ®ion)
Definition:
FootprintSet.cc:1352
Footprint.h
Represent a set of pixels of an arbitrary shape and size.
lsst::afw::image::swap
void swap(ImageBase< PixelT > &a, ImageBase< PixelT > &b)
Definition:
Image.cc:291
lsst::afw::detection::FootprintSet::setFootprints
void setFootprints(boost::shared_ptr< FootprintList > footprints)
Definition:
FootprintSet.h:151
lsst::afw::detection::HeavyFootprintCtrl
A control object for HeavyFootprints.
Definition:
FootprintCtrl.h:91
lsst::afw::detection::FootprintSet::getFootprints
boost::shared_ptr< FootprintList > getFootprints()
Definition:
FootprintSet.h:146
lsst::afw::detection::FootprintSet::makeHeavy
void makeHeavy(image::MaskedImage< ImagePixelT, MaskPixelT > const &mimg, HeavyFootprintCtrl const *ctrl=NULL)
Definition:
FootprintSet.cc:1470
PTR
#define PTR(...)
Definition:
base.h:41
lsst::afw::detection::Threshold
A Threshold is used to pass a threshold value to detection algorithms.
Definition:
Threshold.h:44
Source.h
lsst::afw::detection::FootprintSet::setMask
void setMask(image::Mask< MaskPixelT > *mask, std::string const &planeName)
Definition:
FootprintSet.h:180
lsst::afw::geom::Box2I
An integer coordinate rectangle.
Definition:
Box.h:53
image
table::Key< table::Array< Kernel::Pixel > > image
Definition:
FixedKernel.cc:117
lsst::afw::detection::FootprintSet::_region
geom::Box2I _region
The corners of the MaskedImage that the detections live in.
Definition:
FootprintSet.h:207
lsst::afw::detection::FootprintSet::FootprintSet
FootprintSet(image::Image< ImagePixelT > const &img, Threshold const &threshold, int const npixMin=1, bool const setPeaks=true)
Definition:
FootprintSet.cc:749
lsst::afw::table::SortedCatalogT
Custom catalog class for record/table subclasses that are guaranteed to have an ID, and should generally be sorted by that ID.
Definition:
fwd.h:55
lsst::afw::image::Mask
Represent a 2-dimensional array of bitmask pixels.
Definition:
Mask.h:93
lsst::afw::detection::FootprintSet::swapFootprintList
void swapFootprintList(FootprintList &rhs)
Definition:
FootprintSet.h:138
lsst::afw::image::MaskedImage
A class to manipulate images, masks, and variance as a single object.
Definition:
MaskedImage.h:77
lsst::afw::detection::FootprintSet::operator=
FootprintSet & operator=(FootprintSet const &rhs)
Assignment operator.
Definition:
FootprintSet.cc:1326
lsst::afw::detection::FootprintSet::_footprints
boost::shared_ptr< FootprintList > _footprints
the Footprints of detected objects
Definition:
FootprintSet.h:206
Threshold.h
Represent a detection threshold.
lsst::afw::detection::FootprintSet::insertIntoImage
boost::shared_ptr< image::Image< FootprintIdPixel > > insertIntoImage(const bool relativeIDs) const
Definition:
FootprintSet.cc:1438
lsst::afw::detection::FootprintSet::FootprintList
std::vector< Footprint::Ptr > FootprintList
The FootprintSet's set of Footprints.
Definition:
FootprintSet.h:57
lsst::afw::detection::FootprintSet
A set of Footprints, associated with a MaskedImage.
Definition:
FootprintSet.h:53
FootprintCtrl.h
Control Footprint-related algorithms.
CONST_PTR
#define CONST_PTR(...)
Definition:
base.h:47
lsst::afw::detection::FootprintSet::getRegion
geom::Box2I const getRegion() const
Definition:
FootprintSet.h:173
MaskedImage.h
Implementation of the Class MaskedImage.
lsst::afw.display::npixMin
int const npixMin
Definition:
saturated.cc:72
lsst::daf::base::Citizen
Citizen is a class that should be among all LSST classes base classes, and handles basic memory manag...
Definition:
Citizen.h:56
lsst::afw::detection::FootprintSet::makeSources
void makeSources(afw::table::SourceCatalog &catalog) const
Add a new record corresponding to each footprint to a SourceCatalog.
Definition:
FootprintSet.cc:1487
lsst::afw::image::Image< ImagePixelT >
lsst::afw::detection::FootprintIdPixel
boost::uint64_t FootprintIdPixel
Definition:
FootprintSet.h:46
lsst::afw::detection::FootprintSet::setMask
void setMask(boost::shared_ptr< image::Mask< MaskPixelT > > mask, std::string const &planeName)
Definition:
FootprintSet.h:192
lsst::afw::detection::FootprintSet::merge
void merge(FootprintSet const &rhs, int tGrow=0, int rGrow=0, bool isotropic=true)
Definition:
FootprintSet.cc:1336
lsst::afw::detection::setMaskFromFootprintList
MaskT setMaskFromFootprintList(lsst::afw::image::Mask< MaskT > *mask, std::vector< boost::shared_ptr< Footprint >> const &footprints, MaskT const bitmask)
OR bitmask into all the Mask's pixels which are in the set of Footprints.
lsst::afw::detection::FootprintSet::swap
void swap(FootprintSet &rhs)
Definition:
FootprintSet.h:130
Generated on Thu Sep 24 2015 02:29:14 for LSSTApplications by
1.8.5