22 #include "pybind11/pybind11.h"
23 #include "pybind11/stl.h"
28 #include "lsst/afw/image/MaskedImage.h"
30 #include "lsst/pex/policy/Policy.h"
32 namespace py = pybind11;
33 using namespace pybind11::literals;
48 template <
typename PixelT>
49 void declareImageStatistics(py::module &mod, std::string
const &suffix) {
50 py::class_<ImageStatistics<PixelT>, std::shared_ptr<ImageStatistics<PixelT>>> cls(
51 mod, (
"ImageStatistics" + suffix).c_str());
53 cls.def(py::init<pex::policy::Policy const &>(),
"policy"_a);
55 cls.def(
"reset", &ImageStatistics<PixelT>::reset);
56 cls.def(
"apply", (
void (ImageStatistics<PixelT>::*)(afw::image::MaskedImage<PixelT>
const &)) &
57 ImageStatistics<PixelT>::apply,
59 cls.def(
"apply", (
void (ImageStatistics<PixelT>::*)(afw::image::MaskedImage<PixelT>
const &,
int)) &
60 ImageStatistics<PixelT>::apply,
62 cls.def(
"setBpMask", &ImageStatistics<PixelT>::setBpMask,
"bpMask"_a);
63 cls.def(
"getBpMask", &ImageStatistics<PixelT>::getBpMask);
64 cls.def(
"getMean", &ImageStatistics<PixelT>::getMean);
65 cls.def(
"getVariance", &ImageStatistics<PixelT>::getVariance);
66 cls.def(
"getRms", &ImageStatistics<PixelT>::getRms);
67 cls.def(
"getNpix", &ImageStatistics<PixelT>::getNpix);
68 cls.def(
"evaluateQuality", &ImageStatistics<PixelT>::evaluateQuality,
"policy"_a);
74 py::module::import(
"lsst.pex.policy");
75 py::module::import(
"lsst.afw.image");
77 py::module mod(
"imageStatistics");
79 declareImageStatistics<int>(mod,
"I");
80 declareImageStatistics<float>(mod,
"F");
81 declareImageStatistics<double>(mod,
"D");
Image Subtraction helper functions.
PYBIND11_PLUGIN(basisLists)